From 5525a83600d22da62050990943ea8864294d0710 Mon Sep 17 00:00:00 2001 From: Konstantin Kosinsky Date: Tue, 17 Mar 2020 11:09:07 -0700 Subject: [PATCH 001/223] Support for external Hive metastore --- azurerm/helpers/azure/hdinsight.go | 104 +++++++++++++++- .../resource_arm_hdinsight_hadoop_cluster.go | 29 ++++- ...ource_arm_hdinsight_hadoop_cluster_test.go | 113 ++++++++++++++++++ .../r/hdinsight_hadoop_cluster.html.markdown | 13 ++ 4 files changed, 254 insertions(+), 5 deletions(-) diff --git a/azurerm/helpers/azure/hdinsight.go b/azurerm/helpers/azure/hdinsight.go index a61d8bd55af37..a48cb5bf70925 100644 --- a/azurerm/helpers/azure/hdinsight.go +++ b/azurerm/helpers/azure/hdinsight.go @@ -105,6 +105,43 @@ func SchemaHDInsightsGateway() *schema.Schema { } } +func SchemaHDInsightsHiveMetastore() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "server": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "database_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "username": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "password": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + Sensitive: true, + // Azure returns the key as *****. We'll suppress that here. + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + return (new == d.Get(k).(string)) && (old == "*****") + }, + }, + }, + }, + } +} + func ExpandHDInsightsConfigurations(input []interface{}) map[string]interface{} { vs := input[0].(map[string]interface{}) @@ -113,13 +150,41 @@ func ExpandHDInsightsConfigurations(input []interface{}) map[string]interface{} username := vs["username"].(string) password := vs["password"].(string) - return map[string]interface{}{ + config := map[string]interface{}{ "gateway": map[string]interface{}{ "restAuthCredential.isEnabled": enabled, "restAuthCredential.username": username, "restAuthCredential.password": password, }, } + return config +} + +func ExpandHDInsightsMetastore(input []interface{}) map[string]interface{} { + vs := input[0].(map[string]interface{}) + + server := vs["server"].(string) + database := vs["database_name"].(string) + username := vs["username"].(string) + password := vs["password"].(string) + + return map[string]interface{}{ + "hive-site": map[string]interface{}{ + "javax.jdo.option.ConnectionDriverName": "com.microsoft.sqlserver.jdbc.SQLServerDriver", + "javax.jdo.option.ConnectionURL": fmt.Sprintf("jdbc:sqlserver://%s;database=%s;encrypt=true;trustServerCertificate=true;create=false;loginTimeout=300", server, database), + "javax.jdo.option.ConnectionUserName": username, + "javax.jdo.option.ConnectionPassword": password, + }, + "hive-env": map[string]interface{}{ + "hive_database": "Existing MSSQL Server database with SQL authentication", + "hive_database_name": database, + "hive_database_type": "mssql", + "hive_existing_mssql_server_database": database, + "hive_existing_mssql_server_host": server, + "hive_hostname": server, + }, + } + } func FlattenHDInsightsConfigurations(input map[string]*string) []interface{} { @@ -150,6 +215,43 @@ func FlattenHDInsightsConfigurations(input map[string]*string) []interface{} { } } +func FlattenHDInsightsHiveMetastore(env map[string]*string, site map[string]*string) []interface{} { + + server := "" + if v, exists := env["hive_hostname"]; exists && v != nil { + server = *v + } + + database := "" + if v, exists := env["hive_database_name"]; exists && v != nil { + database = *v + } + + username := "" + if v, exists := site["javax.jdo.option.ConnectionUserName"]; exists && v != nil { + username = *v + } + + password := "" + if v, exists := site["javax.jdo.option.ConnectionPassword"]; exists && v != nil { + password = *v + } + + if server != "" && database != "" { + + return []interface{}{ + map[string]interface{}{ + "server": server, + "database_name": database, + "username": username, + "password": password, + }, + } + } else { + return nil + } +} + func SchemaHDInsightsStorageAccounts() *schema.Schema { return &schema.Schema{ Type: schema.TypeList, diff --git a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go b/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go index e9623d8ce35ee..53f07d58332db 100644 --- a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go +++ b/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go @@ -91,6 +91,8 @@ func resourceArmHDInsightHadoopCluster() *schema.Resource { "gateway": azure.SchemaHDInsightsGateway(), + "hive_metastore": azure.SchemaHDInsightsHiveMetastore(), + "storage_account": azure.SchemaHDInsightsStorageAccounts(), "storage_account_gen2": azure.SchemaHDInsightsGen2StorageAccounts(), @@ -183,7 +185,14 @@ func resourceArmHDInsightHadoopClusterCreate(d *schema.ResourceData, meta interf componentVersions := expandHDInsightHadoopComponentVersion(componentVersionsRaw) gatewayRaw := d.Get("gateway").([]interface{}) - gateway := azure.ExpandHDInsightsConfigurations(gatewayRaw) + configurations := azure.ExpandHDInsightsConfigurations(gatewayRaw) + + if metastoreRaw, ok := d.GetOkExists("hive_metastore"); ok { + metastore := azure.ExpandHDInsightsMetastore(metastoreRaw.([]interface{})) + for k, v := range metastore { + configurations[k] = v + } + } storageAccountsRaw := d.Get("storage_account").([]interface{}) storageAccountsGen2Raw := d.Get("storage_account_gen2").([]interface{}) @@ -225,7 +234,7 @@ func resourceArmHDInsightHadoopClusterCreate(d *schema.ResourceData, meta interf ClusterDefinition: &hdinsight.ClusterDefinition{ Kind: utils.String("Hadoop"), ComponentVersion: componentVersions, - Configurations: gateway, + Configurations: configurations, }, StorageProfile: &hdinsight.StorageProfile{ Storageaccounts: storageAccounts, @@ -311,11 +320,17 @@ func resourceArmHDInsightHadoopClusterRead(d *schema.ResourceData, meta interfac return fmt.Errorf("Error retrieving HDInsight Hadoop Cluster %q (Resource Group %q): %+v", name, resourceGroup, err) } - configuration, err := configurationsClient.Get(ctx, resourceGroup, name, "gateway") + // Each call to configurationsClient methods is HTTP request. Getting all settings in one operation + configurations, err := configurationsClient.List(ctx, resourceGroup, name) if err != nil { return fmt.Errorf("Error retrieving Configuration for HDInsight Hadoop Cluster %q (Resource Group %q): %+v", name, resourceGroup, err) } + gateway, exists := configurations.Configurations["gateway"] + if !exists { + return fmt.Errorf("Error retrieving gateway for HDInsight Hadoop Cluster %q (Resource Group %q): %+v", name, resourceGroup, err) + } + d.Set("name", name) d.Set("resource_group_name", resourceGroup) if location := resp.Location; location != nil { @@ -332,9 +347,15 @@ func resourceArmHDInsightHadoopClusterRead(d *schema.ResourceData, meta interfac return fmt.Errorf("Error flattening `component_version`: %+v", err) } - if err := d.Set("gateway", azure.FlattenHDInsightsConfigurations(configuration.Value)); err != nil { + if err := d.Set("gateway", azure.FlattenHDInsightsConfigurations(gateway)); err != nil { return fmt.Errorf("Error flattening `gateway`: %+v", err) } + + hiveEnv, envExists := configurations.Configurations["hive-env"] + hiveSite, siteExists := configurations.Configurations["hive-site"] + if envExists && siteExists { + d.Set("hive_metastore", azure.FlattenHDInsightsHiveMetastore(hiveEnv, hiveSite)) + } } hadoopRoles := hdInsightRoleDefinition{ diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go b/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go index 6ed62031cf9cc..e6d55c99166d8 100644 --- a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go +++ b/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go @@ -319,6 +319,33 @@ func TestAccAzureRMHDInsightHadoopCluster_gen2AndBlobStorage(t *testing.T) { }) } +func TestAccAzureRMHDInsightHadoopCluster_metastore(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_hdinsight_hadoop_cluster", "test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMHDInsightClusterDestroy(data.ResourceType), + Steps: []resource.TestStep{ + { + Config: testAccAzureRMHDInsightHadoopCluster_metastore(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMHDInsightClusterExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "https_endpoint"), + resource.TestCheckResourceAttrSet(data.ResourceName, "ssh_endpoint"), + ), + }, + data.ImportStep("roles.0.head_node.0.password", + "roles.0.head_node.0.vm_size", + "roles.0.worker_node.0.password", + "roles.0.worker_node.0.vm_size", + "roles.0.zookeeper_node.0.password", + "roles.0.zookeeper_node.0.vm_size", + "storage_account", + "hive_metastore.0.password"), + }, + }) +} + func testAccAzureRMHDInsightHadoopCluster_basic(data acceptance.TestData) string { template := testAccAzureRMHDInsightHadoopCluster_template(data) return fmt.Sprintf(` @@ -974,3 +1001,89 @@ resource "azurerm_role_assignment" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomString) } + +func testAccAzureRMHDInsightHadoopCluster_metastore(data acceptance.TestData) string { + template := testAccAzureRMHDInsightHadoopCluster_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_sql_server" "test"{ + name = "acctestsql-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + administrator_login = "sql_admin" + administrator_login_password = "TerrAform123!" + version = "12.0" +} + +resource "azurerm_sql_database" "test" { + name = "metastore" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + server_name = azurerm_sql_server.test.name + collation = "SQL_Latin1_General_CP1_CI_AS" + create_mode = "Default" + requested_service_objective_name = "GP_Gen5_2" +} + +resource "azurerm_sql_firewall_rule" "AzureServices" { + name = "allow-azure-services" + resource_group_name = azurerm_resource_group.test.name + server_name = azurerm_sql_server.test.name + start_ip_address = "0.0.0.0" + end_ip_address = "0.0.0.0" +} + +resource "azurerm_hdinsight_hadoop_cluster" "test" { + name = "acctesthdi-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + cluster_version = "3.6" + tier = "Standard" + + component_version { + hadoop = "2.7" + } + + gateway { + enabled = true + username = "acctestusrgw" + password = "TerrAform123!" + } + + storage_account { + storage_container_id = azurerm_storage_container.test.id + storage_account_key = azurerm_storage_account.test.primary_access_key + is_default = true + } + + roles { + head_node { + vm_size = "Standard_D3_v2" + username = "acctestusrvm" + password = "AccTestvdSC4daf986!" + } + + worker_node { + vm_size = "Standard_D4_V2" + username = "acctestusrvm" + password = "AccTestvdSC4daf986!" + target_instance_count = 2 + } + + zookeeper_node { + vm_size = "Standard_D3_v2" + username = "acctestusrvm" + password = "AccTestvdSC4daf986!" + } + } + + hive_metastore { + server = azurerm_sql_server.test.fully_qualified_domain_name + database_name = azurerm_sql_database.test.name + username = azurerm_sql_server.test.administrator_login + password = azurerm_sql_server.test.administrator_login_password + } +} +`, template, data.RandomInteger, data.RandomInteger) +} diff --git a/website/docs/r/hdinsight_hadoop_cluster.html.markdown b/website/docs/r/hdinsight_hadoop_cluster.html.markdown index 22b4104afa960..cf96c365a7682 100644 --- a/website/docs/r/hdinsight_hadoop_cluster.html.markdown +++ b/website/docs/r/hdinsight_hadoop_cluster.html.markdown @@ -107,6 +107,8 @@ The following arguments are supported: * `tags` - (Optional) A map of Tags which should be assigned to this HDInsight Hadoop Cluster. +* `hive_metastore` - (Optional) A `hive_metastore` block as defined below. + --- A `component_version` block supports the following: @@ -247,6 +249,17 @@ A `install_script_action` block supports the following: * `uri` - (Required) The URI pointing to the script to run during the installation of the edge node. Changing this forces a new resource to be created. +--- +A `hive_metastore` block supports the following: + +* `server` - (Required) The fully-qualified domain name (FQDN) of the SQL server to use for the external Hive metastore. + +* `database_name` - (Required) The external Hive metastore's existing SQL database. + +* `username` - (Required) The external Hive metastore's existing SQL server admin username. + +* `password` - (Required) The external Hive metastore's existing SQL server admin password. + ## Attributes Reference The following attributes are exported: From b2309425710144dc087dad92b20af1415ccf5162 Mon Sep 17 00:00:00 2001 From: Konstantin Kosinsky Date: Tue, 17 Mar 2020 11:37:25 -0700 Subject: [PATCH 002/223] Fix formatting --- azurerm/helpers/azure/hdinsight.go | 10 +++------- ...resource_arm_hdinsight_hadoop_cluster_test.go | 16 ++++++++-------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/azurerm/helpers/azure/hdinsight.go b/azurerm/helpers/azure/hdinsight.go index a48cb5bf70925..2863a61fca486 100644 --- a/azurerm/helpers/azure/hdinsight.go +++ b/azurerm/helpers/azure/hdinsight.go @@ -150,14 +150,13 @@ func ExpandHDInsightsConfigurations(input []interface{}) map[string]interface{} username := vs["username"].(string) password := vs["password"].(string) - config := map[string]interface{}{ + return map[string]interface{}{ "gateway": map[string]interface{}{ "restAuthCredential.isEnabled": enabled, "restAuthCredential.username": username, "restAuthCredential.password": password, }, } - return config } func ExpandHDInsightsMetastore(input []interface{}) map[string]interface{} { @@ -184,7 +183,6 @@ func ExpandHDInsightsMetastore(input []interface{}) map[string]interface{} { "hive_hostname": server, }, } - } func FlattenHDInsightsConfigurations(input map[string]*string) []interface{} { @@ -216,7 +214,6 @@ func FlattenHDInsightsConfigurations(input map[string]*string) []interface{} { } func FlattenHDInsightsHiveMetastore(env map[string]*string, site map[string]*string) []interface{} { - server := "" if v, exists := env["hive_hostname"]; exists && v != nil { server = *v @@ -238,7 +235,6 @@ func FlattenHDInsightsHiveMetastore(env map[string]*string, site map[string]*str } if server != "" && database != "" { - return []interface{}{ map[string]interface{}{ "server": server, @@ -247,9 +243,9 @@ func FlattenHDInsightsHiveMetastore(env map[string]*string, site map[string]*str "password": password, }, } - } else { - return nil } + + return nil } func SchemaHDInsightsStorageAccounts() *schema.Schema { diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go b/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go index e6d55c99166d8..21be14a5b2233 100644 --- a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go +++ b/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go @@ -1007,13 +1007,13 @@ func testAccAzureRMHDInsightHadoopCluster_metastore(data acceptance.TestData) st return fmt.Sprintf(` %s -resource "azurerm_sql_server" "test"{ - name = "acctestsql-%d" - resource_group_name = azurerm_resource_group.test.name - location = azurerm_resource_group.test.location - administrator_login = "sql_admin" - administrator_login_password = "TerrAform123!" - version = "12.0" +resource "azurerm_sql_server" "test" { + name = "acctestsql-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + administrator_login = "sql_admin" + administrator_login_password = "TerrAform123!" + version = "12.0" } resource "azurerm_sql_database" "test" { @@ -1079,7 +1079,7 @@ resource "azurerm_hdinsight_hadoop_cluster" "test" { } hive_metastore { - server = azurerm_sql_server.test.fully_qualified_domain_name + server = azurerm_sql_server.test.fully_qualified_domain_name database_name = azurerm_sql_database.test.name username = azurerm_sql_server.test.administrator_login password = azurerm_sql_server.test.administrator_login_password From ce341b97fe95786d4812849b5e6c7ad5a6c18ee0 Mon Sep 17 00:00:00 2001 From: Konstantin Kosinsky Date: Mon, 23 Mar 2020 13:45:02 -0700 Subject: [PATCH 003/223] Support for Oozie and Ambari --- azurerm/helpers/azure/hdinsight.go | 119 +++++++++++++++++- .../services/hdinsight/common_hdinsight.go | 53 ++++++++ .../resource_arm_hdinsight_hadoop_cluster.go | 30 +++-- ...ource_arm_hdinsight_hadoop_cluster_test.go | 54 ++++++-- .../r/hdinsight_hadoop_cluster.html.markdown | 41 +++++- 5 files changed, 274 insertions(+), 23 deletions(-) diff --git a/azurerm/helpers/azure/hdinsight.go b/azurerm/helpers/azure/hdinsight.go index 2863a61fca486..aa4e4c567b491 100644 --- a/azurerm/helpers/azure/hdinsight.go +++ b/azurerm/helpers/azure/hdinsight.go @@ -105,7 +105,7 @@ func SchemaHDInsightsGateway() *schema.Schema { } } -func SchemaHDInsightsHiveMetastore() *schema.Schema { +func SchemaHDInsightsExternalMetastore() *schema.Schema { return &schema.Schema{ Type: schema.TypeList, Optional: true, @@ -159,7 +159,7 @@ func ExpandHDInsightsConfigurations(input []interface{}) map[string]interface{} } } -func ExpandHDInsightsMetastore(input []interface{}) map[string]interface{} { +func ExpandHDInsightsHiveMetastore(input []interface{}) map[string]interface{} { vs := input[0].(map[string]interface{}) server := vs["server"].(string) @@ -185,6 +185,51 @@ func ExpandHDInsightsMetastore(input []interface{}) map[string]interface{} { } } +func ExpandHDInsightsOozieMetastore(input []interface{}) map[string]interface{} { + vs := input[0].(map[string]interface{}) + + server := vs["server"].(string) + database := vs["database_name"].(string) + username := vs["username"].(string) + password := vs["password"].(string) + + return map[string]interface{}{ + "oozie-site": map[string]interface{}{ + "oozie.service.JPAService.jdbc.driver": "com.microsoft.sqlserver.jdbc.SQLServerDriver", + "oozie.service.JPAService.jdbc.url": fmt.Sprintf("jdbc:sqlserver://%s;database=%s;encrypt=true;trustServerCertificate=true;create=false;loginTimeout=300", server, database), + "oozie.service.JPAService.jdbc.username": username, + "oozie.service.JPAService.jdbc.password": password, + "oozie.db.schema.name": "oozie", + }, + "oozie-env": map[string]interface{}{ + "oozie_database": "Existing MSSQL Server database with SQL authentication", + "oozie_database_name": database, + "oozie_database_type": "mssql", + "oozie_existing_mssql_server_database": database, + "oozie_existing_mssql_server_host": server, + "oozie_hostname": server, + }, + } +} + +func ExpandHDInsightsAmbariMetastore(input []interface{}) map[string]interface{} { + vs := input[0].(map[string]interface{}) + + server := vs["server"].(string) + database := vs["database_name"].(string) + username := vs["username"].(string) + password := vs["password"].(string) + + return map[string]interface{}{ + "ambari-conf": map[string]interface{}{ + "database-server": server, + "database-name": database, + "database-user-name": username, + "database-user-password": password, + }, + } +} + func FlattenHDInsightsConfigurations(input map[string]*string) []interface{} { enabled := false if v, exists := input["restAuthCredential.isEnabled"]; exists && v != nil { @@ -248,6 +293,76 @@ func FlattenHDInsightsHiveMetastore(env map[string]*string, site map[string]*str return nil } +func FlattenHDInsightsOozieMetastore(env map[string]*string, site map[string]*string) []interface{} { + server := "" + if v, exists := env["oozie_hostname"]; exists && v != nil { + server = *v + } + + database := "" + if v, exists := env["oozie_database_name"]; exists && v != nil { + database = *v + } + + username := "" + if v, exists := site["oozie.service.JPAService.jdbc.username"]; exists && v != nil { + username = *v + } + + password := "" + if v, exists := site["oozie.service.JPAService.jdbc.password"]; exists && v != nil { + password = *v + } + + if server != "" && database != "" { + return []interface{}{ + map[string]interface{}{ + "server": server, + "database_name": database, + "username": username, + "password": password, + }, + } + } + + return nil +} + +func FlattenHDInsightsAmbariMetastore(conf map[string]*string) []interface{} { + server := "" + if v, exists := conf["database-server"]; exists && v != nil { + server = *v + } + + database := "" + if v, exists := conf["database-name"]; exists && v != nil { + database = *v + } + + username := "" + if v, exists := conf["database-user-name"]; exists && v != nil { + username = *v + } + + password := "" + if v, exists := conf["database-user-password"]; exists && v != nil { + password = *v + } + + if server != "" && database != "" { + return []interface{}{ + map[string]interface{}{ + "server": server, + "database_name": database, + "username": username, + "password": password, + }, + } + } + + return nil +} + func SchemaHDInsightsStorageAccounts() *schema.Schema { return &schema.Schema{ Type: schema.TypeList, diff --git a/azurerm/internal/services/hdinsight/common_hdinsight.go b/azurerm/internal/services/hdinsight/common_hdinsight.go index 98aed1c185cb2..265c68e56dc03 100644 --- a/azurerm/internal/services/hdinsight/common_hdinsight.go +++ b/azurerm/internal/services/hdinsight/common_hdinsight.go @@ -272,3 +272,56 @@ func deleteHDInsightEdgeNodes(ctx context.Context, client *hdinsight.Application return nil } + +func expandHDInsightsMetastore(input []interface{}) map[string]interface{} { + v := input[0].(map[string]interface{}) + + config := map[string]interface{}{} + + if hiveRaw, ok := v["hive"]; ok { + for k, val := range azure.ExpandHDInsightsHiveMetastore(hiveRaw.([]interface{})) { + config[k] = val + } + } + + if oozieRaw, ok := v["oozie"]; ok { + for k, val := range azure.ExpandHDInsightsOozieMetastore(oozieRaw.([]interface{})) { + config[k] = val + } + } + + if ambariRaw, ok := v["ambari"]; ok { + for k, val := range azure.ExpandHDInsightsAmbariMetastore(ambariRaw.([]interface{})) { + config[k] = val + } + } + + return config +} + +func flattenHDInsightsMetastores(d *schema.ResourceData, configurations map[string]map[string]*string) { + result := map[string]interface{}{} + + hiveEnv, envExists := configurations["hive-env"] + hiveSite, siteExists := configurations["hive-site"] + if envExists && siteExists { + result["hive"] = azure.FlattenHDInsightsHiveMetastore(hiveEnv, hiveSite) + } + + oozieEnv, envExists := configurations["oozie-env"] + oozieSite, siteExists := configurations["oozie-site"] + if envExists && siteExists { + result["oozie"] = azure.FlattenHDInsightsOozieMetastore(oozieEnv, oozieSite) + } + + ambari, ambariExists := configurations["ambari-conf"] + if ambariExists { + result["ambari"] = azure.FlattenHDInsightsAmbariMetastore(ambari) + } + + if len(result) > 0 { + d.Set("metastores", []interface{}{ + result, + }) + } +} diff --git a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go b/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go index 53f07d58332db..d1c0802be35eb 100644 --- a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go +++ b/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go @@ -91,7 +91,20 @@ func resourceArmHDInsightHadoopCluster() *schema.Resource { "gateway": azure.SchemaHDInsightsGateway(), - "hive_metastore": azure.SchemaHDInsightsHiveMetastore(), + "metastores": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "hive": azure.SchemaHDInsightsExternalMetastore(), + + "oozie": azure.SchemaHDInsightsExternalMetastore(), + + "ambari": azure.SchemaHDInsightsExternalMetastore(), + }, + }, + }, "storage_account": azure.SchemaHDInsightsStorageAccounts(), @@ -187,11 +200,10 @@ func resourceArmHDInsightHadoopClusterCreate(d *schema.ResourceData, meta interf gatewayRaw := d.Get("gateway").([]interface{}) configurations := azure.ExpandHDInsightsConfigurations(gatewayRaw) - if metastoreRaw, ok := d.GetOkExists("hive_metastore"); ok { - metastore := azure.ExpandHDInsightsMetastore(metastoreRaw.([]interface{})) - for k, v := range metastore { - configurations[k] = v - } + metastoresRaw := d.Get("metastores").([]interface{}) + metastores := expandHDInsightsMetastore(metastoresRaw) + for k, v := range metastores { + configurations[k] = v } storageAccountsRaw := d.Get("storage_account").([]interface{}) @@ -351,11 +363,7 @@ func resourceArmHDInsightHadoopClusterRead(d *schema.ResourceData, meta interfac return fmt.Errorf("Error flattening `gateway`: %+v", err) } - hiveEnv, envExists := configurations.Configurations["hive-env"] - hiveSite, siteExists := configurations.Configurations["hive-site"] - if envExists && siteExists { - d.Set("hive_metastore", azure.FlattenHDInsightsHiveMetastore(hiveEnv, hiveSite)) - } + flattenHDInsightsMetastores(d, configurations.Configurations) } hadoopRoles := hdInsightRoleDefinition{ diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go b/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go index 21be14a5b2233..205b4259cc85c 100644 --- a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go +++ b/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go @@ -341,7 +341,9 @@ func TestAccAzureRMHDInsightHadoopCluster_metastore(t *testing.T) { "roles.0.zookeeper_node.0.password", "roles.0.zookeeper_node.0.vm_size", "storage_account", - "hive_metastore.0.password"), + "metastores.0.hive.0.password", + "metastores.0.oozie.0.password", + "metastores.0.ambari.0.password"), }, }) } @@ -1016,8 +1018,28 @@ resource "azurerm_sql_server" "test" { version = "12.0" } -resource "azurerm_sql_database" "test" { - name = "metastore" +resource "azurerm_sql_database" "hive" { + name = "hive" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + server_name = azurerm_sql_server.test.name + collation = "SQL_Latin1_General_CP1_CI_AS" + create_mode = "Default" + requested_service_objective_name = "GP_Gen5_2" +} + +resource "azurerm_sql_database" "oozie" { + name = "oozie" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + server_name = azurerm_sql_server.test.name + collation = "SQL_Latin1_General_CP1_CI_AS" + create_mode = "Default" + requested_service_objective_name = "GP_Gen5_2" +} + +resource "azurerm_sql_database" "ambari" { + name = "ambari" resource_group_name = azurerm_resource_group.test.name location = azurerm_resource_group.test.location server_name = azurerm_sql_server.test.name @@ -1078,11 +1100,27 @@ resource "azurerm_hdinsight_hadoop_cluster" "test" { } } - hive_metastore { - server = azurerm_sql_server.test.fully_qualified_domain_name - database_name = azurerm_sql_database.test.name - username = azurerm_sql_server.test.administrator_login - password = azurerm_sql_server.test.administrator_login_password + metastores { + hive { + server = azurerm_sql_server.test.fully_qualified_domain_name + database_name = azurerm_sql_database.hive.name + username = azurerm_sql_server.test.administrator_login + password = azurerm_sql_server.test.administrator_login_password + } + + oozie { + server = azurerm_sql_server.test.fully_qualified_domain_name + database_name = azurerm_sql_database.oozie.name + username = azurerm_sql_server.test.administrator_login + password = azurerm_sql_server.test.administrator_login_password + } + + ambari { + server = azurerm_sql_server.test.fully_qualified_domain_name + database_name = azurerm_sql_database.ambari.name + username = azurerm_sql_server.test.administrator_login + password = azurerm_sql_server.test.administrator_login_password + } } } `, template, data.RandomInteger, data.RandomInteger) diff --git a/website/docs/r/hdinsight_hadoop_cluster.html.markdown b/website/docs/r/hdinsight_hadoop_cluster.html.markdown index cf96c365a7682..9ebcd93d9e2c4 100644 --- a/website/docs/r/hdinsight_hadoop_cluster.html.markdown +++ b/website/docs/r/hdinsight_hadoop_cluster.html.markdown @@ -107,7 +107,7 @@ The following arguments are supported: * `tags` - (Optional) A map of Tags which should be assigned to this HDInsight Hadoop Cluster. -* `hive_metastore` - (Optional) A `hive_metastore` block as defined below. +* `metastores` - (Optional) A `metastores` block as defined below. --- @@ -249,8 +249,19 @@ A `install_script_action` block supports the following: * `uri` - (Required) The URI pointing to the script to run during the installation of the edge node. Changing this forces a new resource to be created. +--- + +A `metastores` block supports the following: + +* `hive` - (Required) A `hive` block as defined below. + +* `oozie` - (Required) A `oozie` block as defined below. + +* `ambari` - (Required) A `amabari` block as defined below. + --- -A `hive_metastore` block supports the following: + +A `hive` block supports the following: * `server` - (Required) The fully-qualified domain name (FQDN) of the SQL server to use for the external Hive metastore. @@ -260,6 +271,32 @@ A `hive_metastore` block supports the following: * `password` - (Required) The external Hive metastore's existing SQL server admin password. + +--- + +A `oozie` block supports the following: + +* `server` - (Required) The fully-qualified domain name (FQDN) of the SQL server to use for the external Oozie metastore. + +* `database_name` - (Required) The external Oozie metastore's existing SQL database. + +* `username` - (Required) The external Oozie metastore's existing SQL server admin username. + +* `password` - (Required) The external Oozie metastore's existing SQL server admin password. + +--- + +A `ambari` block supports the following: + +* `server` - (Required) The fully-qualified domain name (FQDN) of the SQL server to use for the external Ambari metastore. + +* `database_name` - (Required) The external Hive metastore's existing SQL database. + +* `username` - (Required) The external Ambari metastore's existing SQL server admin username. + +* `password` - (Required) The external Ambari metastore's existing SQL server admin password. + + ## Attributes Reference The following attributes are exported: From 56d4233fdd3870247e97e7ed2443ae907cb8900f Mon Sep 17 00:00:00 2001 From: Konstantin Kosinsky Date: Tue, 24 Mar 2020 04:46:16 -0700 Subject: [PATCH 004/223] Make metastores optional --- .../resource_arm_hdinsight_hadoop_cluster.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go b/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go index d1c0802be35eb..fffecc2453478 100644 --- a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go +++ b/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go @@ -93,7 +93,7 @@ func resourceArmHDInsightHadoopCluster() *schema.Resource { "metastores": { Type: schema.TypeList, - Required: true, + Optional: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -200,10 +200,11 @@ func resourceArmHDInsightHadoopClusterCreate(d *schema.ResourceData, meta interf gatewayRaw := d.Get("gateway").([]interface{}) configurations := azure.ExpandHDInsightsConfigurations(gatewayRaw) - metastoresRaw := d.Get("metastores").([]interface{}) - metastores := expandHDInsightsMetastore(metastoresRaw) - for k, v := range metastores { - configurations[k] = v + if metastoresRaw, ok := d.GetOkExists("metastores"); ok { + metastores := expandHDInsightsMetastore(metastoresRaw.([]interface{})) + for k, v := range metastores { + configurations[k] = v + } } storageAccountsRaw := d.Get("storage_account").([]interface{}) From 2d6b93ffa88f7ae44b7777e756dbdcfb1ad1e6f4 Mon Sep 17 00:00:00 2001 From: Konstantin Kosinsky Date: Wed, 25 Mar 2020 16:52:34 -0700 Subject: [PATCH 005/223] Fix AzureRMHDInsightHadoopCluster_requiresImport --- azurerm/helpers/azure/hdinsight.go | 2 +- .../tests/resource_arm_hdinsight_hadoop_cluster_test.go | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/azurerm/helpers/azure/hdinsight.go b/azurerm/helpers/azure/hdinsight.go index aa4e4c567b491..53c0b1acfe94e 100644 --- a/azurerm/helpers/azure/hdinsight.go +++ b/azurerm/helpers/azure/hdinsight.go @@ -39,7 +39,7 @@ func SchemaHDInsightTier() *schema.Schema { ValidateFunc: validation.StringInSlice([]string{ string(hdinsight.Standard), string(hdinsight.Premium), - }, false), + }, true), // TODO: file a bug about this DiffSuppressFunc: SuppressLocationDiff, } diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go b/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go index 205b4259cc85c..65b153ba2a282 100644 --- a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go +++ b/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go @@ -456,7 +456,6 @@ resource "azurerm_hdinsight_hadoop_cluster" "import" { for_each = lookup(roles.value, "head_node", []) content { password = lookup(head_node.value, "password", null) - ssh_keys = lookup(head_node.value, "ssh_keys", null) subnet_id = lookup(head_node.value, "subnet_id", null) username = head_node.value.username virtual_network_id = lookup(head_node.value, "virtual_network_id", null) @@ -467,9 +466,7 @@ resource "azurerm_hdinsight_hadoop_cluster" "import" { dynamic "worker_node" { for_each = lookup(roles.value, "worker_node", []) content { - min_instance_count = lookup(worker_node.value, "min_instance_count", null) password = lookup(worker_node.value, "password", null) - ssh_keys = lookup(worker_node.value, "ssh_keys", null) subnet_id = lookup(worker_node.value, "subnet_id", null) target_instance_count = worker_node.value.target_instance_count username = worker_node.value.username @@ -482,7 +479,6 @@ resource "azurerm_hdinsight_hadoop_cluster" "import" { for_each = lookup(roles.value, "zookeeper_node", []) content { password = lookup(zookeeper_node.value, "password", null) - ssh_keys = lookup(zookeeper_node.value, "ssh_keys", null) subnet_id = lookup(zookeeper_node.value, "subnet_id", null) username = zookeeper_node.value.username virtual_network_id = lookup(zookeeper_node.value, "virtual_network_id", null) From 713ccd34ae74dcf323c1418f8fc1f4c390554162 Mon Sep 17 00:00:00 2001 From: Konstantin Kosinsky Date: Mon, 30 Mar 2020 07:22:18 -0700 Subject: [PATCH 006/223] Fix doc --- website/docs/r/hdinsight_hadoop_cluster.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/r/hdinsight_hadoop_cluster.html.markdown b/website/docs/r/hdinsight_hadoop_cluster.html.markdown index 9ebcd93d9e2c4..321dc78963d08 100644 --- a/website/docs/r/hdinsight_hadoop_cluster.html.markdown +++ b/website/docs/r/hdinsight_hadoop_cluster.html.markdown @@ -253,11 +253,11 @@ A `install_script_action` block supports the following: A `metastores` block supports the following: -* `hive` - (Required) A `hive` block as defined below. +* `hive` - (Optional) A `hive` block as defined below. -* `oozie` - (Required) A `oozie` block as defined below. +* `oozie` - (Optional) A `oozie` block as defined below. -* `ambari` - (Required) A `amabari` block as defined below. +* `ambari` - (Optional) A `amabari` block as defined below. --- From a16d4db7b9caae013eadb1c7361236432cfef590 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Thu, 23 Apr 2020 10:18:57 +0800 Subject: [PATCH 007/223] Fix update scenario for network interface --- .../network/resource_arm_network_interface.go | 17 ++-- .../resource_arm_network_interface_test.go | 85 +++++++++++++++++++ 2 files changed, 94 insertions(+), 8 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_network_interface.go b/azurerm/internal/services/network/resource_arm_network_interface.go index 2f841fe668219..111e745fcb699 100644 --- a/azurerm/internal/services/network/resource_arm_network_interface.go +++ b/azurerm/internal/services/network/resource_arm_network_interface.go @@ -313,30 +313,29 @@ func resourceArmNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) Location: utils.String(location), InterfacePropertiesFormat: &network.InterfacePropertiesFormat{ EnableAcceleratedNetworking: utils.Bool(d.Get("enable_accelerated_networking").(bool)), + DNSSettings: &network.InterfaceDNSSettings{}, }, } if d.HasChange("dns_servers") { - if update.InterfacePropertiesFormat.DNSSettings == nil { - update.InterfacePropertiesFormat.DNSSettings = &network.InterfaceDNSSettings{} - } - dnsServersRaw := d.Get("dns_servers").([]interface{}) dnsServers := expandNetworkInterfaceDnsServers(dnsServersRaw) update.InterfacePropertiesFormat.DNSSettings.DNSServers = &dnsServers + } else { + update.InterfacePropertiesFormat.DNSSettings.DNSServers = existing.InterfacePropertiesFormat.DNSSettings.DNSServers } if d.HasChange("enable_ip_forwarding") { update.InterfacePropertiesFormat.EnableIPForwarding = utils.Bool(d.Get("enable_ip_forwarding").(bool)) + } else { + update.InterfacePropertiesFormat.EnableIPForwarding = existing.InterfacePropertiesFormat.EnableIPForwarding } if d.HasChange("internal_dns_name_label") { - if update.InterfacePropertiesFormat.DNSSettings == nil { - update.InterfacePropertiesFormat.DNSSettings = &network.InterfaceDNSSettings{} - } - update.InterfacePropertiesFormat.DNSSettings.InternalDNSNameLabel = utils.String(d.Get("internal_dns_name_label").(string)) + } else { + update.InterfacePropertiesFormat.DNSSettings.InternalDNSNameLabel = existing.InterfacePropertiesFormat.DNSSettings.InternalDNSNameLabel } if d.HasChange("ip_configuration") { @@ -364,6 +363,8 @@ func resourceArmNetworkInterfaceUpdate(d *schema.ResourceData, meta interface{}) if d.HasChange("tags") { tagsRaw := d.Get("tags").(map[string]interface{}) update.Tags = tags.Expand(tagsRaw) + } else { + update.Tags = existing.Tags } // this can be managed in another resource, so just port it over diff --git a/azurerm/internal/services/network/tests/resource_arm_network_interface_test.go b/azurerm/internal/services/network/tests/resource_arm_network_interface_test.go index ca083a43dc299..43c7d3bc353f4 100644 --- a/azurerm/internal/services/network/tests/resource_arm_network_interface_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_network_interface_test.go @@ -351,6 +351,31 @@ func TestAccAzureRMNetworkInterface_update(t *testing.T) { }) } +func TestAccAzureRMNetworkInterface_updateMultipleParameters(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_network_interface", "test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMNetworkInterfaceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMNetworkInterface_withMultipleParameters(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMNetworkInterfaceExists(data.ResourceName), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMNetworkInterface_updateMultipleParameters(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMNetworkInterfaceExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + func testCheckAzureRMNetworkInterfaceExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { client := acceptance.AzureProvider.Meta().(*clients.Client).Network.InterfacesClient @@ -450,6 +475,66 @@ resource "azurerm_network_interface" "test" { `, template, data.RandomInteger) } +func testAccAzureRMNetworkInterface_withMultipleParameters(data acceptance.TestData) string { + template := testAccAzureRMNetworkInterface_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_network_interface" "test" { + name = "acctestni-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + enable_ip_forwarding = true + internal_dns_name_label = "acctestni-%s" + + dns_servers = [ + "10.0.0.5", + "10.0.0.6" + ] + + ip_configuration { + name = "primary" + subnet_id = azurerm_subnet.test.id + private_ip_address_allocation = "Dynamic" + } + + tags = { + env = "Test" + } +} +`, template, data.RandomInteger, data.RandomString) +} + +func testAccAzureRMNetworkInterface_updateMultipleParameters(data acceptance.TestData) string { + template := testAccAzureRMNetworkInterface_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_network_interface" "test" { + name = "acctestni-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + enable_ip_forwarding = true + internal_dns_name_label = "acctestni-%s" + + dns_servers = [ + "10.0.0.5", + "10.0.0.6" + ] + + ip_configuration { + name = "primary" + subnet_id = azurerm_subnet.test.id + private_ip_address_allocation = "Dynamic" + } + + tags = { + env = "Test2" + } +} +`, template, data.RandomInteger, data.RandomString) +} + func testAccAzureRMNetworkInterface_dnsServers(data acceptance.TestData) string { template := testAccAzureRMNetworkInterface_template(data) return fmt.Sprintf(` From 0076714b9f0713fb4ee2ece88716770d45ca496a Mon Sep 17 00:00:00 2001 From: kt Date: Tue, 21 Apr 2020 23:16:34 -0700 Subject: [PATCH 008/223] provider: update terrafmt checks with make terrafmt command (#6567) --- scripts/terrafmt-acctests.sh | 9 ++++++--- scripts/terrafmt-website.sh | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/scripts/terrafmt-acctests.sh b/scripts/terrafmt-acctests.sh index 9b340137b661c..089e9e60db53e 100755 --- a/scripts/terrafmt-acctests.sh +++ b/scripts/terrafmt-acctests.sh @@ -15,12 +15,15 @@ if ${error}; then echo "The preceding files contain terraform blocks that are not correctly formatted or contain errors." echo "You can fix this by running make tools and then terrafmt on them." echo "" - echo "format a single file:" - echo "$ terrafmt fmt -f ./azurerm/internal/services/service/tests/resource_test.go" + echo "to easily fix all terraform blocks:" + echo "$ make terrafmt" echo "" - echo "format all website files:" + echo "format only acceptance test config blocks:" echo "$ find azurerm | egrep \"_test.go\" | sort | while read f; do terrafmt fmt -f \$f; done" echo "" + echo "format a single test file:" + echo "$ terrafmt fmt -f ./azurerm/internal/services/service/tests/resource_test.go" + echo "" echo "on windows:" echo "$ Get-ChildItem -Path . -Recurse -Filter \"*_test.go\" | foreach {terrafmt fmt -f $_.fullName}" echo "" diff --git a/scripts/terrafmt-website.sh b/scripts/terrafmt-website.sh index 9738863b8d565..45b8efb1fb7bb 100755 --- a/scripts/terrafmt-website.sh +++ b/scripts/terrafmt-website.sh @@ -15,12 +15,15 @@ if ${error}; then echo "The preceding files contain terraform blocks that are not correctly formatted or contain errors." echo "You can fix this by running make tools and then terrafmt on them." echo "" - echo "format a single file:" - echo "$ terrafmt fmt ./website/path/to/file.html.markdown" + echo "to easily fix all terraform blocks:" + echo "$ make terrafmt" echo "" - echo "format all website files:" + echo "format only website config blocks:" echo "$ find . | egrep html.markdown | sort | while read f; do terrafmt fmt \$f; done" echo "" + echo "format a single website file:" + echo "$ terrafmt fmt ./website/path/to/file.html.markdown" + echo "" echo "on windows:" echo "$ Get-ChildItem -Path . -Recurse -Filter \"*html.markdown\" | foreach {terrafmt fmt $_.fullName}" echo "" From fbb8ed00c248701f416bc42fc2d541991da10744 Mon Sep 17 00:00:00 2001 From: kt Date: Wed, 22 Apr 2020 00:02:38 -0700 Subject: [PATCH 009/223] provider: pin golangci to 1.24 (#6577) --- GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 8d5b49de8a425..2e43f83dd3b7b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -14,11 +14,11 @@ default: build tools: @echo "==> installing required tooling..." @sh "$(CURDIR)/scripts/gogetcookie.sh" - GO111MODULE=off go get -u github.com/golangci/golangci-lint/cmd/golangci-lint GO111MODULE=off go get -u github.com/client9/misspell/cmd/misspell GO111MODULE=off go get -u github.com/bflad/tfproviderlint/cmd/tfproviderlint GO111MODULE=off go get -u github.com/bflad/tfproviderdocs GO111MODULE=off go get -u github.com/katbyte/terrafmt + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$GOPATH/bin v1.24.0 build: fmtcheck generate go install From 7a306d2e3915a5be489985021016934a90f71a00 Mon Sep 17 00:00:00 2001 From: Tracy P Holmes <12778804+tracypholmes@users.noreply.github.com> Date: Wed, 22 Apr 2020 02:26:46 -0500 Subject: [PATCH 010/223] provider tests: removes the requires import feature flag [L-W] (#6573) --- .../resource_arm_log_analytics_linked_service_test.go | 6 ------ .../tests/resource_arm_log_analytics_solution_test.go | 6 ------ .../resource_arm_log_analytics_workspace_test.go | 6 ------ .../resource_arm_logic_app_action_custom_test.go | 6 ------ .../tests/resource_arm_logic_app_action_http_test.go | 6 ------ .../resource_arm_logic_app_trigger_custom_test.go | 6 ------ ...esource_arm_logic_app_trigger_http_request_test.go | 6 ------ .../resource_arm_logic_app_trigger_recurrence_test.go | 6 ------ .../tests/resource_arm_logic_app_workflow_test.go | 6 ------ .../resource_arm_maintenance_configuration_test.go | 5 ----- .../managed_application_definition_resource_test.go | 6 ------ .../tests/resource_arm_mariadb_database_test.go | 6 ------ .../tests/resource_arm_mariadb_firewall_rule_test.go | 6 ------ .../mariadb/tests/resource_arm_mariadb_server_test.go | 6 ------ .../resource_arm_mariadb_virtual_network_rule_test.go | 6 ------ .../tests/resource_arm_monitor_action_group_test.go | 6 ------ .../resource_arm_monitor_activity_log_alert_test.go | 6 ------ .../resource_arm_monitor_autoscale_setting_test.go | 6 ------ .../resource_arm_monitor_diagnostic_setting_test.go | 6 ------ .../tests/resource_arm_monitor_log_profile_test.go | 6 ------ .../tests/resource_arm_monitor_metric_alert_test.go | 6 ------ .../tests/resource_arm_user_assigned_identity_test.go | 6 ------ .../mssql/tests/resource_arm_mssql_database_test.go | 6 ------ .../tests/resource_arm_mssql_elasticpool_test.go | 6 ------ .../tests/resource_arm_mssql_virtual_machine_test.go | 6 ------ .../mysql/tests/resource_arm_mysql_database_test.go | 6 ------ .../tests/resource_arm_mysql_firewall_rule_test.go | 6 ------ .../mysql/tests/resource_arm_mysql_server_test.go | 11 ----------- .../resource_arm_mysql_virtual_network_rule_test.go | 6 ------ .../netapp/tests/resource_arm_netapp_account_test.go | 6 ------ .../netapp/tests/resource_arm_netapp_pool_test.go | 6 ------ .../netapp/tests/resource_arm_netapp_snapshot_test.go | 6 ------ .../netapp/tests/resource_arm_netapp_volume_test.go | 6 ------ .../network/resource_arm_network_security_group.go | 2 +- ...cation_security_group_association_resource_test.go | 6 ------ ...etwork_security_group_association_resource_test.go | 6 ------ .../tests/resource_arm_application_gateway_test.go | 6 ------ .../resource_arm_application_security_group_test.go | 6 ------ .../network/tests/resource_arm_bastion_host_test.go | 6 ------ ...ce_arm_express_route_circuit_authorization_test.go | 6 ------ ...resource_arm_express_route_circuit_peering_test.go | 6 ------ .../tests/resource_arm_express_route_circuit_test.go | 6 ------ .../tests/resource_arm_express_route_gateway_test.go | 6 ------ ...e_arm_firewall_application_rule_collection_test.go | 6 ------ .../resource_arm_firewall_nat_rule_collection_test.go | 6 ------ ...ource_arm_firewall_network_rule_collection_test.go | 6 ------ .../network/tests/resource_arm_firewall_test.go | 6 ------ ...urce_arm_loadbalancer_backend_address_pool_test.go | 6 ------ .../tests/resource_arm_loadbalancer_nat_pool_test.go | 6 ------ .../tests/resource_arm_loadbalancer_nat_rule_test.go | 6 ------ .../resource_arm_loadbalancer_outbound_rule_test.go | 6 ------ .../tests/resource_arm_loadbalancer_probe_test.go | 6 ------ .../tests/resource_arm_loadbalancer_rule_test.go | 6 ------ .../network/tests/resource_arm_loadbalancer_test.go | 6 ------ .../tests/resource_arm_local_network_gateway_test.go | 6 ------ .../resource_arm_network_connection_monitor_test.go | 6 ------ .../resource_arm_network_ddos_protection_plan_test.go | 6 ------ ..._interface_application_gateway_association_test.go | 6 ------ ...interface_backend_address_pool_association_test.go | 6 ------ ...arm_network_interface_nat_rule_association_test.go | 6 ------ .../tests/resource_arm_network_interface_test.go | 6 ------ .../tests/resource_arm_network_packet_capture_test.go | 6 ------ .../tests/resource_arm_network_profile_test.go | 6 ------ .../tests/resource_arm_network_security_group_test.go | 6 ------ .../tests/resource_arm_network_security_rule_test.go | 6 ------ .../tests/resource_arm_network_watcher_test.go | 6 ------ .../network/tests/resource_arm_packet_capture_test.go | 6 ------ .../resource_arm_point_to_site_vpn_gateway_test.go | 6 ------ .../tests/resource_arm_private_link_service_test.go | 6 ------ .../network/tests/resource_arm_public_ip_test.go | 6 ------ .../network/tests/resource_arm_route_table_test.go | 6 ------ .../services/network/tests/resource_arm_route_test.go | 6 ------ ...esource_arm_subnet_nat_gateway_association_test.go | 6 ------ ..._subnet_network_security_group_association_test.go | 6 ------ ...esource_arm_subnet_route_table_association_test.go | 6 ------ .../network/tests/resource_arm_subnet_test.go | 6 ------ .../tests/resource_arm_virtual_hub_connection_test.go | 6 ------ .../network/tests/resource_arm_virtual_hub_test.go | 6 ------ ...rce_arm_virtual_network_gateway_connection_test.go | 6 ------ .../resource_arm_virtual_network_gateway_test.go | 6 ------ .../resource_arm_virtual_network_peering_test.go | 6 ------ .../tests/resource_arm_virtual_network_test.go | 6 ------ .../network/tests/resource_arm_virtual_wan_test.go | 5 ----- .../network/tests/resource_arm_vpn_gateway_test.go | 6 ------ .../resource_arm_vpn_server_configuration_test.go | 6 ------ ...ce_arm_notification_hub_authorization_rule_test.go | 6 ------ .../resource_arm_notification_hub_namespace_test.go | 6 ------ .../tests/resource_arm_notification_hub_test.go | 6 ------ .../tests/resource_arm_policy_assignment_test.go | 6 ------ .../tests/resource_arm_policy_definition_test.go | 6 ------ .../tests/resource_arm_policy_remediation_test.go | 6 ------ .../tests/resource_arm_postgresql_database_test.go | 6 ------ .../resource_arm_postgresql_firewall_rule_test.go | 6 ------ .../tests/resource_arm_postgresql_server_test.go | 1 + ...source_arm_postgresql_virtual_network_rule_test.go | 6 ------ .../tests/resource_arm_powerbi_embedded_test.go | 6 ------ .../tests/resource_arm_private_dns_a_record_test.go | 6 ------ .../resource_arm_private_dns_aaaa_record_test.go | 6 ------ .../resource_arm_private_dns_cname_record_test.go | 6 ------ .../tests/resource_arm_private_dns_mx_record_test.go | 6 ------ .../tests/resource_arm_private_dns_ptr_record_test.go | 6 ------ .../tests/resource_arm_private_dns_srv_record_test.go | 6 ------ .../tests/resource_arm_private_dns_txt_record_test.go | 6 ------ .../tests/resource_arm_private_dns_zone_test.go | 6 ------ ..._arm_private_dns_zone_virtual_network_link_test.go | 6 ------ .../resource_arm_backup_policy_file_share_test.go | 6 ------ .../tests/resource_arm_backup_policy_vm_test.go | 6 ------ .../resource_arm_backup_protected_file_share_test.go | 6 ------ .../tests/resource_arm_backup_protected_vm_test.go | 6 ------ .../resource_arm_recovery_services_vault_test.go | 6 ------ .../redis/tests/resource_arm_redis_cache_test.go | 6 ------ .../tests/resource_arm_redis_firewall_rule_test.go | 6 ------ .../resource_arm_relay_hybrid_connection_test.go | 6 ------ .../relay/tests/resource_arm_relay_namespace_test.go | 6 ------ .../tests/resource_arm_management_lock_test.go | 6 ------ .../tests/resource_arm_resource_group_test.go | 6 ------ .../tests/resource_arm_template_deployment_test.go | 6 ------ .../search/tests/resource_arm_search_service_test.go | 6 ------ .../resource_arm_advanced_threat_protection_test.go | 6 ------ .../resource_arm_security_center_contact_test.go | 6 ------ .../resource_arm_security_center_workspace_test.go | 6 ------ ...rm_servicebus_namespace_authorization_rule_test.go | 5 ----- .../tests/resource_arm_servicebus_namespace_test.go | 5 ----- ...ce_arm_servicebus_queue_authorization_rule_test.go | 5 ----- .../tests/resource_arm_servicebus_queue_test.go | 6 ------ .../resource_arm_servicebus_subscription_rule_test.go | 5 ----- .../resource_arm_servicebus_subscription_test.go | 5 ----- ...ce_arm_servicebus_topic_authorization_rule_test.go | 5 ----- .../tests/resource_arm_servicebus_topic_test.go | 5 ----- .../tests/resource_arm_service_fabric_cluster_test.go | 5 ----- .../tests/resource_arm_signalr_service_test.go | 5 ----- .../sql/tests/resource_arm_sql_administrator_test.go | 5 ----- .../sql/tests/resource_arm_sql_database_test.go | 5 ----- .../sql/tests/resource_arm_sql_elasticpool_test.go | 5 ----- .../sql/tests/resource_arm_sql_firewall_rule_test.go | 5 ----- .../sql/tests/resource_arm_sql_server_test.go | 5 ----- .../resource_arm_sql_virtual_network_rule_test.go | 5 ----- .../tests/resource_arm_hpc_cache_blob_target_test.go | 6 ------ .../storage/tests/resource_arm_hpc_cache_test.go | 6 ------ .../tests/resource_arm_storage_account_test.go | 5 ----- .../storage/tests/resource_arm_storage_blob_test.go | 5 ----- .../tests/resource_arm_storage_container_test.go | 5 ----- ...urce_arm_storage_data_lake_gen2_filesystem_test.go | 5 ----- .../storage/tests/resource_arm_storage_queue_test.go | 5 ----- .../resource_arm_storage_share_directory_test.go | 5 ----- .../storage/tests/resource_arm_storage_share_test.go | 5 ----- .../tests/resource_arm_storage_table_entity_test.go | 5 ----- .../storage/tests/resource_arm_storage_table_test.go | 5 ----- ...m_stream_analytics_function_javascript_udf_test.go | 6 ------ .../tests/resource_arm_stream_analytics_job_test.go | 6 ------ .../resource_arm_stream_analytics_output_blob_test.go | 6 ------ ...ource_arm_stream_analytics_output_eventhub_test.go | 6 ------ ...resource_arm_stream_analytics_output_mssql_test.go | 6 ------ ...m_stream_analytics_output_servicebus_queue_test.go | 6 ------ ...m_stream_analytics_output_servicebus_topic_test.go | 6 ------ ..._arm_stream_analytics_reference_input_blob_test.go | 6 ------ ...rce_arm_stream_analytics_stream_input_blob_test.go | 6 ------ ...arm_stream_analytics_stream_input_eventhub_test.go | 6 ------ ...e_arm_stream_analytics_stream_input_iothub_test.go | 6 ------ .../resource_arm_traffic_manager_endpoint_test.go | 6 ------ .../resource_arm_traffic_manager_profile_test.go | 6 ------ .../tests/app_service_environment_resource_test.go | 6 ------ ...resource_arm_app_service_certificate_order_test.go | 6 ------ ...ce_arm_app_service_custom_hostname_binding_test.go | 6 ------ .../web/tests/resource_arm_app_service_plan_test.go | 5 ----- .../web/tests/resource_arm_app_service_slot_test.go | 6 ------ .../web/tests/resource_arm_app_service_test.go | 6 ------ .../web/tests/resource_arm_function_app_test.go | 6 ------ 168 files changed, 2 insertions(+), 975 deletions(-) diff --git a/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_linked_service_test.go b/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_linked_service_test.go index 94f2a45745dc9..55add86dcd799 100644 --- a/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_linked_service_test.go +++ b/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_linked_service_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMLogAnalyticsLinkedService_basic(t *testing.T) { @@ -35,11 +34,6 @@ func TestAccAzureRMLogAnalyticsLinkedService_basic(t *testing.T) { } func TestAccAzureRMLogAnalyticsLinkedService_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_log_analytics_linked_service", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_solution_test.go b/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_solution_test.go index 3f97ddb70aabb..72864d6d23ebe 100644 --- a/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_solution_test.go +++ b/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_solution_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMLogAnalyticsSolution_basicContainerMonitoring(t *testing.T) { @@ -31,11 +30,6 @@ func TestAccAzureRMLogAnalyticsSolution_basicContainerMonitoring(t *testing.T) { } func TestAccAzureRMLogAnalyticsSolution_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_log_analytics_solution", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_workspace_test.go b/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_workspace_test.go index 28dd8a6080b73..1ae5bdf529747 100644 --- a/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_workspace_test.go +++ b/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_workspace_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loganalytics" ) @@ -75,11 +74,6 @@ func TestAccAzureRMLogAnalyticsWorkspace_basic(t *testing.T) { } func TestAccAzureRMLogAnalyticsWorkspace_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_log_analytics_workspace", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/logic/tests/resource_arm_logic_app_action_custom_test.go b/azurerm/internal/services/logic/tests/resource_arm_logic_app_action_custom_test.go index 9e3f8ac7590dc..7e4215dcd237b 100644 --- a/azurerm/internal/services/logic/tests/resource_arm_logic_app_action_custom_test.go +++ b/azurerm/internal/services/logic/tests/resource_arm_logic_app_action_custom_test.go @@ -6,7 +6,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMLogicAppActionCustom_basic(t *testing.T) { @@ -29,11 +28,6 @@ func TestAccAzureRMLogicAppActionCustom_basic(t *testing.T) { } func TestAccAzureRMLogicAppActionCustom_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_logic_app_action_custom", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/logic/tests/resource_arm_logic_app_action_http_test.go b/azurerm/internal/services/logic/tests/resource_arm_logic_app_action_http_test.go index 4527ac41794cb..f2e533b801125 100644 --- a/azurerm/internal/services/logic/tests/resource_arm_logic_app_action_http_test.go +++ b/azurerm/internal/services/logic/tests/resource_arm_logic_app_action_http_test.go @@ -6,7 +6,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMLogicAppActionHttp_basic(t *testing.T) { @@ -29,11 +28,6 @@ func TestAccAzureRMLogicAppActionHttp_basic(t *testing.T) { } func TestAccAzureRMLogicAppActionHttp_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_logic_app_action_http", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_custom_test.go b/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_custom_test.go index aa960af30cbfc..8597628cc6239 100644 --- a/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_custom_test.go +++ b/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_custom_test.go @@ -6,7 +6,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMLogicAppTriggerCustom_basic(t *testing.T) { @@ -29,11 +28,6 @@ func TestAccAzureRMLogicAppTriggerCustom_basic(t *testing.T) { } func TestAccAzureRMLogicAppTriggerCustom_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_logic_app_trigger_custom", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_http_request_test.go b/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_http_request_test.go index 219a59c4fc1eb..0f1e6d3ffb342 100644 --- a/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_http_request_test.go +++ b/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_http_request_test.go @@ -6,7 +6,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMLogicAppTriggerHttpRequest_basic(t *testing.T) { @@ -30,11 +29,6 @@ func TestAccAzureRMLogicAppTriggerHttpRequest_basic(t *testing.T) { } func TestAccAzureRMLogicAppTriggerHttpRequest_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_logic_app_trigger_http_request", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_recurrence_test.go b/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_recurrence_test.go index 39286240a3ac6..3e8a160dbbc25 100644 --- a/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_recurrence_test.go +++ b/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_recurrence_test.go @@ -6,7 +6,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMLogicAppTriggerRecurrence_month(t *testing.T) { @@ -31,11 +30,6 @@ func TestAccAzureRMLogicAppTriggerRecurrence_month(t *testing.T) { } func TestAccAzureRMLogicAppTriggerRecurrence_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_logic_app_trigger_recurrence", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/logic/tests/resource_arm_logic_app_workflow_test.go b/azurerm/internal/services/logic/tests/resource_arm_logic_app_workflow_test.go index a2cb53160d0c3..47aa45c0657db 100644 --- a/azurerm/internal/services/logic/tests/resource_arm_logic_app_workflow_test.go +++ b/azurerm/internal/services/logic/tests/resource_arm_logic_app_workflow_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMLogicAppWorkflow_empty(t *testing.T) { @@ -38,11 +37,6 @@ func TestAccAzureRMLogicAppWorkflow_empty(t *testing.T) { } func TestAccAzureRMLogicAppWorkflow_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_logic_app_workflow", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/maintenance/tests/resource_arm_maintenance_configuration_test.go b/azurerm/internal/services/maintenance/tests/resource_arm_maintenance_configuration_test.go index c326560621ce9..130d7489c7c50 100644 --- a/azurerm/internal/services/maintenance/tests/resource_arm_maintenance_configuration_test.go +++ b/azurerm/internal/services/maintenance/tests/resource_arm_maintenance_configuration_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/maintenance/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -35,10 +34,6 @@ func TestAccAzureRMMaintenanceConfiguration_basic(t *testing.T) { } func TestAccAzureRMMaintenanceConfiguration_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_maintenance_configuration", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/managedapplications/tests/managed_application_definition_resource_test.go b/azurerm/internal/services/managedapplications/tests/managed_application_definition_resource_test.go index f0773ef64a892..f102d06ccd12f 100644 --- a/azurerm/internal/services/managedapplications/tests/managed_application_definition_resource_test.go +++ b/azurerm/internal/services/managedapplications/tests/managed_application_definition_resource_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/managedapplications/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,11 +32,6 @@ func TestAccAzureRMManagedApplicationDefinition_basic(t *testing.T) { } func TestAccAzureRMManagedApplicationDefinition_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_managed_application_definition", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_database_test.go b/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_database_test.go index 0ff784f5b350c..743c9f7d23a9a 100644 --- a/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_database_test.go +++ b/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_database_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -34,11 +33,6 @@ func TestAccAzureRMMariaDbDatabase_basic(t *testing.T) { } func TestAccAzureRMMariaDbDatabase_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_mariadb_database", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_firewall_rule_test.go b/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_firewall_rule_test.go index 17d6875de081d..19b0baaf93ae8 100644 --- a/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_firewall_rule_test.go +++ b/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_firewall_rule_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMMariaDBFirewallRule_basic(t *testing.T) { } func TestAccAzureRMMariaDBFirewallRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_mariadb_firewall_rule", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_server_test.go b/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_server_test.go index 7ec387b2022ea..9dfe8fc610437 100644 --- a/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_server_test.go +++ b/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_server_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -35,11 +34,6 @@ func TestAccAzureRMMariaDbServer_basic(t *testing.T) { } func TestAccAzureRMMariaDbServer_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_mariadb_server", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_virtual_network_rule_test.go b/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_virtual_network_rule_test.go index a84a79dbf277c..220e66361f78e 100644 --- a/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_virtual_network_rule_test.go +++ b/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_virtual_network_rule_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,11 +32,6 @@ func TestAccAzureRMMariaDBVirtualNetworkRule_basic(t *testing.T) { } func TestAccAzureRMMariaDBVirtualNetworkRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_mariadb_virtual_network_rule", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_action_group_test.go b/azurerm/internal/services/monitor/tests/resource_arm_monitor_action_group_test.go index 35fef307a9adf..60db96d6b8b68 100644 --- a/azurerm/internal/services/monitor/tests/resource_arm_monitor_action_group_test.go +++ b/azurerm/internal/services/monitor/tests/resource_arm_monitor_action_group_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMMonitorActionGroup_basic(t *testing.T) { @@ -32,11 +31,6 @@ func TestAccAzureRMMonitorActionGroup_basic(t *testing.T) { } func TestAccAzureRMMonitorActionGroup_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_monitor_action_group", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_activity_log_alert_test.go b/azurerm/internal/services/monitor/tests/resource_arm_monitor_activity_log_alert_test.go index d24be72a43dc4..8ffcad3761064 100644 --- a/azurerm/internal/services/monitor/tests/resource_arm_monitor_activity_log_alert_test.go +++ b/azurerm/internal/services/monitor/tests/resource_arm_monitor_activity_log_alert_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMMonitorActivityLogAlert_basic(t *testing.T) { @@ -37,11 +36,6 @@ func TestAccAzureRMMonitorActivityLogAlert_basic(t *testing.T) { } func TestAccAzureRMMonitorActivityLogAlert_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_monitor_activity_log_alert", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_autoscale_setting_test.go b/azurerm/internal/services/monitor/tests/resource_arm_monitor_autoscale_setting_test.go index 8606ce6649667..8f5cc7af8cf20 100644 --- a/azurerm/internal/services/monitor/tests/resource_arm_monitor_autoscale_setting_test.go +++ b/azurerm/internal/services/monitor/tests/resource_arm_monitor_autoscale_setting_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMMonitorAutoScaleSetting_basic(t *testing.T) { @@ -38,11 +37,6 @@ func TestAccAzureRMMonitorAutoScaleSetting_basic(t *testing.T) { } func TestAccAzureRMMonitorAutoScaleSetting_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_monitor_autoscale_setting", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_diagnostic_setting_test.go b/azurerm/internal/services/monitor/tests/resource_arm_monitor_diagnostic_setting_test.go index 0c19456e592d3..cd3b5e9b8b493 100644 --- a/azurerm/internal/services/monitor/tests/resource_arm_monitor_diagnostic_setting_test.go +++ b/azurerm/internal/services/monitor/tests/resource_arm_monitor_diagnostic_setting_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -39,11 +38,6 @@ func TestAccAzureRMMonitorDiagnosticSetting_eventhub(t *testing.T) { } func TestAccAzureRMMonitorDiagnosticSetting_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_monitor_diagnostic_setting", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_log_profile_test.go b/azurerm/internal/services/monitor/tests/resource_arm_monitor_log_profile_test.go index 0d57bcc4d040c..707fc1f3f8a6e 100644 --- a/azurerm/internal/services/monitor/tests/resource_arm_monitor_log_profile_test.go +++ b/azurerm/internal/services/monitor/tests/resource_arm_monitor_log_profile_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -67,11 +66,6 @@ func testAccAzureRMMonitorLogProfile_basic(t *testing.T) { } func testAccAzureRMMonitorLogProfile_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_monitor_log_profile", "test") resource.Test(t, resource.TestCase{ diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_metric_alert_test.go b/azurerm/internal/services/monitor/tests/resource_arm_monitor_metric_alert_test.go index 902081331ac11..8200d8e4198c0 100644 --- a/azurerm/internal/services/monitor/tests/resource_arm_monitor_metric_alert_test.go +++ b/azurerm/internal/services/monitor/tests/resource_arm_monitor_metric_alert_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMMonitorMetricAlert_basic(t *testing.T) { @@ -41,11 +40,6 @@ func TestAccAzureRMMonitorMetricAlert_basic(t *testing.T) { } func TestAccAzureRMMonitorMetricAlert_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_monitor_metric_alert", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/msi/tests/resource_arm_user_assigned_identity_test.go b/azurerm/internal/services/msi/tests/resource_arm_user_assigned_identity_test.go index 2effea3183df6..6fd5ec5557702 100644 --- a/azurerm/internal/services/msi/tests/resource_arm_user_assigned_identity_test.go +++ b/azurerm/internal/services/msi/tests/resource_arm_user_assigned_identity_test.go @@ -11,7 +11,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMUserAssignedIdentity_basic(t *testing.T) { @@ -35,11 +34,6 @@ func TestAccAzureRMUserAssignedIdentity_basic(t *testing.T) { }) } func TestAccAzureRMUserAssignedIdentity_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_user_assigned_identity", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/mssql/tests/resource_arm_mssql_database_test.go b/azurerm/internal/services/mssql/tests/resource_arm_mssql_database_test.go index c714384e51657..f6b28b315cb7b 100644 --- a/azurerm/internal/services/mssql/tests/resource_arm_mssql_database_test.go +++ b/azurerm/internal/services/mssql/tests/resource_arm_mssql_database_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/mssql/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -34,11 +33,6 @@ func TestAccAzureRMMsSqlDatabase_basic(t *testing.T) { } func TestAccAzureRMMsSqlDatabase_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_mssql_database", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/mssql/tests/resource_arm_mssql_elasticpool_test.go b/azurerm/internal/services/mssql/tests/resource_arm_mssql_elasticpool_test.go index d968a6c29281e..a88679140b85c 100644 --- a/azurerm/internal/services/mssql/tests/resource_arm_mssql_elasticpool_test.go +++ b/azurerm/internal/services/mssql/tests/resource_arm_mssql_elasticpool_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) // TODO: add import tests @@ -38,11 +37,6 @@ func TestAccAzureRMMsSqlElasticPool_basic_DTU(t *testing.T) { } func TestAccAzureRMMsSqlElasticPool_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_mssql_elasticpool", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/mssql/tests/resource_arm_mssql_virtual_machine_test.go b/azurerm/internal/services/mssql/tests/resource_arm_mssql_virtual_machine_test.go index 8f743b83c2126..4fd0cbedd06d0 100644 --- a/azurerm/internal/services/mssql/tests/resource_arm_mssql_virtual_machine_test.go +++ b/azurerm/internal/services/mssql/tests/resource_arm_mssql_virtual_machine_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/mssql/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -35,11 +34,6 @@ func TestAccAzureRMMsSqlVirtualMachine_basic(t *testing.T) { } func TestAccAzureRMMsSqlVirtualMachine_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_mssql_virtual_machine", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/mysql/tests/resource_arm_mysql_database_test.go b/azurerm/internal/services/mysql/tests/resource_arm_mysql_database_test.go index f22f24f03cb4b..e06064f352840 100644 --- a/azurerm/internal/services/mysql/tests/resource_arm_mysql_database_test.go +++ b/azurerm/internal/services/mysql/tests/resource_arm_mysql_database_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMMySQLDatabase_basic(t *testing.T) { } func TestAccAzureRMMySQLDatabase_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_mysql_database", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/mysql/tests/resource_arm_mysql_firewall_rule_test.go b/azurerm/internal/services/mysql/tests/resource_arm_mysql_firewall_rule_test.go index 1e419570634c8..cdf861629b128 100644 --- a/azurerm/internal/services/mysql/tests/resource_arm_mysql_firewall_rule_test.go +++ b/azurerm/internal/services/mysql/tests/resource_arm_mysql_firewall_rule_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMMySQLFirewallRule_basic(t *testing.T) { } func TestAccAzureRMMySQLFirewallRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_mysql_firewall_rule", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/mysql/tests/resource_arm_mysql_server_test.go b/azurerm/internal/services/mysql/tests/resource_arm_mysql_server_test.go index d2f84e500487f..be8f219b89e45 100644 --- a/azurerm/internal/services/mysql/tests/resource_arm_mysql_server_test.go +++ b/azurerm/internal/services/mysql/tests/resource_arm_mysql_server_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMMySQLServer_basicFiveSix(t *testing.T) { } func TestAccAzureRMMySQLServer_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_mysql_server", "test") resource.ParallelTest(t, resource.TestCase{ @@ -59,11 +53,6 @@ func TestAccAzureRMMySQLServer_requiresImport(t *testing.T) { } func TestAccAzureRMMySQLServer_basicFiveSeven(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_mysql_server", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/mysql/tests/resource_arm_mysql_virtual_network_rule_test.go b/azurerm/internal/services/mysql/tests/resource_arm_mysql_virtual_network_rule_test.go index 20c05f9e578c3..67824d6c074db 100644 --- a/azurerm/internal/services/mysql/tests/resource_arm_mysql_virtual_network_rule_test.go +++ b/azurerm/internal/services/mysql/tests/resource_arm_mysql_virtual_network_rule_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -52,11 +51,6 @@ func TestAccAzureRMMySqlVirtualNetworkRule_badsubnet(t *testing.T) { } func TestAccAzureRMMySqlVirtualNetworkRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_mysql_virtual_network_rule", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/netapp/tests/resource_arm_netapp_account_test.go b/azurerm/internal/services/netapp/tests/resource_arm_netapp_account_test.go index 4707d89700281..c1aa2798a20a0 100644 --- a/azurerm/internal/services/netapp/tests/resource_arm_netapp_account_test.go +++ b/azurerm/internal/services/netapp/tests/resource_arm_netapp_account_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -59,11 +58,6 @@ func testAccAzureRMNetAppAccount_basic(t *testing.T) { } func testAccAzureRMNetAppAccount_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_netapp_account", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/netapp/tests/resource_arm_netapp_pool_test.go b/azurerm/internal/services/netapp/tests/resource_arm_netapp_pool_test.go index ee8497556d50c..43172f8407563 100644 --- a/azurerm/internal/services/netapp/tests/resource_arm_netapp_pool_test.go +++ b/azurerm/internal/services/netapp/tests/resource_arm_netapp_pool_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMNetAppPool_basic(t *testing.T) { } func TestAccAzureRMNetAppPool_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_netapp_pool", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/netapp/tests/resource_arm_netapp_snapshot_test.go b/azurerm/internal/services/netapp/tests/resource_arm_netapp_snapshot_test.go index 50e1fc277d3f2..ea620e3a5e3f5 100644 --- a/azurerm/internal/services/netapp/tests/resource_arm_netapp_snapshot_test.go +++ b/azurerm/internal/services/netapp/tests/resource_arm_netapp_snapshot_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMNetAppSnapshot_basic(t *testing.T) { } func TestAccAzureRMNetAppSnapshot_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_netapp_snapshot", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/netapp/tests/resource_arm_netapp_volume_test.go b/azurerm/internal/services/netapp/tests/resource_arm_netapp_volume_test.go index ec54c6d4243e2..3d25e74f7e90f 100644 --- a/azurerm/internal/services/netapp/tests/resource_arm_netapp_volume_test.go +++ b/azurerm/internal/services/netapp/tests/resource_arm_netapp_volume_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -54,11 +53,6 @@ func TestAccAzureRMNetAppVolume_nfsv41(t *testing.T) { } func TestAccAzureRMNetAppVolume_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_netapp_volume", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/resource_arm_network_security_group.go b/azurerm/internal/services/network/resource_arm_network_security_group.go index b444ce2037fc2..379df4edf9fa2 100644 --- a/azurerm/internal/services/network/resource_arm_network_security_group.go +++ b/azurerm/internal/services/network/resource_arm_network_security_group.go @@ -5,7 +5,7 @@ import ( "time" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-09-01/network" - "github.com/hashicorp/go-multierror" + multierror "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" diff --git a/azurerm/internal/services/network/tests/network_interface_application_security_group_association_resource_test.go b/azurerm/internal/services/network/tests/network_interface_application_security_group_association_resource_test.go index 83743b4ef32d5..a9cf8402d792d 100644 --- a/azurerm/internal/services/network/tests/network_interface_application_security_group_association_resource_test.go +++ b/azurerm/internal/services/network/tests/network_interface_application_security_group_association_resource_test.go @@ -10,7 +10,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMNetworkInterfaceApplicationSecurityGroupAssociation_basic(t *testing.T) { @@ -52,11 +51,6 @@ func TestAccAzureRMNetworkInterfaceApplicationSecurityGroupAssociation_multipleI } func TestAccAzureRMNetworkInterfaceApplicationSecurityGroupAssociation_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_network_interface_application_security_group_association", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/network/tests/network_interface_network_security_group_association_resource_test.go b/azurerm/internal/services/network/tests/network_interface_network_security_group_association_resource_test.go index 464b9356fafd6..4ca46df743d4d 100644 --- a/azurerm/internal/services/network/tests/network_interface_network_security_group_association_resource_test.go +++ b/azurerm/internal/services/network/tests/network_interface_network_security_group_association_resource_test.go @@ -10,7 +10,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/azuresdkhacks" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMNetworkInterfaceSecurityGroupAssociation_basic(t *testing.T) { @@ -33,11 +32,6 @@ func TestAccAzureRMNetworkInterfaceSecurityGroupAssociation_basic(t *testing.T) } func TestAccAzureRMNetworkInterfaceSecurityGroupAssociation_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_network_interface_security_group_association", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/network/tests/resource_arm_application_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_application_gateway_test.go index 6214bb86039b6..5db72587bdb48 100644 --- a/azurerm/internal/services/network/tests/resource_arm_application_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_application_gateway_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -159,11 +158,6 @@ func TestAccAzureRMApplicationGateway_http2(t *testing.T) { } func TestAccAzureRMApplicationGateway_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_application_gateway", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_application_security_group_test.go b/azurerm/internal/services/network/tests/resource_arm_application_security_group_test.go index 094911c7c36a3..b967911648b27 100644 --- a/azurerm/internal/services/network/tests/resource_arm_application_security_group_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_application_security_group_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMApplicationSecurityGroup_basic(t *testing.T) { } func TestAccAzureRMApplicationSecurityGroup_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_application_security_group", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_bastion_host_test.go b/azurerm/internal/services/network/tests/resource_arm_bastion_host_test.go index a3cc414c6962c..9508ac1e3461d 100644 --- a/azurerm/internal/services/network/tests/resource_arm_bastion_host_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_bastion_host_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -52,11 +51,6 @@ func TestAccAzureRMBastionHost_complete(t *testing.T) { } func TestAccAzureRMBastionHost_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_bastion_host", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_authorization_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_authorization_test.go index ddad0d26b7102..e977f57616cd1 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_authorization_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_authorization_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -34,11 +33,6 @@ func testAccAzureRMExpressRouteCircuitAuthorization_basic(t *testing.T) { } func testAccAzureRMExpressRouteCircuitAuthorization_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_express_route_circuit_authorization", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go index c6f5f3b6e088d..e307889e05f42 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -35,11 +34,6 @@ func testAccAzureRMExpressRouteCircuitPeering_azurePrivatePeering(t *testing.T) } func testAccAzureRMExpressRouteCircuitPeering_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_express_route_circuit_peering", "test") resource.Test(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go index 700dc98f6a5a1..33d9c707fa271 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -78,11 +77,6 @@ func testAccAzureRMExpressRouteCircuit_basicMetered(t *testing.T) { } func testAccAzureRMExpressRouteCircuit_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_express_route_circuit", "test") var erc network.ExpressRouteCircuit diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go index 32388509d215a..40466b29cee2b 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMExpressRouteGateway_basic(t *testing.T) { } func TestAccAzureRMExpressRouteGateway_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_express_route_gateway", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_firewall_application_rule_collection_test.go b/azurerm/internal/services/network/tests/resource_arm_firewall_application_rule_collection_test.go index d2371d67996c9..8e285978f2eeb 100644 --- a/azurerm/internal/services/network/tests/resource_arm_firewall_application_rule_collection_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_firewall_application_rule_collection_test.go @@ -6,7 +6,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2019-09-01/network" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" @@ -43,11 +42,6 @@ func TestAccAzureRMFirewallApplicationRuleCollection_basic(t *testing.T) { } func TestAccAzureRMFirewallApplicationRuleCollection_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_firewall_application_rule_collection", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_firewall_nat_rule_collection_test.go b/azurerm/internal/services/network/tests/resource_arm_firewall_nat_rule_collection_test.go index e248e73cd343d..4ca0c7747b8d2 100644 --- a/azurerm/internal/services/network/tests/resource_arm_firewall_nat_rule_collection_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_firewall_nat_rule_collection_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMFirewallNatRuleCollection_basic(t *testing.T) { @@ -32,11 +31,6 @@ func TestAccAzureRMFirewallNatRuleCollection_basic(t *testing.T) { } func TestAccAzureRMFirewallNatRuleCollection_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_firewall_nat_rule_collection", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_firewall_network_rule_collection_test.go b/azurerm/internal/services/network/tests/resource_arm_firewall_network_rule_collection_test.go index bbf799dab135c..5612b260981da 100644 --- a/azurerm/internal/services/network/tests/resource_arm_firewall_network_rule_collection_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_firewall_network_rule_collection_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMFirewallNetworkRuleCollection_basic(t *testing.T) { @@ -36,11 +35,6 @@ func TestAccAzureRMFirewallNetworkRuleCollection_basic(t *testing.T) { } func TestAccAzureRMFirewallNetworkRuleCollection_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_firewall_network_rule_collection", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_firewall_test.go b/azurerm/internal/services/network/tests/resource_arm_firewall_test.go index 3e4b5cbd51841..7c0ed37b90f62 100644 --- a/azurerm/internal/services/network/tests/resource_arm_firewall_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_firewall_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -95,11 +94,6 @@ func TestAccAzureRMFirewall_withMultiplePublicIPs(t *testing.T) { } func TestAccAzureRMFirewall_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_firewall", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_backend_address_pool_test.go b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_backend_address_pool_test.go index 4e7d0da09b52f..7ffa2d8139095 100644 --- a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_backend_address_pool_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_backend_address_pool_test.go @@ -11,7 +11,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" nw "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network" ) @@ -49,11 +48,6 @@ func TestAccAzureRMLoadBalancerBackEndAddressPool_basic(t *testing.T) { }) } func TestAccAzureRMLoadBalancerBackEndAddressPool_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_lb_backend_address_pool", "test") var lb network.LoadBalancer diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_nat_pool_test.go b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_nat_pool_test.go index a46e74c659474..883d647235590 100644 --- a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_nat_pool_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_nat_pool_test.go @@ -11,7 +11,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" nw "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network" ) @@ -50,11 +49,6 @@ func TestAccAzureRMLoadBalancerNatPool_basic(t *testing.T) { } func TestAccAzureRMLoadBalancerNatPool_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_lb_nat_pool", "test") var lb network.LoadBalancer diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_nat_rule_test.go b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_nat_rule_test.go index d94d22f7b8f8a..831cc8fdd1e77 100644 --- a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_nat_rule_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_nat_rule_test.go @@ -11,7 +11,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" nw "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network" ) @@ -122,11 +121,6 @@ func TestAccAzureRMLoadBalancerNatRule_update(t *testing.T) { } func TestAccAzureRMLoadBalancerNatRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_lb_nat_rule", "test") var lb network.LoadBalancer diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_outbound_rule_test.go b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_outbound_rule_test.go index c7fe563ff46de..61b49e97200cd 100644 --- a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_outbound_rule_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_outbound_rule_test.go @@ -11,7 +11,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" nw "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network" ) @@ -52,11 +51,6 @@ func TestAccAzureRMLoadBalancerOutboundRule_basic(t *testing.T) { } func TestAccAzureRMLoadBalancerOutboundRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_lb_nat_rule", "test") var lb network.LoadBalancer diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_probe_test.go b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_probe_test.go index 083a7e869fff0..dc07cc555c886 100644 --- a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_probe_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_probe_test.go @@ -11,7 +11,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" nw "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network" ) @@ -46,11 +45,6 @@ func TestAccAzureRMLoadBalancerProbe_basic(t *testing.T) { } func TestAccAzureRMLoadBalancerProbe_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_lb_probe", "test") var lb network.LoadBalancer diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_rule_test.go b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_rule_test.go index 31de2bf302efc..6d9a9eddc592c 100644 --- a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_rule_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_rule_test.go @@ -12,7 +12,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" nw "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network" ) @@ -180,11 +179,6 @@ func TestAccAzureRMLoadBalancerRule_update(t *testing.T) { } func TestAccAzureRMLoadBalancerRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_lb", "test") var lb network.LoadBalancer diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_test.go b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_test.go index 5742b634d7ead..b8787f870502b 100644 --- a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_loadbalancer_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMLoadBalancer_basic(t *testing.T) { @@ -38,11 +37,6 @@ func TestAccAzureRMLoadBalancer_basic(t *testing.T) { } func TestAccAzureRMLoadBalancer_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_lb", "test") var lb network.LoadBalancer diff --git a/azurerm/internal/services/network/tests/resource_arm_local_network_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_local_network_gateway_test.go index 1798bf6600421..0c66b22f5c929 100644 --- a/azurerm/internal/services/network/tests/resource_arm_local_network_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_local_network_gateway_test.go @@ -10,7 +10,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -36,11 +35,6 @@ func TestAccAzureRMLocalNetworkGateway_basic(t *testing.T) { } func TestAccAzureRMLocalNetworkGateway_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_local_network_gateway", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_network_connection_monitor_test.go b/azurerm/internal/services/network/tests/resource_arm_network_connection_monitor_test.go index dc58451c23914..0da2b740393d9 100644 --- a/azurerm/internal/services/network/tests/resource_arm_network_connection_monitor_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_network_connection_monitor_test.go @@ -11,7 +11,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func testAccAzureRMNetworkConnectionMonitor_addressBasic(t *testing.T) { @@ -38,11 +37,6 @@ func testAccAzureRMNetworkConnectionMonitor_addressBasic(t *testing.T) { } func testAccAzureRMNetworkConnectionMonitor_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_network_connection_monitor", "test") resource.Test(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_network_ddos_protection_plan_test.go b/azurerm/internal/services/network/tests/resource_arm_network_ddos_protection_plan_test.go index 39e15faee6e6b..62bdb53359a63 100644 --- a/azurerm/internal/services/network/tests/resource_arm_network_ddos_protection_plan_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_network_ddos_protection_plan_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -59,11 +58,6 @@ func testAccAzureRMNetworkDDoSProtectionPlan_basic(t *testing.T) { } func testAccAzureRMNetworkDDoSProtectionPlan_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_network_ddos_protection_plan", "test") resource.Test(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_network_interface_application_gateway_association_test.go b/azurerm/internal/services/network/tests/resource_arm_network_interface_application_gateway_association_test.go index 152914c722c7f..5d0efb8bc056c 100644 --- a/azurerm/internal/services/network/tests/resource_arm_network_interface_application_gateway_association_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_network_interface_application_gateway_association_test.go @@ -10,7 +10,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMNetworkInterfaceApplicationGatewayBackendAddressPoolAssociation_basic(t *testing.T) { @@ -33,11 +32,6 @@ func TestAccAzureRMNetworkInterfaceApplicationGatewayBackendAddressPoolAssociati } func TestAccAzureRMNetworkInterfaceApplicationGatewayBackendAddressPoolAssociation_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_network_interface_application_gateway_backend_address_pool_association", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/network/tests/resource_arm_network_interface_backend_address_pool_association_test.go b/azurerm/internal/services/network/tests/resource_arm_network_interface_backend_address_pool_association_test.go index 1c5b2058c5808..8bae2af9aa387 100644 --- a/azurerm/internal/services/network/tests/resource_arm_network_interface_backend_address_pool_association_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_network_interface_backend_address_pool_association_test.go @@ -10,7 +10,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMNetworkInterfaceBackendAddressPoolAssociation_basic(t *testing.T) { @@ -33,11 +32,6 @@ func TestAccAzureRMNetworkInterfaceBackendAddressPoolAssociation_basic(t *testin } func TestAccAzureRMNetworkInterfaceBackendAddressPoolAssociation_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_network_interface_backend_address_pool_association", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/network/tests/resource_arm_network_interface_nat_rule_association_test.go b/azurerm/internal/services/network/tests/resource_arm_network_interface_nat_rule_association_test.go index f1f9edaa4e74b..d24b481185bd5 100644 --- a/azurerm/internal/services/network/tests/resource_arm_network_interface_nat_rule_association_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_network_interface_nat_rule_association_test.go @@ -10,7 +10,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMNetworkInterfaceNATRuleAssociation_basic(t *testing.T) { @@ -33,11 +32,6 @@ func TestAccAzureRMNetworkInterfaceNATRuleAssociation_basic(t *testing.T) { } func TestAccAzureRMNetworkInterfaceNATRuleAssociation_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_network_interface_nat_rule_association", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/network/tests/resource_arm_network_interface_test.go b/azurerm/internal/services/network/tests/resource_arm_network_interface_test.go index 43c7d3bc353f4..148a8cd82a0eb 100644 --- a/azurerm/internal/services/network/tests/resource_arm_network_interface_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_network_interface_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -258,11 +257,6 @@ func TestAccAzureRMNetworkInterface_publicIP(t *testing.T) { } func TestAccAzureRMNetworkInterface_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_network_interface", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/network/tests/resource_arm_network_packet_capture_test.go b/azurerm/internal/services/network/tests/resource_arm_network_packet_capture_test.go index 8182252c28054..9a7b004467ef6 100644 --- a/azurerm/internal/services/network/tests/resource_arm_network_packet_capture_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_network_packet_capture_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func testAccAzureRMNetworkPacketCapture_localDisk(t *testing.T) { @@ -32,11 +31,6 @@ func testAccAzureRMNetworkPacketCapture_localDisk(t *testing.T) { } func testAccAzureRMNetworkPacketCapture_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_network_packet_capture", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_network_profile_test.go b/azurerm/internal/services/network/tests/resource_arm_network_profile_test.go index be3e006446a2f..f158235342879 100644 --- a/azurerm/internal/services/network/tests/resource_arm_network_profile_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_network_profile_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,11 +32,6 @@ func TestAccAzureRMNetworkProfile_basic(t *testing.T) { } func TestAccAzureRMNetworkProfile_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_network_profile", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_network_security_group_test.go b/azurerm/internal/services/network/tests/resource_arm_network_security_group_test.go index 3f0674aec5782..795fc4bf43742 100644 --- a/azurerm/internal/services/network/tests/resource_arm_network_security_group_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_network_security_group_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMNetworkSecurityGroup_basic(t *testing.T) { } func TestAccAzureRMNetworkSecurityGroup_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_network_security_group", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/network/tests/resource_arm_network_security_rule_test.go b/azurerm/internal/services/network/tests/resource_arm_network_security_rule_test.go index f4ccae96b4d85..436e1901beedd 100644 --- a/azurerm/internal/services/network/tests/resource_arm_network_security_rule_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_network_security_rule_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,11 +32,6 @@ func TestAccAzureRMNetworkSecurityRule_basic(t *testing.T) { } func TestAccAzureRMNetworkSecurityRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_network_security_rule", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_network_watcher_test.go b/azurerm/internal/services/network/tests/resource_arm_network_watcher_test.go index 4d88fd28255d9..d54bc015c3810 100644 --- a/azurerm/internal/services/network/tests/resource_arm_network_watcher_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_network_watcher_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -98,11 +97,6 @@ func testAccAzureRMNetworkWatcher_basic(t *testing.T) { } func testAccAzureRMNetworkWatcher_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_network_watcher", "test") resource.Test(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/network/tests/resource_arm_packet_capture_test.go b/azurerm/internal/services/network/tests/resource_arm_packet_capture_test.go index a93af216af203..a3bd0fad68792 100644 --- a/azurerm/internal/services/network/tests/resource_arm_packet_capture_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_packet_capture_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func testAccAzureRMPacketCapture_localDisk(t *testing.T) { @@ -32,11 +31,6 @@ func testAccAzureRMPacketCapture_localDisk(t *testing.T) { } func testAccAzureRMPacketCapture_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_packet_capture", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_point_to_site_vpn_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_point_to_site_vpn_gateway_test.go index b5d779365de7f..09702bf3494ec 100644 --- a/azurerm/internal/services/network/tests/resource_arm_point_to_site_vpn_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_point_to_site_vpn_gateway_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMPointToSiteVPNGateway_basic(t *testing.T) { } func TestAccAzureRMPointToSiteVPNGateway_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_point_to_site_vpn_gateway", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_private_link_service_test.go b/azurerm/internal/services/network/tests/resource_arm_private_link_service_test.go index dda198ea10da3..25b671e623fcd 100644 --- a/azurerm/internal/services/network/tests/resource_arm_private_link_service_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_private_link_service_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -35,11 +34,6 @@ func TestAccAzureRMPrivateLinkService_basic(t *testing.T) { } func TestAccAzureRMPrivateLinkService_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_private_link_service", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_public_ip_test.go b/azurerm/internal/services/network/tests/resource_arm_public_ip_test.go index b7a726a88f131..8a3f627a91b1d 100644 --- a/azurerm/internal/services/network/tests/resource_arm_public_ip_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_public_ip_test.go @@ -11,7 +11,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMPublicIpStatic_basic(t *testing.T) { @@ -37,11 +36,6 @@ func TestAccAzureRMPublicIpStatic_basic(t *testing.T) { } func TestAccAzureRMPublicIpStatic_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_public_ip", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_route_table_test.go b/azurerm/internal/services/network/tests/resource_arm_route_table_test.go index 05f29aef80625..c8274a5181bc1 100644 --- a/azurerm/internal/services/network/tests/resource_arm_route_table_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_route_table_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -35,11 +34,6 @@ func TestAccAzureRMRouteTable_basic(t *testing.T) { } func TestAccAzureRMRouteTable_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_route_table", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_route_test.go b/azurerm/internal/services/network/tests/resource_arm_route_test.go index a560ad376c2d9..0fe581309c08d 100644 --- a/azurerm/internal/services/network/tests/resource_arm_route_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_route_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,11 +32,6 @@ func TestAccAzureRMRoute_basic(t *testing.T) { } func TestAccAzureRMRoute_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_route", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_subnet_nat_gateway_association_test.go b/azurerm/internal/services/network/tests/resource_arm_subnet_nat_gateway_association_test.go index 107fa815a441e..ed299daaad852 100644 --- a/azurerm/internal/services/network/tests/resource_arm_subnet_nat_gateway_association_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_subnet_nat_gateway_association_test.go @@ -9,7 +9,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -34,11 +33,6 @@ func TestAccAzureRMSubnetNatGatewayAssociation_basic(t *testing.T) { } func TestAccAzureRMSubnetNatGatewayAssociation_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_subnet_nat_gateway_association", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_subnet_network_security_group_association_test.go b/azurerm/internal/services/network/tests/resource_arm_subnet_network_security_group_association_test.go index 48363fa4bee3a..c8f7bfdef37e7 100644 --- a/azurerm/internal/services/network/tests/resource_arm_subnet_network_security_group_association_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_subnet_network_security_group_association_test.go @@ -9,7 +9,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -34,11 +33,6 @@ func TestAccAzureRMSubnetNetworkSecurityGroupAssociation_basic(t *testing.T) { } func TestAccAzureRMSubnetNetworkSecurityGroupAssociation_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_subnet_network_security_group_association", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_subnet_route_table_association_test.go b/azurerm/internal/services/network/tests/resource_arm_subnet_route_table_association_test.go index 66f38365b4f88..0fcd36dc143dc 100644 --- a/azurerm/internal/services/network/tests/resource_arm_subnet_route_table_association_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_subnet_route_table_association_test.go @@ -9,7 +9,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -34,11 +33,6 @@ func TestAccAzureRMSubnetRouteTableAssociation_basic(t *testing.T) { } func TestAccAzureRMSubnetRouteTableAssociation_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_subnet_route_table_association", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_subnet_test.go b/azurerm/internal/services/network/tests/resource_arm_subnet_test.go index 527dfa9c0e715..ed484a655deb1 100644 --- a/azurerm/internal/services/network/tests/resource_arm_subnet_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_subnet_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -34,11 +33,6 @@ func TestAccAzureRMSubnet_basic(t *testing.T) { } func TestAccAzureRMSubnet_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_subnet", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_hub_connection_test.go b/azurerm/internal/services/network/tests/resource_arm_virtual_hub_connection_test.go index 522c72112ce98..265af4cbfa3c7 100644 --- a/azurerm/internal/services/network/tests/resource_arm_virtual_hub_connection_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_virtual_hub_connection_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/network/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,11 +32,6 @@ func TestAccAzureRMVirtualHubConnection_basic(t *testing.T) { } func TestAccAzureRMVirtualHubConnection_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_virtual_hub_connection", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_hub_test.go b/azurerm/internal/services/network/tests/resource_arm_virtual_hub_test.go index b3254f5340fd3..af20dfd948e66 100644 --- a/azurerm/internal/services/network/tests/resource_arm_virtual_hub_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_virtual_hub_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMVirtualHub_basic(t *testing.T) { } func TestAccAzureRMVirtualHub_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_virtual_hub", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_connection_test.go b/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_connection_test.go index 1273176bf70e4..211bc939164a7 100644 --- a/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_connection_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_connection_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMVirtualNetworkGatewayConnection_sitetosite(t *testing.T) { } func TestAccAzureRMVirtualNetworkGatewayConnection_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_virtual_network_gateway_connection", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_test.go index 3a8303fe2fa57..e78b324c6c1cf 100644 --- a/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,11 +32,6 @@ func TestAccAzureRMVirtualNetworkGateway_basic(t *testing.T) { } func TestAccAzureRMVirtualNetworkGateway_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_virtual_network_gateway", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_network_peering_test.go b/azurerm/internal/services/network/tests/resource_arm_virtual_network_peering_test.go index 3ec0418b2a07d..937d057bf32ab 100644 --- a/azurerm/internal/services/network/tests/resource_arm_virtual_network_peering_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_virtual_network_peering_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMVirtualNetworkPeering_basic(t *testing.T) { @@ -36,11 +35,6 @@ func TestAccAzureRMVirtualNetworkPeering_basic(t *testing.T) { } func TestAccAzureRMVirtualNetworkPeering_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_virtual_network_peering", "test1") secondResourceName := "azurerm_virtual_network_peering.test2" diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_network_test.go b/azurerm/internal/services/network/tests/resource_arm_virtual_network_test.go index 8c55908185e1e..6b49f472f1f2d 100644 --- a/azurerm/internal/services/network/tests/resource_arm_virtual_network_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_virtual_network_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMVirtualNetwork_basic(t *testing.T) { @@ -82,11 +81,6 @@ func TestAccAzureRMVirtualNetwork_basicUpdated(t *testing.T) { } func TestAccAzureRMVirtualNetwork_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_virtual_network", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_wan_test.go b/azurerm/internal/services/network/tests/resource_arm_virtual_wan_test.go index 29879bae5bc0d..f7f30bf02a8b9 100644 --- a/azurerm/internal/services/network/tests/resource_arm_virtual_wan_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_virtual_wan_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,10 +32,6 @@ func TestAccAzureRMVirtualWan_basic(t *testing.T) { } func TestAccAzureRMVirtualWan_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_virtual_wan", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_vpn_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_vpn_gateway_test.go index 71b1ed8cbbc48..85627701ac095 100644 --- a/azurerm/internal/services/network/tests/resource_arm_vpn_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_vpn_gateway_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMVPNGateway_basic(t *testing.T) { @@ -32,11 +31,6 @@ func TestAccAzureRMVPNGateway_basic(t *testing.T) { } func TestAccAzureRMVPNGateway_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_vpn_gateway", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/network/tests/resource_arm_vpn_server_configuration_test.go b/azurerm/internal/services/network/tests/resource_arm_vpn_server_configuration_test.go index eb58bb2536be9..93b9f2974ca28 100644 --- a/azurerm/internal/services/network/tests/resource_arm_vpn_server_configuration_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_vpn_server_configuration_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -58,11 +57,6 @@ func TestAccAzureRMVPNServerConfiguration_certificate(t *testing.T) { } func TestAccAzureRMVPNServerConfiguration_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_vpn_server_configuration", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_authorization_rule_test.go b/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_authorization_rule_test.go index 6777862a3de11..0db7fe750fdbf 100644 --- a/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_authorization_rule_test.go +++ b/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_authorization_rule_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMNotificationHubAuthorizationRule_listen(t *testing.T) { @@ -36,11 +35,6 @@ func TestAccAzureRMNotificationHubAuthorizationRule_listen(t *testing.T) { } func TestAccAzureRMNotificationHubAuthorizationRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_notification_hub_authorization_rule", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_namespace_test.go b/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_namespace_test.go index e511870cde39e..2bfabaa307720 100644 --- a/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_namespace_test.go +++ b/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_namespace_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMNotificationHubNamespace_free(t *testing.T) { @@ -31,11 +30,6 @@ func TestAccAzureRMNotificationHubNamespace_free(t *testing.T) { } func TestAccAzureRMNotificationHubNamespace_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_notification_hub_namespace", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_test.go b/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_test.go index ab1c71f9f104b..a61de8f0c3503 100644 --- a/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_test.go +++ b/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMNotificationHub_basic(t *testing.T) { @@ -33,11 +32,6 @@ func TestAccAzureRMNotificationHub_basic(t *testing.T) { } func TestAccAzureRMNotificationHub_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_notification_hub", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/policy/tests/resource_arm_policy_assignment_test.go b/azurerm/internal/services/policy/tests/resource_arm_policy_assignment_test.go index 83ab2d9ba8f28..4e541486373ac 100644 --- a/azurerm/internal/services/policy/tests/resource_arm_policy_assignment_test.go +++ b/azurerm/internal/services/policy/tests/resource_arm_policy_assignment_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMPolicyAssignment_basic(t *testing.T) { @@ -31,11 +30,6 @@ func TestAccAzureRMPolicyAssignment_basic(t *testing.T) { } func TestAccAzureRMPolicyAssignment_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_policy_assignment", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/policy/tests/resource_arm_policy_definition_test.go b/azurerm/internal/services/policy/tests/resource_arm_policy_definition_test.go index 4db75edde983a..4758625d44a14 100644 --- a/azurerm/internal/services/policy/tests/resource_arm_policy_definition_test.go +++ b/azurerm/internal/services/policy/tests/resource_arm_policy_definition_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/policy/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMPolicyDefinition_basic(t *testing.T) { } func TestAccAzureRMPolicyDefinition_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_policy_definition", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/policy/tests/resource_arm_policy_remediation_test.go b/azurerm/internal/services/policy/tests/resource_arm_policy_remediation_test.go index ad64d3d434387..d038a7c69a7d2 100644 --- a/azurerm/internal/services/policy/tests/resource_arm_policy_remediation_test.go +++ b/azurerm/internal/services/policy/tests/resource_arm_policy_remediation_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/policy" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/policy/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" @@ -148,11 +147,6 @@ func TestAccAzureRMPolicyRemediation_updateLocation(t *testing.T) { } func TestAccAzureRMPolicyRemediation_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_policy_remediation", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/postgres/tests/resource_arm_postgresql_database_test.go b/azurerm/internal/services/postgres/tests/resource_arm_postgresql_database_test.go index 83462b6ae8e6b..b413a87e0b4f7 100644 --- a/azurerm/internal/services/postgres/tests/resource_arm_postgresql_database_test.go +++ b/azurerm/internal/services/postgres/tests/resource_arm_postgresql_database_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMPostgreSQLDatabase_basic(t *testing.T) { } func TestAccAzureRMPostgreSQLDatabase_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_postgresql_database", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/postgres/tests/resource_arm_postgresql_firewall_rule_test.go b/azurerm/internal/services/postgres/tests/resource_arm_postgresql_firewall_rule_test.go index e15c3858b5582..e779789a0253d 100644 --- a/azurerm/internal/services/postgres/tests/resource_arm_postgresql_firewall_rule_test.go +++ b/azurerm/internal/services/postgres/tests/resource_arm_postgresql_firewall_rule_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,11 +32,6 @@ func TestAccAzureRMPostgreSQLFirewallRule_basic(t *testing.T) { } func TestAccAzureRMPostgreSQLFirewallRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_postgresql_firewall_rule", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/postgres/tests/resource_arm_postgresql_server_test.go b/azurerm/internal/services/postgres/tests/resource_arm_postgresql_server_test.go index 0394811089446..f0d93a0a0d0d0 100644 --- a/azurerm/internal/services/postgres/tests/resource_arm_postgresql_server_test.go +++ b/azurerm/internal/services/postgres/tests/resource_arm_postgresql_server_test.go @@ -111,6 +111,7 @@ func TestAccAzureRMPostgreSQLServer_basicEleven(t *testing.T) { func TestAccAzureRMPostgreSQLServer_autogrowOnly(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_postgresql_server", "test") + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, Providers: acceptance.SupportedProviders, diff --git a/azurerm/internal/services/postgres/tests/resource_arm_postgresql_virtual_network_rule_test.go b/azurerm/internal/services/postgres/tests/resource_arm_postgresql_virtual_network_rule_test.go index e67a63cf2511e..138eece44b7bf 100644 --- a/azurerm/internal/services/postgres/tests/resource_arm_postgresql_virtual_network_rule_test.go +++ b/azurerm/internal/services/postgres/tests/resource_arm_postgresql_virtual_network_rule_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,11 +32,6 @@ func TestAccAzureRMPostgreSQLVirtualNetworkRule_basic(t *testing.T) { } func TestAccAzureRMPostgreSQLVirtualNetworkRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_postgresql_virtual_network_rule", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/powerbi/tests/resource_arm_powerbi_embedded_test.go b/azurerm/internal/services/powerbi/tests/resource_arm_powerbi_embedded_test.go index 56f130c1adf94..c92a9415ac759 100644 --- a/azurerm/internal/services/powerbi/tests/resource_arm_powerbi_embedded_test.go +++ b/azurerm/internal/services/powerbi/tests/resource_arm_powerbi_embedded_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMPowerBIEmbedded_basic(t *testing.T) { } func TestAccAzureRMPowerBIEmbedded_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_powerbi_embedded", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_a_record_test.go b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_a_record_test.go index d322ad0dcc188..bab6ad1ce765a 100644 --- a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_a_record_test.go +++ b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_a_record_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMPrivateDnsARecord_basic(t *testing.T) { @@ -34,11 +33,6 @@ func TestAccAzureRMPrivateDnsARecord_basic(t *testing.T) { } func TestAccAzureRMPrivateDnsARecord_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_private_dns_a_record", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_aaaa_record_test.go b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_aaaa_record_test.go index d89bc9bb98c5a..eeafc879740a2 100644 --- a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_aaaa_record_test.go +++ b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_aaaa_record_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMPrivateDnsAaaaRecord_basic(t *testing.T) { @@ -34,11 +33,6 @@ func TestAccAzureRMPrivateDnsAaaaRecord_basic(t *testing.T) { } func TestAccAzureRMPrivateDnsAaaaRecord_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_private_dns_aaaa_record", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_cname_record_test.go b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_cname_record_test.go index 84b8beb9525d5..45a284e6d886d 100644 --- a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_cname_record_test.go +++ b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_cname_record_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMPrivateDnsCNameRecord_basic(t *testing.T) { @@ -33,11 +32,6 @@ func TestAccAzureRMPrivateDnsCNameRecord_basic(t *testing.T) { } func TestAccAzureRMPrivateDnsCNameRecord_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_private_dns_cname_record", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_mx_record_test.go b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_mx_record_test.go index 204320495b42e..4880e385b2bb6 100644 --- a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_mx_record_test.go +++ b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_mx_record_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMPrivateDnsMxRecord_basic(t *testing.T) { @@ -33,11 +32,6 @@ func TestAccAzureRMPrivateDnsMxRecord_basic(t *testing.T) { } func TestAccAzureRMPrivateDnsMxRecord_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_private_dns_mx_record", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_ptr_record_test.go b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_ptr_record_test.go index 482b8b67ce8e2..251156aade371 100644 --- a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_ptr_record_test.go +++ b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_ptr_record_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMPrivateDnsPtrRecord_basic(t *testing.T) { @@ -33,11 +32,6 @@ func TestAccAzureRMPrivateDnsPtrRecord_basic(t *testing.T) { } func TestAccAzureRMPrivateDnsPtrRecord_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_private_dns_ptr_record", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_srv_record_test.go b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_srv_record_test.go index ca3561faeff67..c83d745391f55 100644 --- a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_srv_record_test.go +++ b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_srv_record_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMPrivateDnsSrvRecord_basic(t *testing.T) { @@ -33,11 +32,6 @@ func TestAccAzureRMPrivateDnsSrvRecord_basic(t *testing.T) { } func TestAccAzureRMPrivateDnsSrvRecord_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_private_dns_srv_record", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_txt_record_test.go b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_txt_record_test.go index e62c9330f6037..b96326ba03022 100644 --- a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_txt_record_test.go +++ b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_txt_record_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMPrivateDnsTxtRecord_basic(t *testing.T) { @@ -33,11 +32,6 @@ func TestAccAzureRMPrivateDnsTxtRecord_basic(t *testing.T) { } func TestAccAzureRMPrivateDnsTxtRecord_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_private_dns_txt_record", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_zone_test.go b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_zone_test.go index dca6e005e30e6..236637b05cd7a 100644 --- a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_zone_test.go +++ b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_zone_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMPrivateDnsZone_basic(t *testing.T) { @@ -31,11 +30,6 @@ func TestAccAzureRMPrivateDnsZone_basic(t *testing.T) { } func TestAccAzureRMPrivateDnsZone_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_private_dns_zone", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_zone_virtual_network_link_test.go b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_zone_virtual_network_link_test.go index 7e918a835f137..5527780404c12 100644 --- a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_zone_virtual_network_link_test.go +++ b/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_zone_virtual_network_link_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,11 +31,6 @@ func TestAccAzureRMPrivateDnsZoneVirtualNetworkLink_basic(t *testing.T) { } func TestAccAzureRMPrivateDnsZoneVirtualNetworkLink_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_private_dns_zone_virtual_network_link", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_policy_file_share_test.go b/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_policy_file_share_test.go index 99176f1101f8d..4c25608070d5f 100644 --- a/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_policy_file_share_test.go +++ b/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_policy_file_share_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -30,11 +29,6 @@ func TestAccAzureRMBackupProtectionPolicyFileShare_basicDaily(t *testing.T) { } func TestAccAzureRMBackupProtectionPolicyFileShare_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_backup_policy_file_share", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_policy_vm_test.go b/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_policy_vm_test.go index 275073ee70df5..a13fa5b0478ee 100644 --- a/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_policy_vm_test.go +++ b/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_policy_vm_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -35,11 +34,6 @@ func TestAccAzureRMBackupProtectionPolicyVM_basicDaily(t *testing.T) { } func TestAccAzureRMBackupProtectionPolicyVM_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_backup_policy_vm", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_protected_file_share_test.go b/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_protected_file_share_test.go index 92f947048090c..d73a318881a10 100644 --- a/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_protected_file_share_test.go +++ b/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_protected_file_share_test.go @@ -9,7 +9,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -39,11 +38,6 @@ func TestAccAzureRMBackupProtectedFileShare_basic(t *testing.T) { } func TestAccAzureRMBackupProtectedFileShare_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_backup_protected_file_share", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_protected_vm_test.go b/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_protected_vm_test.go index 75ae8963ec9ef..d2ba87369cecb 100644 --- a/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_protected_vm_test.go +++ b/azurerm/internal/services/recoveryservices/tests/resource_arm_backup_protected_vm_test.go @@ -9,7 +9,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -38,11 +37,6 @@ func TestAccAzureRMBackupProtectedVm_basic(t *testing.T) { } func TestAccAzureRMBackupProtectedVm_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_backup_protected_vm", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/recoveryservices/tests/resource_arm_recovery_services_vault_test.go b/azurerm/internal/services/recoveryservices/tests/resource_arm_recovery_services_vault_test.go index 00e17957a59d5..3fc5641d0f089 100644 --- a/azurerm/internal/services/recoveryservices/tests/resource_arm_recovery_services_vault_test.go +++ b/azurerm/internal/services/recoveryservices/tests/resource_arm_recovery_services_vault_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -84,11 +83,6 @@ func TestAccAzureRMRecoveryServicesVault_update(t *testing.T) { } func TestAccAzureRMRecoveryServicesVault_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_recovery_services_vault", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/redis/tests/resource_arm_redis_cache_test.go b/azurerm/internal/services/redis/tests/resource_arm_redis_cache_test.go index f9b62fe5633b8..c6a8dd1bdaff3 100644 --- a/azurerm/internal/services/redis/tests/resource_arm_redis_cache_test.go +++ b/azurerm/internal/services/redis/tests/resource_arm_redis_cache_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMRedisCache_basic(t *testing.T) { @@ -35,11 +34,6 @@ func TestAccAzureRMRedisCache_basic(t *testing.T) { } func TestAccAzureRMRedisCache_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_redis_cache", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/redis/tests/resource_arm_redis_firewall_rule_test.go b/azurerm/internal/services/redis/tests/resource_arm_redis_firewall_rule_test.go index 10e937c566095..497f8cf0668d3 100644 --- a/azurerm/internal/services/redis/tests/resource_arm_redis_firewall_rule_test.go +++ b/azurerm/internal/services/redis/tests/resource_arm_redis_firewall_rule_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -59,11 +58,6 @@ func TestAccAzureRMRedisFirewallRule_multi(t *testing.T) { } func TestAccAzureRMRedisFirewallRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_redis_firewall_rule", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/relay/tests/resource_arm_relay_hybrid_connection_test.go b/azurerm/internal/services/relay/tests/resource_arm_relay_hybrid_connection_test.go index 5496e5d7cc4ae..1cad9e445efc1 100644 --- a/azurerm/internal/services/relay/tests/resource_arm_relay_hybrid_connection_test.go +++ b/azurerm/internal/services/relay/tests/resource_arm_relay_hybrid_connection_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMRelayHybridConnection_basic(t *testing.T) { @@ -80,11 +79,6 @@ func TestAccAzureRMRelayHybridConnection_update(t *testing.T) { } func TestAccAzureRMRelayHybridConnection_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_relay_hybrid_connection", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/relay/tests/resource_arm_relay_namespace_test.go b/azurerm/internal/services/relay/tests/resource_arm_relay_namespace_test.go index 98fcdd4d74371..0e2e493af8ca8 100644 --- a/azurerm/internal/services/relay/tests/resource_arm_relay_namespace_test.go +++ b/azurerm/internal/services/relay/tests/resource_arm_relay_namespace_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMRelayNamespace_basic(t *testing.T) { @@ -38,11 +37,6 @@ func TestAccAzureRMRelayNamespace_basic(t *testing.T) { } func TestAccAzureRMRelayNamespace_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_relay_namespace", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/resource/tests/resource_arm_management_lock_test.go b/azurerm/internal/services/resource/tests/resource_arm_management_lock_test.go index f5f447bce3394..cf6990b2f2c5e 100644 --- a/azurerm/internal/services/resource/tests/resource_arm_management_lock_test.go +++ b/azurerm/internal/services/resource/tests/resource_arm_management_lock_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,11 +32,6 @@ func TestAccAzureRMManagementLock_resourceGroupReadOnlyBasic(t *testing.T) { } func TestAccAzureRMManagementLock_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_management_lock", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/resource/tests/resource_arm_resource_group_test.go b/azurerm/internal/services/resource/tests/resource_arm_resource_group_test.go index ad03a2fcd2569..07c54d3e8f1e9 100644 --- a/azurerm/internal/services/resource/tests/resource_arm_resource_group_test.go +++ b/azurerm/internal/services/resource/tests/resource_arm_resource_group_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMResourceGroup_basic(t *testing.T) { @@ -32,11 +31,6 @@ func TestAccAzureRMResourceGroup_basic(t *testing.T) { } func TestAccAzureRMResourceGroup_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_resource_group", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/resource/tests/resource_arm_template_deployment_test.go b/azurerm/internal/services/resource/tests/resource_arm_template_deployment_test.go index 26831307f44bf..ffddac31e5694 100644 --- a/azurerm/internal/services/resource/tests/resource_arm_template_deployment_test.go +++ b/azurerm/internal/services/resource/tests/resource_arm_template_deployment_test.go @@ -13,7 +13,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -36,11 +35,6 @@ func TestAccAzureRMTemplateDeployment_basic(t *testing.T) { } func TestAccAzureRMTemplateDeployment_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_template_deployment", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/search/tests/resource_arm_search_service_test.go b/azurerm/internal/services/search/tests/resource_arm_search_service_test.go index 094ad11ff37d3..2a0802e536dab 100644 --- a/azurerm/internal/services/search/tests/resource_arm_search_service_test.go +++ b/azurerm/internal/services/search/tests/resource_arm_search_service_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/search/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -34,11 +33,6 @@ func TestAccAzureRMSearchService_basic(t *testing.T) { } func TestAccAzureRMSearchService_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_search_service", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/securitycenter/tests/resource_arm_advanced_threat_protection_test.go b/azurerm/internal/services/securitycenter/tests/resource_arm_advanced_threat_protection_test.go index ca06d18dc4f01..16bfe80ca8f61 100644 --- a/azurerm/internal/services/securitycenter/tests/resource_arm_advanced_threat_protection_test.go +++ b/azurerm/internal/services/securitycenter/tests/resource_arm_advanced_threat_protection_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMAdvancedThreatProtection_storageAccount(t *testing.T) { @@ -86,11 +85,6 @@ func TestAccAzureRMAdvancedThreatProtection_cosmosAccount(t *testing.T) { } func TestAccAzureRMAdvancedThreatProtection_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_advanced_threat_protection", "import") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/securitycenter/tests/resource_arm_security_center_contact_test.go b/azurerm/internal/services/securitycenter/tests/resource_arm_security_center_contact_test.go index 2f15eefa6878a..2bcb69b41fc14 100644 --- a/azurerm/internal/services/securitycenter/tests/resource_arm_security_center_contact_test.go +++ b/azurerm/internal/services/securitycenter/tests/resource_arm_security_center_contact_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -60,11 +59,6 @@ func testAccAzureRMSecurityCenterContact_basic(t *testing.T) { } func testAccAzureRMSecurityCenterContact_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_security_center_contact", "test") resource.Test(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/securitycenter/tests/resource_arm_security_center_workspace_test.go b/azurerm/internal/services/securitycenter/tests/resource_arm_security_center_workspace_test.go index c79e500d6ae2c..c49b5950c546b 100644 --- a/azurerm/internal/services/securitycenter/tests/resource_arm_security_center_workspace_test.go +++ b/azurerm/internal/services/securitycenter/tests/resource_arm_security_center_workspace_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -40,11 +39,6 @@ func testAccAzureRMSecurityCenterWorkspace_basic(t *testing.T) { } func testAccAzureRMSecurityCenterWorkspace_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_security_center_workspace", "test") scope := fmt.Sprintf("/subscriptions/%s", os.Getenv("ARM_SUBSCRIPTION_ID")) diff --git a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_authorization_rule_test.go b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_authorization_rule_test.go index f94ad070d8197..b7005d0369a22 100644 --- a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_authorization_rule_test.go +++ b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_authorization_rule_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -95,10 +94,6 @@ func TestAccAzureRMServiceBusNamespaceAuthorizationRule_rightsUpdate(t *testing. }) } func TestAccAzureRMServiceBusNamespaceAuthorizationRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_servicebus_namespace_authorization_rule", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_test.go b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_test.go index f051e1e6f2d4f..4251764579d2d 100644 --- a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_test.go +++ b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_namespace_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMServiceBusNamespace_basic(t *testing.T) { @@ -31,10 +30,6 @@ func TestAccAzureRMServiceBusNamespace_basic(t *testing.T) { }) } func TestAccAzureRMServiceBusNamespace_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_servicebus_namespace", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_queue_authorization_rule_test.go b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_queue_authorization_rule_test.go index de508d7436ac6..e726f659d55be 100644 --- a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_queue_authorization_rule_test.go +++ b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_queue_authorization_rule_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -95,10 +94,6 @@ func TestAccAzureRMServiceBusQueueAuthorizationRule_rightsUpdate(t *testing.T) { }) } func TestAccAzureRMServiceBusQueueAuthorizationRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_servicebus_queue_authorization_rule", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_queue_test.go b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_queue_test.go index 9eb9e11f10d16..e1a8723308f2b 100644 --- a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_queue_test.go +++ b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_queue_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,11 +32,6 @@ func TestAccAzureRMServiceBusQueue_basic(t *testing.T) { }) } func TestAccAzureRMServiceBusQueue_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_servicebus_queue", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_subscription_rule_test.go b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_subscription_rule_test.go index bf450bd16a622..8d03b1b1bd279 100644 --- a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_subscription_rule_test.go +++ b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_subscription_rule_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -30,10 +29,6 @@ func TestAccAzureRMServiceBusSubscriptionRule_basicSqlFilter(t *testing.T) { }) } func TestAccAzureRMServiceBusSubscriptionRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_servicebus_subscription_rule", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_subscription_test.go b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_subscription_test.go index a76d65b64923e..92fcb118e2fef 100644 --- a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_subscription_test.go +++ b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_subscription_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,10 +32,6 @@ func TestAccAzureRMServiceBusSubscription_basic(t *testing.T) { } func TestAccAzureRMServiceBusSubscription_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_servicebus_subscription", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_topic_authorization_rule_test.go b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_topic_authorization_rule_test.go index b1b13e6b97686..70f97df62bc59 100644 --- a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_topic_authorization_rule_test.go +++ b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_topic_authorization_rule_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -58,10 +57,6 @@ func testAccAzureRMServiceBusTopicAuthorizationRule(t *testing.T, listen, send, } func TestAccAzureRMServiceBusTopicAuthorizationRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_servicebus_topic_authorization_rule", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_topic_test.go b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_topic_test.go index 5969f9896f74c..140c96eb80cfe 100644 --- a/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_topic_test.go +++ b/azurerm/internal/services/servicebus/tests/resource_arm_servicebus_topic_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -32,10 +31,6 @@ func TestAccAzureRMServiceBusTopic_basic(t *testing.T) { }) } func TestAccAzureRMServiceBusTopic_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_servicebus_topic", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/servicefabric/tests/resource_arm_service_fabric_cluster_test.go b/azurerm/internal/services/servicefabric/tests/resource_arm_service_fabric_cluster_test.go index 552d16ffa6ff9..ff4c44dd2b7ef 100644 --- a/azurerm/internal/services/servicefabric/tests/resource_arm_service_fabric_cluster_test.go +++ b/azurerm/internal/services/servicefabric/tests/resource_arm_service_fabric_cluster_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicefabric/parse" ) @@ -89,10 +88,6 @@ func TestAccAzureRMServiceFabricCluster_basicNodeTypeUpdate(t *testing.T) { } func TestAccAzureRMServiceFabricCluster_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_service_fabric_cluster", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/signalr/tests/resource_arm_signalr_service_test.go b/azurerm/internal/services/signalr/tests/resource_arm_signalr_service_test.go index f1d9da80dd4d7..617111e2db257 100644 --- a/azurerm/internal/services/signalr/tests/resource_arm_signalr_service_test.go +++ b/azurerm/internal/services/signalr/tests/resource_arm_signalr_service_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/signalr/parse" ) @@ -43,10 +42,6 @@ func TestAccAzureRMSignalRService_basic(t *testing.T) { } func TestAccAzureRMSignalRService_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_signalr_service", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/sql/tests/resource_arm_sql_administrator_test.go b/azurerm/internal/services/sql/tests/resource_arm_sql_administrator_test.go index 8b699311b6215..8d62199ebcff0 100644 --- a/azurerm/internal/services/sql/tests/resource_arm_sql_administrator_test.go +++ b/azurerm/internal/services/sql/tests/resource_arm_sql_administrator_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -39,10 +38,6 @@ func TestAccAzureRMSqlAdministrator_basic(t *testing.T) { }) } func TestAccAzureRMSqlAdministrator_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_sql_active_directory_administrator", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/sql/tests/resource_arm_sql_database_test.go b/azurerm/internal/services/sql/tests/resource_arm_sql_database_test.go index 3ba62ef2bde30..11ff51d0f7a70 100644 --- a/azurerm/internal/services/sql/tests/resource_arm_sql_database_test.go +++ b/azurerm/internal/services/sql/tests/resource_arm_sql_database_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -37,10 +36,6 @@ func TestAccAzureRMSqlDatabase_basic(t *testing.T) { }) } func TestAccAzureRMSqlDatabase_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_sql_database", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/sql/tests/resource_arm_sql_elasticpool_test.go b/azurerm/internal/services/sql/tests/resource_arm_sql_elasticpool_test.go index 1c754e9a334a3..6d6796fb3ade8 100644 --- a/azurerm/internal/services/sql/tests/resource_arm_sql_elasticpool_test.go +++ b/azurerm/internal/services/sql/tests/resource_arm_sql_elasticpool_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMSqlElasticPool_basic(t *testing.T) { @@ -31,10 +30,6 @@ func TestAccAzureRMSqlElasticPool_basic(t *testing.T) { }) } func TestAccAzureRMSqlElasticPool_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_sql_elasticpool", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/sql/tests/resource_arm_sql_firewall_rule_test.go b/azurerm/internal/services/sql/tests/resource_arm_sql_firewall_rule_test.go index afeb59ede74f4..0c61b44b0f5e4 100644 --- a/azurerm/internal/services/sql/tests/resource_arm_sql_firewall_rule_test.go +++ b/azurerm/internal/services/sql/tests/resource_arm_sql_firewall_rule_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -41,10 +40,6 @@ func TestAccAzureRMSqlFirewallRule_basic(t *testing.T) { }) } func TestAccAzureRMSqlFirewallRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_sql_firewall_rule", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/sql/tests/resource_arm_sql_server_test.go b/azurerm/internal/services/sql/tests/resource_arm_sql_server_test.go index fce99e68a1527..454118c4731b7 100644 --- a/azurerm/internal/services/sql/tests/resource_arm_sql_server_test.go +++ b/azurerm/internal/services/sql/tests/resource_arm_sql_server_test.go @@ -9,7 +9,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -37,10 +36,6 @@ func TestAccAzureRMSqlServer_basic(t *testing.T) { }) } func TestAccAzureRMSqlServer_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_sql_server", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/sql/tests/resource_arm_sql_virtual_network_rule_test.go b/azurerm/internal/services/sql/tests/resource_arm_sql_virtual_network_rule_test.go index 73af388e886a2..2f3f0e37197be 100644 --- a/azurerm/internal/services/sql/tests/resource_arm_sql_virtual_network_rule_test.go +++ b/azurerm/internal/services/sql/tests/resource_arm_sql_virtual_network_rule_test.go @@ -13,7 +13,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -50,10 +49,6 @@ func TestAccAzureRMSqlVirtualNetworkRule_basic(t *testing.T) { } func TestAccAzureRMSqlVirtualNetworkRule_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_sql_virtual_network_rule", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/storage/tests/resource_arm_hpc_cache_blob_target_test.go b/azurerm/internal/services/storage/tests/resource_arm_hpc_cache_blob_target_test.go index a43ce1c55911d..d93f0ef9f83fe 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_hpc_cache_blob_target_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_hpc_cache_blob_target_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -60,11 +59,6 @@ func TestAccAzureRMHPCCacheBlobTarget_update(t *testing.T) { } func TestAccAzureRMHPCCacheBlobTarget_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_hpc_cache_blob_target", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/storage/tests/resource_arm_hpc_cache_test.go b/azurerm/internal/services/storage/tests/resource_arm_hpc_cache_test.go index 52ebb2d45bea8..1ea780e2641f2 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_hpc_cache_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_hpc_cache_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMHPCCache_basic(t *testing.T) { @@ -33,11 +32,6 @@ func TestAccAzureRMHPCCache_basic(t *testing.T) { } func TestAccAzureRMHPCCache_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_hpc_cache", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/storage/tests/resource_arm_storage_account_test.go b/azurerm/internal/services/storage/tests/resource_arm_storage_account_test.go index 201bfced45824..760e180e14575 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_storage_account_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_storage_account_test.go @@ -11,7 +11,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" @@ -73,10 +72,6 @@ func TestAccAzureRMStorageAccount_basic(t *testing.T) { } func TestAccAzureRMStorageAccount_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_storage_account", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/storage/tests/resource_arm_storage_blob_test.go b/azurerm/internal/services/storage/tests/resource_arm_storage_blob_test.go index 51339286fbed9..a6b6639af9eb8 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_storage_blob_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_storage_blob_test.go @@ -11,7 +11,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" "github.com/tombuildsstuff/giovanni/storage/2018-11-09/blob/blobs" ) @@ -514,10 +513,6 @@ func TestAccAzureRMStorageBlob_pageFromLocalFile(t *testing.T) { } func TestAccAzureRMStorageBlob_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_storage_blob", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/storage/tests/resource_arm_storage_container_test.go b/azurerm/internal/services/storage/tests/resource_arm_storage_container_test.go index fa0f16071db17..eba09c032ebc0 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_storage_container_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_storage_container_test.go @@ -10,7 +10,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -53,10 +52,6 @@ func TestAccAzureRMStorageContainer_basicAzureADAuth(t *testing.T) { } func TestAccAzureRMStorageContainer_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_storage_container", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/storage/tests/resource_arm_storage_data_lake_gen2_filesystem_test.go b/azurerm/internal/services/storage/tests/resource_arm_storage_data_lake_gen2_filesystem_test.go index 71b3f75152c3b..68939b83ffcfb 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_storage_data_lake_gen2_filesystem_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_storage_data_lake_gen2_filesystem_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage/parsers" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,10 +32,6 @@ func TestAccAzureRMStorageDataLakeGen2FileSystem_basic(t *testing.T) { } func TestAccAzureRMStorageDataLakeGen2FileSystem_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_storage_data_lake_gen2_filesystem", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/storage/tests/resource_arm_storage_queue_test.go b/azurerm/internal/services/storage/tests/resource_arm_storage_queue_test.go index 349c500329b6f..7f15ce810aa76 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_storage_queue_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_storage_queue_test.go @@ -11,7 +11,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -94,10 +93,6 @@ func TestAccAzureRMStorageQueue_basicAzureADAuth(t *testing.T) { } func TestAccAzureRMStorageQueue_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_storage_queue", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/storage/tests/resource_arm_storage_share_directory_test.go b/azurerm/internal/services/storage/tests/resource_arm_storage_share_directory_test.go index 6792afb73b814..1dbf902e6e0a7 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_storage_share_directory_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_storage_share_directory_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMStorageShareDirectory_basic(t *testing.T) { @@ -51,10 +50,6 @@ func TestAccAzureRMStorageShareDirectory_uppercase(t *testing.T) { } func TestAccAzureRMStorageShareDirectory_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_storage_share_directory", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/storage/tests/resource_arm_storage_share_test.go b/azurerm/internal/services/storage/tests/resource_arm_storage_share_test.go index ac83398c00b49..ad2e4a6cfa2a4 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_storage_share_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_storage_share_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMStorageShare_basic(t *testing.T) { @@ -31,10 +30,6 @@ func TestAccAzureRMStorageShare_basic(t *testing.T) { } func TestAccAzureRMStorageShare_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_storage_share", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/storage/tests/resource_arm_storage_table_entity_test.go b/azurerm/internal/services/storage/tests/resource_arm_storage_table_entity_test.go index 7916e19d2bfb8..519dcd0fa9cd1 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_storage_table_entity_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_storage_table_entity_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/tombuildsstuff/giovanni/storage/2018-11-09/table/entities" ) @@ -33,10 +32,6 @@ func TestAccAzureRMTableEntity_basic(t *testing.T) { } func TestAccAzureRMTableEntity_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_storage_table_entity", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/storage/tests/resource_arm_storage_table_test.go b/azurerm/internal/services/storage/tests/resource_arm_storage_table_test.go index 85b7676121f1a..d8e537d188a06 100644 --- a/azurerm/internal/services/storage/tests/resource_arm_storage_table_test.go +++ b/azurerm/internal/services/storage/tests/resource_arm_storage_table_test.go @@ -11,7 +11,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -35,10 +34,6 @@ func TestAccAzureRMStorageTable_basic(t *testing.T) { } func TestAccAzureRMStorageTable_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_storage_table", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_function_javascript_udf_test.go b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_function_javascript_udf_test.go index 6af0374977de5..d283c84fd47d0 100644 --- a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_function_javascript_udf_test.go +++ b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_function_javascript_udf_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMStreamAnalyticsFunctionJavaScriptUDF_basic(t *testing.T) { @@ -32,11 +31,6 @@ func TestAccAzureRMStreamAnalyticsFunctionJavaScriptUDF_basic(t *testing.T) { } func TestAccAzureRMStreamAnalyticsFunctionJavaScriptUDF_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_stream_analytics_function_javascript_udf", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_job_test.go b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_job_test.go index 12b1d652a4752..e5b0544a35737 100644 --- a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_job_test.go +++ b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_job_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMStreamAnalyticsJob_basic(t *testing.T) { @@ -55,11 +54,6 @@ func TestAccAzureRMStreamAnalyticsJob_complete(t *testing.T) { } func TestAccAzureRMStreamAnalyticsJob_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_stream_analytics_job", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_blob_test.go b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_blob_test.go index 4c3cf2823256e..2b8c37bf0ac38 100644 --- a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_blob_test.go +++ b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_blob_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMStreamAnalyticsOutputBlob_avro(t *testing.T) { @@ -94,11 +93,6 @@ func TestAccAzureRMStreamAnalyticsOutputBlob_update(t *testing.T) { } func TestAccAzureRMStreamAnalyticsOutputBlob_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_stream_analytics_output_blob", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_eventhub_test.go b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_eventhub_test.go index 53a99b821caed..c84c2625f0752 100644 --- a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_eventhub_test.go +++ b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_eventhub_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMStreamAnalyticsOutputEventHub_avro(t *testing.T) { @@ -123,11 +122,6 @@ func TestAccAzureRMStreamAnalyticsOutputEventHub_update(t *testing.T) { } func TestAccAzureRMStreamAnalyticsOutputEventHub_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_stream_analytics_output_eventhub", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_mssql_test.go b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_mssql_test.go index d6aa4cb9fcb91..8c0df720f684a 100644 --- a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_mssql_test.go +++ b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_mssql_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMStreamAnalyticsOutputSql_basic(t *testing.T) { @@ -56,11 +55,6 @@ func TestAccAzureRMStreamAnalyticsOutputSql_update(t *testing.T) { } func TestAccAzureRMStreamAnalyticsOutputSql_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_stream_analytics_output_mssql", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_servicebus_queue_test.go b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_servicebus_queue_test.go index 8715f344304ab..d03989220ff84 100644 --- a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_servicebus_queue_test.go +++ b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_servicebus_queue_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMStreamAnalyticsOutputServiceBusQueue_avro(t *testing.T) { @@ -95,11 +94,6 @@ func TestAccAzureRMStreamAnalyticsOutputServiceBusQueue_update(t *testing.T) { } func TestAccAzureRMStreamAnalyticsOutputServiceBusQueue_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_stream_analytics_output_servicebus_queue", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_servicebus_topic_test.go b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_servicebus_topic_test.go index 0f777bb977f2c..cc02c09eff9b3 100644 --- a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_servicebus_topic_test.go +++ b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_output_servicebus_topic_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMStreamAnalyticsOutputServiceBusTopic_avro(t *testing.T) { @@ -95,11 +94,6 @@ func TestAccAzureRMStreamAnalyticsOutputServiceBusTopic_update(t *testing.T) { } func TestAccAzureRMStreamAnalyticsOutputServiceBusTopic_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_stream_analytics_output_servicebus_topic", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_reference_input_blob_test.go b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_reference_input_blob_test.go index 2293d5309e246..46ac4fba9cd39 100644 --- a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_reference_input_blob_test.go +++ b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_reference_input_blob_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMStreamAnalyticsReferenceInputBlob_avro(t *testing.T) { @@ -95,11 +94,6 @@ func TestAccAzureRMStreamAnalyticsReferenceInputBlob_update(t *testing.T) { } func TestAccAzureRMStreamAnalyticsReferenceInputBlob_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_stream_analytics_reference_input_blob", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_stream_input_blob_test.go b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_stream_input_blob_test.go index b42ad7e367a34..3d7ae3141e699 100644 --- a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_stream_input_blob_test.go +++ b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_stream_input_blob_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMStreamAnalyticsStreamInputBlob_avro(t *testing.T) { @@ -95,11 +94,6 @@ func TestAccAzureRMStreamAnalyticsStreamInputBlob_update(t *testing.T) { } func TestAccAzureRMStreamAnalyticsStreamInputBlob_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_stream_analytics_stream_input_blob", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_stream_input_eventhub_test.go b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_stream_input_eventhub_test.go index 2a4333b87fa32..f705b5fc965b0 100644 --- a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_stream_input_eventhub_test.go +++ b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_stream_input_eventhub_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMStreamAnalyticsStreamInputEventHub_avro(t *testing.T) { @@ -95,11 +94,6 @@ func TestAccAzureRMStreamAnalyticsStreamInputEventHub_update(t *testing.T) { } func TestAccAzureRMStreamAnalyticsStreamInputEventHub_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_stream_analytics_stream_input_eventhub", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_stream_input_iothub_test.go b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_stream_input_iothub_test.go index 0b9c4298c480d..f3149ec109902 100644 --- a/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_stream_input_iothub_test.go +++ b/azurerm/internal/services/streamanalytics/tests/resource_arm_stream_analytics_stream_input_iothub_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMStreamAnalyticsStreamInputIoTHub_avro(t *testing.T) { @@ -95,11 +94,6 @@ func TestAccAzureRMStreamAnalyticsStreamInputIoTHub_update(t *testing.T) { } func TestAccAzureRMStreamAnalyticsStreamInputIoTHub_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_stream_analytics_stream_input_iothub", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/trafficmanager/tests/resource_arm_traffic_manager_endpoint_test.go b/azurerm/internal/services/trafficmanager/tests/resource_arm_traffic_manager_endpoint_test.go index 59f5d813b46a8..a19fb0a77c517 100644 --- a/azurerm/internal/services/trafficmanager/tests/resource_arm_traffic_manager_endpoint_test.go +++ b/azurerm/internal/services/trafficmanager/tests/resource_arm_traffic_manager_endpoint_test.go @@ -10,7 +10,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMTrafficManagerEndpoint_basic(t *testing.T) { @@ -36,11 +35,6 @@ func TestAccAzureRMTrafficManagerEndpoint_basic(t *testing.T) { }) } func TestAccAzureRMTrafficManagerEndpoint_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_traffic_manager_endpoint", "testAzure") externalResourceName := "azurerm_traffic_manager_endpoint.testExternal" diff --git a/azurerm/internal/services/trafficmanager/tests/resource_arm_traffic_manager_profile_test.go b/azurerm/internal/services/trafficmanager/tests/resource_arm_traffic_manager_profile_test.go index aa0e6679d4502..00230584c1740 100644 --- a/azurerm/internal/services/trafficmanager/tests/resource_arm_traffic_manager_profile_test.go +++ b/azurerm/internal/services/trafficmanager/tests/resource_arm_traffic_manager_profile_test.go @@ -11,7 +11,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" ) func TestAccAzureRMTrafficManagerProfile_basic(t *testing.T) { @@ -81,11 +80,6 @@ func TestAccAzureRMTrafficManagerProfile_update(t *testing.T) { } func TestAccAzureRMTrafficManagerProfile_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_traffic_manager_profile", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/web/tests/app_service_environment_resource_test.go b/azurerm/internal/services/web/tests/app_service_environment_resource_test.go index dc730a342110b..e338f201084f7 100644 --- a/azurerm/internal/services/web/tests/app_service_environment_resource_test.go +++ b/azurerm/internal/services/web/tests/app_service_environment_resource_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -34,11 +33,6 @@ func TestAccAzureRMAppServiceEnvironment_basic(t *testing.T) { } func TestAccAzureRMAppServiceEnvironment_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_app_service_environment", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/web/tests/resource_arm_app_service_certificate_order_test.go b/azurerm/internal/services/web/tests/resource_arm_app_service_certificate_order_test.go index ecd4ead2639c4..ed5155639789c 100644 --- a/azurerm/internal/services/web/tests/resource_arm_app_service_certificate_order_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_app_service_certificate_order_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -69,11 +68,6 @@ func TestAccAzureRMAppServiceCertificateOrder_wildcard(t *testing.T) { } func TestAccAzureRMAppServiceCertificateOrder_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - if os.Getenv("ARM_RUN_TEST_APP_SERVICE_CERTIFICATE") == "" { t.Skip("Skipping as ARM_RUN_TEST_APP_SERVICE_CERTIFICATE is not specified") return diff --git a/azurerm/internal/services/web/tests/resource_arm_app_service_custom_hostname_binding_test.go b/azurerm/internal/services/web/tests/resource_arm_app_service_custom_hostname_binding_test.go index dc82b27013525..944b74a52cfc9 100644 --- a/azurerm/internal/services/web/tests/resource_arm_app_service_custom_hostname_binding_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_app_service_custom_hostname_binding_test.go @@ -9,7 +9,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -70,11 +69,6 @@ func testAccAzureRMAppServiceCustomHostnameBinding_basic(t *testing.T, appServic } func testAccAzureRMAppServiceCustomHostnameBinding_requiresImport(t *testing.T, appServiceEnv, domainEnv string) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_app_service_custom_hostname_binding", "test") resource.Test(t, resource.TestCase{ diff --git a/azurerm/internal/services/web/tests/resource_arm_app_service_plan_test.go b/azurerm/internal/services/web/tests/resource_arm_app_service_plan_test.go index 03f43e3f67488..30cfb3d52bbb2 100644 --- a/azurerm/internal/services/web/tests/resource_arm_app_service_plan_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_app_service_plan_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -63,10 +62,6 @@ func TestAccAzureRMAppServicePlan_basicLinux(t *testing.T) { } func TestAccAzureRMAppServicePlan_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } data := acceptance.BuildTestData(t, "azurerm_app_service_plan", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/web/tests/resource_arm_app_service_slot_test.go b/azurerm/internal/services/web/tests/resource_arm_app_service_slot_test.go index cf02ada394e90..777493cc50754 100644 --- a/azurerm/internal/services/web/tests/resource_arm_app_service_slot_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_app_service_slot_test.go @@ -11,7 +11,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -34,11 +33,6 @@ func TestAccAzureRMAppServiceSlot_basic(t *testing.T) { } func TestAccAzureRMAppServiceSlot_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_app_service_slot", "test") resource.ParallelTest(t, resource.TestCase{ diff --git a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go index b99b41c215bc8..5acb93cc831ce 100644 --- a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go @@ -12,7 +12,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -38,11 +37,6 @@ func TestAccAzureRMAppService_basic(t *testing.T) { } func TestAccAzureRMAppService_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_app_service", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, diff --git a/azurerm/internal/services/web/tests/resource_arm_function_app_test.go b/azurerm/internal/services/web/tests/resource_arm_function_app_test.go index 22465ea3938a3..205a0af9a642d 100644 --- a/azurerm/internal/services/web/tests/resource_arm_function_app_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_function_app_test.go @@ -9,7 +9,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" @@ -41,11 +40,6 @@ func TestAccAzureRMFunctionApp_basic(t *testing.T) { func TestAccAzureRMFunctionApp_requiresImport(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_function_app", "test") - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, Providers: acceptance.SupportedProviders, From df1abaf105da4b0c5641eebcf87f14c9a157485c Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Wed, 22 Apr 2020 08:42:15 -0700 Subject: [PATCH 011/223] `azurerm_function_app` - Added `storage_account_id` and `storage_account_access_key` (#6304) --- .../data_source_monitor_action_group_test.go | 11 +- .../resource_arm_monitor_action_group_test.go | 22 +- .../services/web/resource_arm_function_app.go | 116 +++- .../tests/resource_arm_function_app_test.go | 592 +++++++++++++----- website/docs/r/function_app.html.markdown | 26 +- 5 files changed, 569 insertions(+), 198 deletions(-) diff --git a/azurerm/internal/services/monitor/tests/data_source_monitor_action_group_test.go b/azurerm/internal/services/monitor/tests/data_source_monitor_action_group_test.go index e418163df465f..aab0ebf9972a5 100644 --- a/azurerm/internal/services/monitor/tests/data_source_monitor_action_group_test.go +++ b/azurerm/internal/services/monitor/tests/data_source_monitor_action_group_test.go @@ -356,11 +356,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = "${azurerm_resource_group.test.location}" - resource_group_name = "${azurerm_resource_group.test.name}" - app_service_plan_id = "${azurerm_app_service_plan.test.id}" - storage_connection_string = "${azurerm_storage_account.test.primary_connection_string}" + name = "acctestFA-%d" + location = "${azurerm_resource_group.test.location}" + resource_group_name = "${azurerm_resource_group.test.name}" + app_service_plan_id = "${azurerm_app_service_plan.test.id}" + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } data "azurerm_monitor_action_group" "test" { diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_action_group_test.go b/azurerm/internal/services/monitor/tests/resource_arm_monitor_action_group_test.go index 60db96d6b8b68..d544098eb719c 100644 --- a/azurerm/internal/services/monitor/tests/resource_arm_monitor_action_group_test.go +++ b/azurerm/internal/services/monitor/tests/resource_arm_monitor_action_group_test.go @@ -741,11 +741,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomString, data.RandomInteger, data.RandomInteger) } @@ -941,11 +942,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = "${azurerm_resource_group.test.location}" - resource_group_name = "${azurerm_resource_group.test.name}" - app_service_plan_id = "${azurerm_app_service_plan.test.id}" - storage_connection_string = "${azurerm_storage_account.test.primary_connection_string}" + name = "acctestFA-%d" + location = "${azurerm_resource_group.test.location}" + resource_group_name = "${azurerm_resource_group.test.name}" + app_service_plan_id = "${azurerm_app_service_plan.test.id}" + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger, data.RandomString, data.RandomInteger, data.RandomInteger) } diff --git a/azurerm/internal/services/web/resource_arm_function_app.go b/azurerm/internal/services/web/resource_arm_function_app.go index 01f06c4295cc4..8819d5b645ec4 100644 --- a/azurerm/internal/services/web/resource_arm_function_app.go +++ b/azurerm/internal/services/web/resource_arm_function_app.go @@ -16,6 +16,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" azSchema "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" @@ -76,11 +77,35 @@ func resourceArmFunctionApp() *schema.Resource { Default: "~1", }, + // TODO remove this in 3.0 "storage_connection_string": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Sensitive: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + Sensitive: true, + Deprecated: "Deprecated in favor of `storage_account_name` and `storage_account_access_key`", + ConflictsWith: []string{"storage_account_name", "storage_account_access_key"}, + }, + + "storage_account_name": { + Type: schema.TypeString, + // Required: true, // Uncomment this in 3.0 + Optional: true, + Computed: true, // Remove this in 3.0 + ForceNew: true, + ValidateFunc: storage.ValidateArmStorageAccountName, + ConflictsWith: []string{"storage_connection_string"}, + }, + + "storage_account_access_key": { + Type: schema.TypeString, + Optional: true, + Computed: true, // Remove this in 3.0 + // Required: true, // Uncomment this in 3.0 + Sensitive: true, + ValidateFunc: validation.NoZeroValues, + ConflictsWith: []string{"storage_connection_string"}, }, "app_settings": { @@ -286,6 +311,7 @@ func resourceArmFunctionApp() *schema.Resource { func resourceArmFunctionAppCreate(d *schema.ResourceData, meta interface{}) error { client := meta.(*clients.Client).Web.AppServicesClient + endpointSuffix := meta.(*clients.Client).Account.Environment.StorageEndpointSuffix ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -340,7 +366,10 @@ func resourceArmFunctionAppCreate(d *schema.ResourceData, meta interface{}) erro return err } - basicAppSettings := getBasicFunctionAppAppSettings(d, appServiceTier) + basicAppSettings, err := getBasicFunctionAppAppSettings(d, appServiceTier, endpointSuffix) + if err != nil { + return err + } siteConfig, err := expandFunctionAppSiteConfig(d) if err != nil { @@ -405,6 +434,7 @@ func resourceArmFunctionAppCreate(d *schema.ResourceData, meta interface{}) erro func resourceArmFunctionAppUpdate(d *schema.ResourceData, meta interface{}) error { client := meta.(*clients.Client).Web.AppServicesClient + endpointSuffix := meta.(*clients.Client).Account.Environment.StorageEndpointSuffix ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -429,11 +459,15 @@ func resourceArmFunctionAppUpdate(d *schema.ResourceData, meta interface{}) erro t := d.Get("tags").(map[string]interface{}) appServiceTier, err := getFunctionAppServiceTier(ctx, appServicePlanID, meta) + if err != nil { + return err + } + basicAppSettings, err := getBasicFunctionAppAppSettings(d, appServiceTier, endpointSuffix) if err != nil { return err } - basicAppSettings := getBasicFunctionAppAppSettings(d, appServiceTier) + siteConfig, err := expandFunctionAppSiteConfig(d) if err != nil { return fmt.Errorf("Error expanding `site_config` for Function App %q (Resource Group %q): %s", id.Name, id.ResourceGroup, err) @@ -470,7 +504,10 @@ func resourceArmFunctionAppUpdate(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("Error waiting for update of Function App %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) } - appSettings := expandFunctionAppAppSettings(d, appServiceTier) + appSettings, err := expandFunctionAppAppSettings(d, appServiceTier, endpointSuffix) + if err != nil { + return err + } settings := web.StringDictionary{ Properties: appSettings, } @@ -598,7 +635,26 @@ func resourceArmFunctionAppRead(d *schema.ResourceData, meta interface{}) error appSettings := flattenAppServiceAppSettings(appSettingsResp.Properties) - d.Set("storage_connection_string", appSettings["AzureWebJobsStorage"]) + connectionString := appSettings["AzureWebJobsStorage"] + d.Set("storage_connection_string", connectionString) + + // This teases out the necessary attributes from the storage connection string + connectionStringParts := strings.Split(connectionString, ";") + for _, part := range connectionStringParts { + if strings.HasPrefix(part, "AccountName") { + accountNameParts := strings.Split(part, "AccountName=") + if len(accountNameParts) > 1 { + d.Set("storage_account_name", accountNameParts[1]) + } + } + if strings.HasPrefix(part, "AccountKey") { + accountKeyParts := strings.Split(part, "AccountKey=") + if len(accountKeyParts) > 1 { + d.Set("storage_account_access_key", accountKeyParts[1]) + } + } + } + d.Set("version", appSettings["FUNCTIONS_EXTENSION_VERSION"]) dashboard, ok := appSettings["AzureWebJobsDashboard"] @@ -669,7 +725,7 @@ func resourceArmFunctionAppDelete(d *schema.ResourceData, meta interface{}) erro return nil } -func getBasicFunctionAppAppSettings(d *schema.ResourceData, appServiceTier string) []web.NameValuePair { +func getBasicFunctionAppAppSettings(d *schema.ResourceData, appServiceTier, endpointSuffix string) ([]web.NameValuePair, error) { // TODO: This is a workaround since there are no public Functions API // You may track the API request here: https://github.com/Azure/azure-rest-api-specs/issues/3750 dashboardPropName := "AzureWebJobsDashboard" @@ -678,7 +734,34 @@ func getBasicFunctionAppAppSettings(d *schema.ResourceData, appServiceTier strin contentSharePropName := "WEBSITE_CONTENTSHARE" contentFileConnStringPropName := "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING" - storageConnection := d.Get("storage_connection_string").(string) + // TODO 3.0 - remove this logic for determining which storage account connection string to use + storageConnection := "" + if v, ok := d.GetOk("storage_connection_string"); ok { + storageConnection = v.(string) + } + + storageAccount := "" + if v, ok := d.GetOk("storage_account_name"); ok { + storageAccount = v.(string) + } + + connectionString := "" + if v, ok := d.GetOk("storage_account_access_key"); ok { + connectionString = v.(string) + } + + if storageConnection == "" && storageAccount == "" && connectionString == "" { + return nil, fmt.Errorf("one of `storage_connection_string` or `storage_account_name` and `storage_account_access_key` must be specified") + } + + if (storageAccount == "" && connectionString != "") || (storageAccount != "" && connectionString == "") { + return nil, fmt.Errorf("both `storage_account_name` and `storage_account_access_key` must be specified") + } + + if connectionString != "" && storageAccount != "" { + storageConnection = fmt.Sprintf("DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s;EndpointSuffix=%s", storageAccount, connectionString, endpointSuffix) + } + functionVersion := d.Get("version").(string) contentShare := strings.ToLower(d.Get("name").(string)) + "-content" @@ -701,10 +784,10 @@ func getBasicFunctionAppAppSettings(d *schema.ResourceData, appServiceTier strin // On consumption and premium plans include WEBSITE_CONTENT components if strings.EqualFold(appServiceTier, "dynamic") || strings.EqualFold(appServiceTier, "elasticpremium") { - return append(basicSettings, consumptionSettings...) + return append(basicSettings, consumptionSettings...), nil } - return basicSettings + return basicSettings, nil } func getFunctionAppServiceTier(ctx context.Context, appServicePlanId string, meta interface{}) (string, error) { @@ -729,15 +812,18 @@ func getFunctionAppServiceTier(ctx context.Context, appServicePlanId string, met return "", fmt.Errorf("No `sku` block was returned for App Service Plan ID %q", appServicePlanId) } -func expandFunctionAppAppSettings(d *schema.ResourceData, appServiceTier string) map[string]*string { +func expandFunctionAppAppSettings(d *schema.ResourceData, appServiceTier, endpointSuffix string) (map[string]*string, error) { output := expandAppServiceAppSettings(d) - basicAppSettings := getBasicFunctionAppAppSettings(d, appServiceTier) + basicAppSettings, err := getBasicFunctionAppAppSettings(d, appServiceTier, endpointSuffix) + if err != nil { + return nil, err + } for _, p := range basicAppSettings { output[*p.Name] = p.Value } - return output + return output, nil } func expandFunctionAppSiteConfig(d *schema.ResourceData) (web.SiteConfig, error) { diff --git a/azurerm/internal/services/web/tests/resource_arm_function_app_test.go b/azurerm/internal/services/web/tests/resource_arm_function_app_test.go index 205a0af9a642d..6e11f49c4a564 100644 --- a/azurerm/internal/services/web/tests/resource_arm_function_app_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_function_app_test.go @@ -3,6 +3,7 @@ package tests import ( "fmt" "os" + "regexp" "strings" "testing" @@ -38,6 +39,60 @@ func TestAccAzureRMFunctionApp_basic(t *testing.T) { }) } +// TODO remove in 3.0 +func TestAccAzureRMFunctionApp_deprecatedConnectionString(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_function_app", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMFunctionAppDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMFunctionApp_deprecatedConnectionString(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMFunctionAppExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + +// TODO remove in 3.0 +func TestAccAzureRMFunctionApp_deprecatedConnectionStringMissingError(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_function_app", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMFunctionAppDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMFunctionApp_deprecatedConnectionStringMissingError(data), + ExpectError: regexp.MustCompile("one of `storage_connection_string` or `storage_account_name` and `storage_account_access_key` must be specified"), + }, + }, + }) +} + +// TODO remove in 3.0 +func TestAccAzureRMFunctionApp_deprecatedNeedBothSAAtrributesError(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_function_app", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMFunctionAppDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMFunctionApp_deprecatedConnectionStringBothSpecifiedError(data), + ExpectError: regexp.MustCompile("both `storage_account_name` and `storage_account_access_key` must be specified"), + }, + }, + }) +} + func TestAccAzureRMFunctionApp_requiresImport(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_function_app", "test") resource.ParallelTest(t, resource.TestCase{ @@ -779,6 +834,39 @@ func TestAccAzureRMFunctionApp_manyIpRestrictions(t *testing.T) { }) } +func TestAccAzureRMFunctionApp_updateStorageAccountKey(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_function_app", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMFunctionAppDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMFunctionApp_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMFunctionAppExists(data.ResourceName), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMFunctionApp_updateStorageAccountKey(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMFunctionAppExists(data.ResourceName), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMFunctionApp_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMFunctionAppExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + func testCheckAzureRMFunctionAppDestroy(s *terraform.State) error { client := acceptance.AzureProvider.Meta().(*clients.Client).Web.AppServicesClient ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext @@ -930,11 +1018,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } `, data.RandomInteger, data.Locations.Primary, data.RandomString) } @@ -945,11 +1034,12 @@ func testAccAzureRMFunctionApp_requiresImport(data acceptance.TestData) string { %s resource "azurerm_function_app" "import" { - name = azurerm_function_app.test.name - location = azurerm_function_app.test.location - resource_group_name = azurerm_function_app.test.resource_group_name - app_service_plan_id = azurerm_function_app.test.app_service_plan_id - storage_connection_string = azurerm_function_app.test.storage_connection_string + name = azurerm_function_app.test.name + location = azurerm_function_app.test.location + resource_group_name = azurerm_function_app.test.resource_group_name + app_service_plan_id = azurerm_function_app.test.app_service_plan_id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } `, template) } @@ -985,11 +1075,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key tags = { environment = "production" @@ -1029,11 +1120,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key tags = { environment = "production" @@ -1074,12 +1166,13 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - version = "%[4]s" - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + version = "%[4]s" + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } `, data.RandomInteger, data.Locations.Primary, data.RandomString, version) } @@ -1115,11 +1208,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key app_settings = { "hello" = "world" @@ -1159,11 +1253,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { always_on = true @@ -1206,13 +1301,14 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - version = "~2" - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string - os_type = "linux" + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + version = "~2" + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key + os_type = "linux" site_config { linux_fx_version = "DOCKER|(golang:latest)" @@ -1252,11 +1348,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key connection_string { name = "Example" @@ -1298,11 +1395,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key app_settings = { "hello" = "world" @@ -1349,12 +1447,13 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - version = "~2" - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + version = "~2" + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key app_settings = { "hello" = "world" @@ -1402,12 +1501,13 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - version = "~2" - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + version = "~2" + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key app_settings = { "hello" = "world" @@ -1458,11 +1558,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { use_32_bit_worker_process = false @@ -1502,12 +1603,13 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string - https_only = true + name = "acctest-%d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key + https_only = true } `, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger, data.RandomInteger) } @@ -1544,12 +1646,13 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string - daily_memory_time_quota = %d + name = "acctest-%d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key + daily_memory_time_quota = %d } `, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger, data.RandomInteger, dailyMemoryTimeQuota) } @@ -1586,11 +1689,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } `, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger, data.RandomInteger) } @@ -1627,11 +1731,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%d-FuncWithUppercase" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%d-FuncWithUppercase" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } `, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger, data.RandomInteger) } @@ -1667,11 +1772,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key identity { type = "SystemAssigned" @@ -1717,11 +1823,12 @@ resource "azurerm_user_assigned_identity" "first" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key identity { type = "UserAssigned" @@ -1774,11 +1881,12 @@ resource "azurerm_user_assigned_identity" "second" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key identity { type = "UserAssigned" @@ -1819,12 +1927,13 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string - enable_builtin_logging = false + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key + enable_builtin_logging = false } `, data.RandomInteger, data.Locations.Primary, data.RandomString) } @@ -1860,11 +1969,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key auth_settings { enabled = true @@ -1926,11 +2036,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%[1]d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { cors { @@ -1979,11 +2090,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { http2_enabled = true @@ -2023,11 +2135,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { min_tls_version = "1.2" @@ -2067,11 +2180,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { ftps_state = "AllAllowed" @@ -2156,11 +2270,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { ip_restriction { @@ -2216,11 +2331,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { ip_restriction { @@ -2262,11 +2378,12 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { ip_restriction { @@ -2320,15 +2437,176 @@ resource "azurerm_app_service_plan" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%d-func" + name = "acctest-%d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key + + site_config { + ip_restriction = [] + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger, data.RandomInteger) +} + +func testAccAzureRMFunctionApp_deprecatedConnectionString(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_storage_account" "test" { + name = "acctestsa%[3]s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" +} + +resource "azurerm_app_service_plan" "test" { + name = "acctestASP-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + sku { + tier = "Standard" + size = "S1" + } +} + +resource "azurerm_function_app" "test" { + name = "acctest-%[1]d-func" location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name app_service_plan_id = azurerm_app_service_plan.test.id storage_connection_string = azurerm_storage_account.test.primary_connection_string +} +`, data.RandomInteger, data.Locations.Primary, data.RandomString) +} - site_config { - ip_restriction = [] +func testAccAzureRMFunctionApp_deprecatedConnectionStringMissingError(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_storage_account" "test" { + name = "acctestsa%[3]s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" +} + +resource "azurerm_app_service_plan" "test" { + name = "acctestASP-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + sku { + tier = "Standard" + size = "S1" } } -`, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger, data.RandomInteger) + +resource "azurerm_function_app" "test" { + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id +} +`, data.RandomInteger, data.Locations.Primary, data.RandomString) +} + +func testAccAzureRMFunctionApp_deprecatedConnectionStringBothSpecifiedError(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_storage_account" "test" { + name = "acctestsa%[3]s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" +} + +resource "azurerm_app_service_plan" "test" { + name = "acctestASP-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + sku { + tier = "Standard" + size = "S1" + } +} + +resource "azurerm_function_app" "test" { + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name +} +`, data.RandomInteger, data.Locations.Primary, data.RandomString) +} + +func testAccAzureRMFunctionApp_updateStorageAccountKey(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_storage_account" "test" { + name = "acctestsa%[3]s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" +} + +resource "azurerm_app_service_plan" "test" { + name = "acctestASP-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + sku { + tier = "Standard" + size = "S1" + } +} + +resource "azurerm_function_app" "test" { + name = "acctest-%[1]d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.secondary_access_key +} +`, data.RandomInteger, data.Locations.Primary, data.RandomString) } diff --git a/website/docs/r/function_app.html.markdown b/website/docs/r/function_app.html.markdown index 4aee16b7c43e8..cb4600689d528 100644 --- a/website/docs/r/function_app.html.markdown +++ b/website/docs/r/function_app.html.markdown @@ -39,11 +39,12 @@ resource "azurerm_app_service_plan" "example" { } resource "azurerm_function_app" "example" { - name = "test-azure-functions" - location = azurerm_resource_group.example.location - resource_group_name = azurerm_resource_group.example.name - app_service_plan_id = azurerm_app_service_plan.example.id - storage_connection_string = azurerm_storage_account.example.primary_connection_string + name = "test-azure-functions" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + app_service_plan_id = azurerm_app_service_plan.example.id + storage_account_name = azurerm_storage_account.test.id + storage_account_access_key = azurerm_storage_account.test.primary_access_key } ``` ## Example Usage (in a Consumption Plan) @@ -75,11 +76,12 @@ resource "azurerm_app_service_plan" "example" { } resource "azurerm_function_app" "example" { - name = "test-azure-functions" - location = azurerm_resource_group.example.location - resource_group_name = azurerm_resource_group.example.name - app_service_plan_id = azurerm_app_service_plan.example.id - storage_connection_string = azurerm_storage_account.example.primary_connection_string + name = "test-azure-functions" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + app_service_plan_id = azurerm_app_service_plan.example.id + storage_account_name = azurerm_storage_account.test.id + storage_account_access_key = azurerm_storage_account.test.primary_access_key } ``` @@ -95,7 +97,9 @@ The following arguments are supported: * `app_service_plan_id` - (Required) The ID of the App Service Plan within which to create this Function App. -* `storage_connection_string` - (Required) The connection string of the backend storage account which will be used by this Function App (such as the dashboard, logs). +* `storage_account_name` - (Required) The backend storage account name which will be used by this Function App (such as the dashboard, logs). + +* `storage_account_access_key` - (Required) The access key which will be used to access the backend storage account for the Function App. * `app_settings` - (Optional) A key-value pair of App Settings. From 418c381414f53487b1541218a6fbc2291f7c27ab Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Wed, 22 Apr 2020 08:43:02 -0700 Subject: [PATCH 012/223] update for #6304 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92d7f23ebb2eb..65fa9235d5082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ IMPROVEMENTS: * dependencies: updating the fork of `github.com/Azure/go-autorest` [GH-6509] * Data Source: `app_service_environment` - export the `location` property [GH-6538] * `azurerm_cosmosdb_mongo_collection` - support for the `index` and `system_index` properties [GH-6426] +* `azurerm_function_app` - Added `storage_account_id` and `storage_account_access_key` [GH-6304] * `azurerm_kubernetes_cluster` - deprecating `private_link_enabled` in favour of `private_cluster_enabled ` [GH-6431] * `azurerm_postgres_server` - support for the `create_mode` property allowing for creation of replicas, point in time restores, and geo restors [GH-6459] * `azurerm_postgres_server` - support for the `infrastructure_encryption_enabled`, `public_network_access_enabled`, and `ssl_minimal_tls_version_enforced`, properties [GH-6459] From 134823a2b033f90b7931ca987fc67c920d822426 Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Wed, 22 Apr 2020 08:46:27 -0700 Subject: [PATCH 013/223] `azurerm_iothub_dps` - fix crash when path isn't cased correctly #6570 --- azurerm/internal/services/iothub/resource_arm_iothub_dps.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/azurerm/internal/services/iothub/resource_arm_iothub_dps.go b/azurerm/internal/services/iothub/resource_arm_iothub_dps.go index b475b62120a71..e8b60604cd322 100644 --- a/azurerm/internal/services/iothub/resource_arm_iothub_dps.go +++ b/azurerm/internal/services/iothub/resource_arm_iothub_dps.go @@ -219,6 +219,10 @@ func resourceArmIotHubDPSRead(d *schema.ResourceData, meta interface{}) error { } resourceGroup := id.ResourceGroup name := id.Path["provisioningServices"] + // the name path can use the ProvisioningServices in older iterations + if name == "" { + name = id.Path["ProvisioningServices"] + } resp, err := client.Get(ctx, name, resourceGroup) if err != nil { From 06ed60a5deaa8ad27c0eb16b0635a982f3ac1024 Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Wed, 22 Apr 2020 08:47:11 -0700 Subject: [PATCH 014/223] Update for #6570 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65fa9235d5082..eec7841aaa106 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ BUG FIXES: * `azurerm_application_gateway` - prevent panic by disallowing empty values for `backend_address_pool.#.fqdns` [GH-6549] * `azurerm_cdn_endpoint` - `origin_host_header` is now required [GH-6550] * `azurerm_cdn_endpoint` - setting the `request_header_condition` block [GH-6541] +* `azurerm_iothub_dps` - fix crash when path isn't cased correctly [GH-6570] * `azurerm_postgres_server` - the `storage_mb` is no optional when `auto_grow` is enabled [GH-6459] * `azurerm_virtual_network_gateway` - per api requirements, `public_ip_address_id` is required [GH-6548] From 1b52ecf6fd6f0e4914e293ecd916fa781866b9a6 Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Wed, 22 Apr 2020 08:47:38 -0700 Subject: [PATCH 015/223] `azurerm_linux_virtual_machine_scale_set` - fixes crash with `boot_diagnositics` #6569 --- azurerm/internal/services/compute/shared_schema.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azurerm/internal/services/compute/shared_schema.go b/azurerm/internal/services/compute/shared_schema.go index d9b70eb28d8f0..bc0e0e3cef9b4 100644 --- a/azurerm/internal/services/compute/shared_schema.go +++ b/azurerm/internal/services/compute/shared_schema.go @@ -113,7 +113,7 @@ func bootDiagnosticsSchema() *schema.Schema { } func expandBootDiagnostics(input []interface{}) *compute.DiagnosticsProfile { - if len(input) == 0 { + if len(input) == 0 || input[0] == nil { return &compute.DiagnosticsProfile{ BootDiagnostics: &compute.BootDiagnostics{ Enabled: utils.Bool(false), From 60f23e09ee823cb92bcd267a444057e48047537d Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Wed, 22 Apr 2020 08:48:12 -0700 Subject: [PATCH 016/223] Update for #6569 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eec7841aaa106..b915d24b27805 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ BUG FIXES: * `azurerm_cdn_endpoint` - `origin_host_header` is now required [GH-6550] * `azurerm_cdn_endpoint` - setting the `request_header_condition` block [GH-6541] * `azurerm_iothub_dps` - fix crash when path isn't cased correctly [GH-6570] +* `azurerm_linux_virtual_machine_scale_set` - fixes crash with `boot_diagnositics` [GH-6569] * `azurerm_postgres_server` - the `storage_mb` is no optional when `auto_grow` is enabled [GH-6459] * `azurerm_virtual_network_gateway` - per api requirements, `public_ip_address_id` is required [GH-6548] From 8786915e48c5bf9832ce1e7a30dbf8c107929b96 Mon Sep 17 00:00:00 2001 From: kt Date: Wed, 22 Apr 2020 09:54:22 -0700 Subject: [PATCH 017/223] provider: upgrade API Management to 2019-12-01 (#6479) unblocks #2613 #5769 --- azurerm/helpers/azure/api_management.go | 2 +- .../services/apimanagement/client/client.go | 12 +- .../data_source_api_management.go | 16 +- .../data_source_api_management_api.go | 8 +- ...a_source_api_management_api_version_set.go | 6 +- .../data_source_api_management_group.go | 2 +- .../data_source_api_management_product.go | 4 +- .../data_source_api_management_user.go | 2 +- .../migration/management_property.go | 59 + .../services/apimanagement/registration.go | 1 + .../resource_arm_api_management.go | 99 +- .../resource_arm_api_management_api.go | 32 +- ...source_arm_api_management_api_operation.go | 18 +- ...arm_api_management_api_operation_policy.go | 28 +- .../resource_arm_api_management_api_policy.go | 28 +- .../resource_arm_api_management_api_schema.go | 14 +- ...urce_arm_api_management_api_version_set.go | 12 +- ...arm_api_management_authorization_server.go | 22 +- .../resource_arm_api_management_backend.go | 20 +- ...resource_arm_api_management_certificate.go | 12 +- .../resource_arm_api_management_diagnostic.go | 26 +- .../resource_arm_api_management_group.go | 12 +- .../resource_arm_api_management_group_user.go | 8 +- ...rm_api_management_identity_provider_aad.go | 16 +- ...i_management_identity_provider_facebook.go | 16 +- ...api_management_identity_provider_google.go | 16 +- ..._management_identity_provider_microsoft.go | 16 +- ...pi_management_identity_provider_twitter.go | 16 +- .../resource_arm_api_management_logger.go | 18 +- ...resource_arm_api_management_named_value.go | 180 + ..._api_management_openid_connect_provider.go | 12 +- .../resource_arm_api_management_product.go | 12 +- ...resource_arm_api_management_product_api.go | 8 +- ...source_arm_api_management_product_group.go | 8 +- ...ource_arm_api_management_product_policy.go | 28 +- .../resource_arm_api_management_property.go | 43 +- ...esource_arm_api_management_subscription.go | 31 +- .../resource_arm_api_management_user.go | 12 +- ...pi_management_api_operation_policy_test.go | 5 +- ...urce_arm_api_management_api_policy_test.go | 5 +- ...pi_management_authorization_server_test.go | 2 +- ...i_management_identity_provider_aad_test.go | 2 +- ...agement_identity_provider_facebook_test.go | 2 +- ...anagement_identity_provider_google_test.go | 2 +- ...gement_identity_provider_microsoft_test.go | 2 +- ...nagement_identity_provider_twitter_test.go | 2 +- ...rce_arm_api_management_named_value_test.go | 190 + ..._arm_api_management_product_policy_test.go | 5 +- ...source_arm_api_management_property_test.go | 7 +- ...ce_arm_api_management_subscription_test.go | 8 - .../apimanagement/apidiagnosticlogger.go | 500 -- .../apimanagement/diagnosticlogger.go | 476 -- .../apimanagement/api.go | 106 +- .../apimanagement/apidiagnostic.go | 83 +- .../apimanagement/apiexport.go | 2 +- .../apimanagement/apiissue.go | 81 +- .../apimanagement/apiissueattachment.go | 42 +- .../apimanagement/apiissuecomment.go | 40 +- .../apimanagement/apioperation.go | 54 +- .../apimanagement/apioperationpolicy.go | 39 +- .../apimanagement/apipolicy.go | 24 +- .../apimanagement/apiproduct.go | 11 +- .../apimanagement/apirelease.go | 142 +- .../apimanagement/apirevision.go} | 84 +- .../apimanagement/apischema.go | 88 +- .../apimanagement/apitagdescription.go} | 249 +- .../apimanagement/apiversionset.go | 45 +- .../apimanagement/authorizationserver.go | 120 +- .../apimanagement/backend.go | 137 +- .../apimanagement/cache.go} | 284 +- .../apimanagement/certificate.go | 30 +- .../apimanagement/client.go | 2 +- .../apimanagement/delegationsettings.go | 105 +- .../apimanagement/diagnostic.go | 65 +- .../apimanagement/emailtemplate.go | 39 +- .../mgmt/2019-12-01/apimanagement/gateway.go | 931 +++ .../2019-12-01/apimanagement/gatewayapi.go | 473 ++ .../gatewayhostnameconfiguration.go | 566 ++ .../apimanagement/group.go | 48 +- .../apimanagement/groupuser.go | 105 +- .../apimanagement/identityprovider.go | 112 +- .../mgmt/2019-12-01/apimanagement/issue.go | 279 + .../apimanagement/logger.go | 115 +- .../apimanagement/models.go | 5373 +++++++++++------ .../2019-12-01/apimanagement/namedvalue.go | 747 +++ .../apimanagement/networkstatus.go | 4 +- .../apimanagement/notification.go | 8 +- .../notificationrecipientemail.go | 8 +- .../notificationrecipientuser.go | 65 +- .../apimanagement/openidconnectprovider.go | 111 +- .../apimanagement/operation.go | 32 +- .../apimanagement/operations.go | 2 +- .../apimanagement/policy.go | 45 +- .../apimanagement/policydescription.go} | 43 +- .../apimanagement/product.go | 217 +- .../apimanagement/productapi.go | 44 +- .../apimanagement/productgroup.go | 54 +- .../apimanagement/productpolicy.go | 49 +- .../apimanagement/productsubscriptions.go | 24 +- .../apimanagement/quotabycounterkeys.go | 4 +- .../apimanagement/quotabyperiodkeys.go | 4 +- .../apimanagement/region.go} | 48 +- .../apimanagement/reports.go | 194 +- .../apimanagement/service.go | 240 +- .../apimanagement/serviceskus.go | 2 +- .../apimanagement/signinsettings.go | 21 +- .../apimanagement/signupsettings.go | 21 +- .../apimanagement/subscription.go | 154 +- .../apimanagement/tag.go | 242 +- .../apimanagement/tagresource.go | 30 +- .../apimanagement/tenantaccess.go | 183 +- .../apimanagement/tenantaccessgit.go | 93 +- .../apimanagement/tenantconfiguration.go | 17 +- .../apimanagement/user.go | 267 +- .../apimanagement/userconfirmationpassword.go | 132 + .../apimanagement/usergroup.go | 35 +- .../apimanagement/useridentities.go | 27 +- .../apimanagement/usersubscription.go | 42 +- .../apimanagement/version.go | 2 +- vendor/modules.txt | 2 +- website/azurerm.erb | 4 + .../api_management_named_value.html.markdown | 83 + .../r/api_management_property.html.markdown | 2 +- 123 files changed, 10185 insertions(+), 5074 deletions(-) create mode 100644 azurerm/internal/services/apimanagement/migration/management_property.go create mode 100644 azurerm/internal/services/apimanagement/resource_arm_api_management_named_value.go create mode 100644 azurerm/internal/services/apimanagement/tests/resource_arm_api_management_named_value_test.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnosticlogger.go delete mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnosticlogger.go rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/api.go (91%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apidiagnostic.go (87%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apiexport.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apiissue.go (92%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apiissueattachment.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apiissuecomment.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apioperation.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apioperationpolicy.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apipolicy.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apiproduct.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apirelease.go (82%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01/apimanagement/apirevisions.go => 2019-12-01/apimanagement/apirevision.go} (60%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apischema.go (89%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01/apimanagement/tagdescription.go => 2019-12-01/apimanagement/apitagdescription.go} (58%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/apiversionset.go (93%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/authorizationserver.go (85%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/backend.go (87%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01/apimanagement/property.go => 2019-12-01/apimanagement/cache.go} (57%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/certificate.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/client.go (98%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/delegationsettings.go (79%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/diagnostic.go (86%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/emailtemplate.go (94%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gateway.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayapi.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayhostnameconfiguration.go rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/group.go (94%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/groupuser.go (83%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/identityprovider.go (85%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/issue.go rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/logger.go (86%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/models.go (82%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/namedvalue.go rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/networkstatus.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/notification.go (98%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/notificationrecipientemail.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/notificationrecipientuser.go (88%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/openidconnectprovider.go (86%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/operation.go (84%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/operations.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/policy.go (93%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01/apimanagement/policysnippets.go => 2019-12-01/apimanagement/policydescription.go} (62%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/product.go (76%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/productapi.go (93%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/productgroup.go (91%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/productpolicy.go (94%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/productsubscriptions.go (88%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/quotabycounterkeys.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/quotabyperiodkeys.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01/apimanagement/regions.go => 2019-12-01/apimanagement/region.go} (66%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/reports.go (81%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/service.go (82%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/serviceskus.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/signinsettings.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/signupsettings.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/subscription.go (85%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/tag.go (92%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/tagresource.go (85%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/tenantaccess.go (68%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/tenantaccessgit.go (76%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/tenantconfiguration.go (94%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/user.go (75%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/userconfirmationpassword.go rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/usergroup.go (82%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/useridentities.go (87%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/usersubscription.go (79%) rename vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/{2018-01-01 => 2019-12-01}/apimanagement/version.go (99%) create mode 100644 website/docs/r/api_management_named_value.html.markdown diff --git a/azurerm/helpers/azure/api_management.go b/azurerm/helpers/azure/api_management.go index b693e49feb213..007cfc2cf65d8 100644 --- a/azurerm/helpers/azure/api_management.go +++ b/azurerm/helpers/azure/api_management.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" diff --git a/azurerm/internal/services/apimanagement/client/client.go b/azurerm/internal/services/apimanagement/client/client.go index 500d7f31f6f70..736c6dcfba7df 100644 --- a/azurerm/internal/services/apimanagement/client/client.go +++ b/azurerm/internal/services/apimanagement/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" ) @@ -20,13 +20,13 @@ type Client struct { GroupUsersClient *apimanagement.GroupUserClient IdentityProviderClient *apimanagement.IdentityProviderClient LoggerClient *apimanagement.LoggerClient + NamedValueClient *apimanagement.NamedValueClient OpenIdConnectClient *apimanagement.OpenIDConnectProviderClient PolicyClient *apimanagement.PolicyClient ProductsClient *apimanagement.ProductClient ProductApisClient *apimanagement.ProductAPIClient ProductGroupsClient *apimanagement.ProductGroupClient ProductPoliciesClient *apimanagement.ProductPolicyClient - PropertyClient *apimanagement.PropertyClient ServiceClient *apimanagement.ServiceClient SignInClient *apimanagement.SignInSettingsClient SignUpClient *apimanagement.SignUpSettingsClient @@ -74,6 +74,9 @@ func NewClient(o *common.ClientOptions) *Client { identityProviderClient := apimanagement.NewIdentityProviderClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&identityProviderClient.Client, o.ResourceManagerAuthorizer) + namedValueClient := apimanagement.NewNamedValueClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + o.ConfigureClient(&namedValueClient.Client, o.ResourceManagerAuthorizer) + loggerClient := apimanagement.NewLoggerClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&loggerClient.Client, o.ResourceManagerAuthorizer) @@ -95,9 +98,6 @@ func NewClient(o *common.ClientOptions) *Client { productPoliciesClient := apimanagement.NewProductPolicyClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&productPoliciesClient.Client, o.ResourceManagerAuthorizer) - propertyClient := apimanagement.NewPropertyClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) - o.ConfigureClient(&propertyClient.Client, o.ResourceManagerAuthorizer) - serviceClient := apimanagement.NewServiceClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&serviceClient.Client, o.ResourceManagerAuthorizer) @@ -128,13 +128,13 @@ func NewClient(o *common.ClientOptions) *Client { GroupUsersClient: &groupUsersClient, IdentityProviderClient: &identityProviderClient, LoggerClient: &loggerClient, + NamedValueClient: &namedValueClient, OpenIdConnectClient: &openIdConnectClient, PolicyClient: &policyClient, ProductsClient: &productsClient, ProductApisClient: &productApisClient, ProductGroupsClient: &productGroupsClient, ProductPoliciesClient: &productPoliciesClient, - PropertyClient: &propertyClient, ServiceClient: &serviceClient, SignInClient: &signInClient, SignUpClient: &signUpClient, diff --git a/azurerm/internal/services/apimanagement/data_source_api_management.go b/azurerm/internal/services/apimanagement/data_source_api_management.go index 329c8d0ff5b98..b9c8d6cc5d5c6 100644 --- a/azurerm/internal/services/apimanagement/data_source_api_management.go +++ b/azurerm/internal/services/apimanagement/data_source_api_management.go @@ -5,7 +5,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -161,7 +161,7 @@ func dataSourceApiManagementRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("API Management Service %q (Resource Group %q) was not found", name, resourceGroup) } - return fmt.Errorf("Error retrieving API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("retrieving API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } d.SetId(*resp.ID) @@ -185,11 +185,11 @@ func dataSourceApiManagementRead(d *schema.ResourceData, meta interface{}) error d.Set("public_ip_addresses", props.PublicIPAddresses) if err := d.Set("hostname_configuration", flattenDataSourceApiManagementHostnameConfigurations(props.HostnameConfigurations)); err != nil { - return fmt.Errorf("Error setting `hostname_configuration`: %+v", err) + return fmt.Errorf("setting `hostname_configuration`: %+v", err) } if err := d.Set("additional_location", flattenDataSourceApiManagementAdditionalLocations(props.AdditionalLocations)); err != nil { - return fmt.Errorf("Error setting `additional_location`: %+v", err) + return fmt.Errorf("setting `additional_location`: %+v", err) } } @@ -225,20 +225,20 @@ func flattenDataSourceApiManagementHostnameConfigurations(input *[]apimanagement } switch strings.ToLower(string(config.Type)) { - case strings.ToLower(string(apimanagement.Proxy)): + case strings.ToLower(string(apimanagement.HostnameTypeProxy)): // only set SSL binding for proxy types if config.DefaultSslBinding != nil { output["default_ssl_binding"] = *config.DefaultSslBinding } proxyResults = append(proxyResults, output) - case strings.ToLower(string(apimanagement.Management)): + case strings.ToLower(string(apimanagement.HostnameTypeManagement)): managementResults = append(managementResults, output) - case strings.ToLower(string(apimanagement.Portal)): + case strings.ToLower(string(apimanagement.HostnameTypePortal)): portalResults = append(portalResults, output) - case strings.ToLower(string(apimanagement.Scm)): + case strings.ToLower(string(apimanagement.HostnameTypeScm)): scmResults = append(scmResults, output) } } diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_api.go b/azurerm/internal/services/apimanagement/data_source_api_management_api.go index 19822f9e9f3a5..122f46e7fe70f 100644 --- a/azurerm/internal/services/apimanagement/data_source_api_management_api.go +++ b/azurerm/internal/services/apimanagement/data_source_api_management_api.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -129,7 +129,7 @@ func dataSourceApiManagementApiRead(d *schema.ResourceData, meta interface{}) er return fmt.Errorf("API %q Revision %q (API Management Service %q / Resource Group %q) does not exist!", name, revision, serviceName, resourceGroup) } - return fmt.Errorf("Error retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) } d.SetId(*resp.ID) @@ -151,11 +151,11 @@ func dataSourceApiManagementApiRead(d *schema.ResourceData, meta interface{}) er d.Set("version_set_id", props.APIVersionSetID) if err := d.Set("protocols", flattenApiManagementApiDataSourceProtocols(props.Protocols)); err != nil { - return fmt.Errorf("Error setting `protocols`: %s", err) + return fmt.Errorf("setting `protocols`: %s", err) } if err := d.Set("subscription_key_parameter_names", flattenApiManagementApiDataSourceSubscriptionKeyParamNames(props.SubscriptionKeyParameterNames)); err != nil { - return fmt.Errorf("Error setting `subscription_key_parameter_names`: %+v", err) + return fmt.Errorf("setting `subscription_key_parameter_names`: %+v", err) } } diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_api_version_set.go b/azurerm/internal/services/apimanagement/data_source_api_management_api_version_set.go index 1b2229bfc331d..f58c2b67a6994 100644 --- a/azurerm/internal/services/apimanagement/data_source_api_management_api_version_set.go +++ b/azurerm/internal/services/apimanagement/data_source_api_management_api_version_set.go @@ -66,14 +66,14 @@ func dataSourceApiManagementApiVersionSetRead(d *schema.ResourceData, meta inter resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if utils.ResponseWasNotFound(resp.Response) { - return fmt.Errorf("Error: API Version Set %q (API Management Service %q / Resource Group %q) does not exist!", name, serviceName, resourceGroup) + return fmt.Errorf(": API Version Set %q (API Management Service %q / Resource Group %q) does not exist!", name, serviceName, resourceGroup) } - return fmt.Errorf("Error reading API Version Set %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("reading API Version Set %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } if resp.ID == nil || *resp.ID == "" { - return fmt.Errorf("Error retrieving API Version Set %q (API Management Service %q /Resource Group %q): ID was nil or empty", name, serviceName, resourceGroup) + return fmt.Errorf("retrieving API Version Set %q (API Management Service %q /Resource Group %q): ID was nil or empty", name, serviceName, resourceGroup) } d.SetId(*resp.ID) diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_group.go b/azurerm/internal/services/apimanagement/data_source_api_management_group.go index 4b21b69139988..d0dbf410f8e6b 100644 --- a/azurerm/internal/services/apimanagement/data_source_api_management_group.go +++ b/azurerm/internal/services/apimanagement/data_source_api_management_group.go @@ -67,7 +67,7 @@ func dataSourceApiManagementGroupRead(d *schema.ResourceData, meta interface{}) return nil } - return fmt.Errorf("Error making Read request for Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } d.SetId(*resp.ID) diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_product.go b/azurerm/internal/services/apimanagement/data_source_api_management_product.go index be1558d436f8d..81786c4c3934d 100644 --- a/azurerm/internal/services/apimanagement/data_source_api_management_product.go +++ b/azurerm/internal/services/apimanagement/data_source_api_management_product.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" @@ -79,7 +79,7 @@ func dataSourceApiManagementProductRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("Product %q was not found in API Management Service %q / Resource Group %q", productId, serviceName, resourceGroup) } - return fmt.Errorf("Error making Read request on Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) + return fmt.Errorf("making Read request on Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) } d.SetId(*resp.ID) diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_user.go b/azurerm/internal/services/apimanagement/data_source_api_management_user.go index dae4e68bfdde9..d4ec762cc02c1 100644 --- a/azurerm/internal/services/apimanagement/data_source_api_management_user.go +++ b/azurerm/internal/services/apimanagement/data_source_api_management_user.go @@ -69,7 +69,7 @@ func dataSourceArmApiManagementUserRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("User %q was not found in API Management Service %q / Resource Group %q", userId, serviceName, resourceGroup) } - return fmt.Errorf("Error making Read request on User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) + return fmt.Errorf("making Read request on User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) } d.SetId(*resp.ID) diff --git a/azurerm/internal/services/apimanagement/migration/management_property.go b/azurerm/internal/services/apimanagement/migration/management_property.go new file mode 100644 index 0000000000000..29c8f1289ed5f --- /dev/null +++ b/azurerm/internal/services/apimanagement/migration/management_property.go @@ -0,0 +1,59 @@ +package migration + +import ( + "log" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" +) + +func APIManagementApiPropertyUpgradeV0Schema() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": azure.SchemaApiManagementChildName(), + + "resource_group_name": azure.SchemaResourceGroupName(), + + "api_management_name": azure.SchemaApiManagementName(), + + "display_name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "value": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "secret": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + + "tags": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func APIManagementApiPropertyUpgradeV0ToV1(rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { + oldId := rawState["id"].(string) + newId := strings.Replace(rawState["id"].(string), "/properties/", "/namedValues/", 1) + + log.Printf("[DEBUG] Updating ID from %q to %q", oldId, newId) + + rawState["id"] = newId + + return rawState, nil +} diff --git a/azurerm/internal/services/apimanagement/registration.go b/azurerm/internal/services/apimanagement/registration.go index 40c70ea6b70d2..c3edea311cf6b 100644 --- a/azurerm/internal/services/apimanagement/registration.go +++ b/azurerm/internal/services/apimanagement/registration.go @@ -52,6 +52,7 @@ func (r Registration) SupportedResources() map[string]*schema.Resource { "azurerm_api_management_identity_provider_microsoft": resourceArmApiManagementIdentityProviderMicrosoft(), "azurerm_api_management_identity_provider_twitter": resourceArmApiManagementIdentityProviderTwitter(), "azurerm_api_management_logger": resourceArmApiManagementLogger(), + "azurerm_api_management_named_value": resourceArmApiManagementNamedValue(), "azurerm_api_management_openid_connect_provider": resourceArmApiManagementOpenIDConnectProvider(), "azurerm_api_management_product": resourceArmApiManagementProduct(), "azurerm_api_management_product_api": resourceArmApiManagementProductApi(), diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management.go b/azurerm/internal/services/apimanagement/resource_arm_api_management.go index 574509b536b7f..f52e5682ee563 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management.go @@ -7,7 +7,8 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" + "github.com/hashicorp/go-azure-helpers/response" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -398,7 +399,7 @@ func resourceArmApiManagementServiceCreateUpdate(d *schema.ResourceData, meta in existing, err := client.Get(ctx, resourceGroup, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing API Management Service %q (Resource Group %q): %s", name, resourceGroup, err) + return fmt.Errorf("checking for presence of existing API Management Service %q (Resource Group %q): %s", name, resourceGroup, err) } } @@ -445,16 +446,16 @@ func resourceArmApiManagementServiceCreateUpdate(d *schema.ResourceData, meta in future, err := client.CreateOrUpdate(ctx, resourceGroup, name, properties) if err != nil { - return fmt.Errorf("Error creating/updating API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("creating/updating API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("Error waiting for creation/update of API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("waiting for creation/update of API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } read, err := client.Get(ctx, resourceGroup, name) if err != nil { - return fmt.Errorf("Error retrieving API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("retrieving API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } if read.ID == nil { @@ -466,15 +467,15 @@ func resourceArmApiManagementServiceCreateUpdate(d *schema.ResourceData, meta in signInSettingsRaw := d.Get("sign_in").([]interface{}) signInSettings := expandApiManagementSignInSettings(signInSettingsRaw) signInClient := meta.(*clients.Client).ApiManagement.SignInClient - if _, err := signInClient.CreateOrUpdate(ctx, resourceGroup, name, signInSettings); err != nil { - return fmt.Errorf("Error setting Sign In settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + if _, err := signInClient.CreateOrUpdate(ctx, resourceGroup, name, signInSettings, ""); err != nil { + return fmt.Errorf(" setting Sign In settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } signUpSettingsRaw := d.Get("sign_up").([]interface{}) signUpSettings := expandApiManagementSignUpSettings(signUpSettingsRaw) signUpClient := meta.(*clients.Client).ApiManagement.SignUpClient - if _, err := signUpClient.CreateOrUpdate(ctx, resourceGroup, name, signUpSettings); err != nil { - return fmt.Errorf("Error setting Sign Up settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + if _, err := signUpClient.CreateOrUpdate(ctx, resourceGroup, name, signUpSettings, ""); err != nil { + return fmt.Errorf(" setting Sign Up settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } policyClient := meta.(*clients.Client).ApiManagement.PolicyClient @@ -488,14 +489,14 @@ func resourceArmApiManagementServiceCreateUpdate(d *schema.ResourceData, meta in // remove the existing policy if resp, err := policyClient.Delete(ctx, resourceGroup, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error removing Policies from API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("removing Policies from API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } } // then add the new one, if it exists if policy != nil { - if _, err := policyClient.CreateOrUpdate(ctx, resourceGroup, name, *policy); err != nil { - return fmt.Errorf("Error setting Policies for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + if _, err := policyClient.CreateOrUpdate(ctx, resourceGroup, name, *policy, ""); err != nil { + return fmt.Errorf(" setting Policies for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } } } @@ -524,26 +525,26 @@ func resourceArmApiManagementServiceRead(d *schema.ResourceData, meta interface{ return nil } - return fmt.Errorf("Error making Read request on API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("making Read request on API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } signInClient := meta.(*clients.Client).ApiManagement.SignInClient signInSettings, err := signInClient.Get(ctx, resourceGroup, name) if err != nil { - return fmt.Errorf("Error retrieving Sign In Settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("retrieving Sign In Settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } signUpClient := meta.(*clients.Client).ApiManagement.SignUpClient signUpSettings, err := signUpClient.Get(ctx, resourceGroup, name) if err != nil { - return fmt.Errorf("Error retrieving Sign Up Settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("retrieving Sign Up Settings for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } policyClient := meta.(*clients.Client).ApiManagement.PolicyClient - policy, err := policyClient.Get(ctx, resourceGroup, name) + policy, err := policyClient.Get(ctx, resourceGroup, name, apimanagement.PolicyExportFormatXML) if err != nil { if !utils.ResponseWasNotFound(policy.Response) { - return fmt.Errorf("Error retrieving Policy for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("retrieving Policy for API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } } @@ -556,7 +557,7 @@ func resourceArmApiManagementServiceRead(d *schema.ResourceData, meta interface{ identity := flattenAzureRmApiManagementMachineIdentity(resp.Identity) if err := d.Set("identity", identity); err != nil { - return fmt.Errorf("Error setting `identity`: %+v", err) + return fmt.Errorf("setting `identity`: %+v", err) } if props := resp.ServiceProperties; props != nil { @@ -571,37 +572,37 @@ func resourceArmApiManagementServiceRead(d *schema.ResourceData, meta interface{ d.Set("public_ip_addresses", props.PublicIPAddresses) if err := d.Set("security", flattenApiManagementSecurityCustomProperties(props.CustomProperties)); err != nil { - return fmt.Errorf("Error setting `security`: %+v", err) + return fmt.Errorf("setting `security`: %+v", err) } if err := d.Set("protocols", flattenApiManagementProtocolsCustomProperties(props.CustomProperties)); err != nil { - return fmt.Errorf("Error setting `protocols`: %+v", err) + return fmt.Errorf("setting `protocols`: %+v", err) } hostnameConfigs := flattenApiManagementHostnameConfigurations(props.HostnameConfigurations, d) if err := d.Set("hostname_configuration", hostnameConfigs); err != nil { - return fmt.Errorf("Error setting `hostname_configuration`: %+v", err) + return fmt.Errorf("setting `hostname_configuration`: %+v", err) } if err := d.Set("additional_location", flattenApiManagementAdditionalLocations(props.AdditionalLocations)); err != nil { - return fmt.Errorf("Error setting `additional_location`: %+v", err) + return fmt.Errorf("setting `additional_location`: %+v", err) } } if err := d.Set("sku_name", flattenApiManagementServiceSkuName(resp.Sku)); err != nil { - return fmt.Errorf("Error setting `sku_name`: %+v", err) + return fmt.Errorf("setting `sku_name`: %+v", err) } if err := d.Set("sign_in", flattenApiManagementSignInSettings(signInSettings)); err != nil { - return fmt.Errorf("Error setting `sign_in`: %+v", err) + return fmt.Errorf("setting `sign_in`: %+v", err) } if err := d.Set("sign_up", flattenApiManagementSignUpSettings(signUpSettings)); err != nil { - return fmt.Errorf("Error setting `sign_up`: %+v", err) + return fmt.Errorf("setting `sign_up`: %+v", err) } if err := d.Set("policy", flattenApiManagementPolicies(d, policy)); err != nil { - return fmt.Errorf("Error setting `policy`: %+v", err) + return fmt.Errorf("setting `policy`: %+v", err) } return tags.FlattenAndSet(d, resp.Tags) @@ -620,10 +621,14 @@ func resourceArmApiManagementServiceDelete(d *schema.ResourceData, meta interfac name := id.Path["service"] log.Printf("[DEBUG] Deleting API Management Service %q (Resource Grouo %q)", name, resourceGroup) - resp, err := client.Delete(ctx, resourceGroup, name) + future, err := client.Delete(ctx, resourceGroup, name) if err != nil { - if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("deleting API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) + } + + if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { + if !response.WasNotFound(future.Response()) { + return fmt.Errorf("waiting for deletion of API Management Service %q (Resource Group %q): %+v", name, resourceGroup, err) } } @@ -640,21 +645,21 @@ func expandAzureRmApiManagementHostnameConfigurations(d *schema.ResourceData) *[ managementVs := hostnameV["management"].([]interface{}) for _, managementV := range managementVs { v := managementV.(map[string]interface{}) - output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.Management) + output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.HostnameTypeManagement) results = append(results, output) } portalVs := hostnameV["portal"].([]interface{}) for _, portalV := range portalVs { v := portalV.(map[string]interface{}) - output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.Portal) + output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.HostnameTypePortal) results = append(results, output) } proxyVs := hostnameV["proxy"].([]interface{}) for _, proxyV := range proxyVs { v := proxyV.(map[string]interface{}) - output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.Proxy) + output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.HostnameTypeProxy) if value, ok := v["default_ssl_binding"]; ok { output.DefaultSslBinding = utils.Bool(value.(bool)) } @@ -664,7 +669,7 @@ func expandAzureRmApiManagementHostnameConfigurations(d *schema.ResourceData) *[ scmVs := hostnameV["scm"].([]interface{}) for _, scmV := range scmVs { v := scmV.(map[string]interface{}) - output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.Scm) + output := expandApiManagementCommonHostnameConfiguration(v, apimanagement.HostnameTypeScm) results = append(results, output) } } @@ -740,20 +745,20 @@ func flattenApiManagementHostnameConfigurations(input *[]apimanagement.HostnameC } switch strings.ToLower(string(config.Type)) { - case strings.ToLower(string(apimanagement.Proxy)): + case strings.ToLower(string(apimanagement.HostnameTypeProxy)): // only set SSL binding for proxy types if config.DefaultSslBinding != nil { output["default_ssl_binding"] = *config.DefaultSslBinding } proxyResults = append(proxyResults, output) - case strings.ToLower(string(apimanagement.Management)): + case strings.ToLower(string(apimanagement.HostnameTypeManagement)): managementResults = append(managementResults, output) - case strings.ToLower(string(apimanagement.Portal)): + case strings.ToLower(string(apimanagement.HostnameTypePortal)): portalResults = append(portalResults, output) - case strings.ToLower(string(apimanagement.Scm)): + case strings.ToLower(string(apimanagement.HostnameTypeScm)): scmResults = append(scmResults, output) } } @@ -848,7 +853,7 @@ func expandAzureRmApiManagementIdentity(d *schema.ResourceData) *apimanagement.S v := vs[0].(map[string]interface{}) identityType := v["type"].(string) return &apimanagement.ServiceIdentity{ - Type: utils.String(identityType), + Type: apimanagement.ApimIdentityType(identityType), } } @@ -859,9 +864,7 @@ func flattenAzureRmApiManagementMachineIdentity(identity *apimanagement.ServiceI result := make(map[string]interface{}) - if identity.Type != nil { - result["type"] = *identity.Type - } + result["type"] = string(identity.Type) if identity.PrincipalID != nil { result["principal_id"] = identity.PrincipalID.String() @@ -1030,7 +1033,7 @@ func parseApiManagementNilableDictionary(input map[string]*string, key string) b val, err := strconv.ParseBool(*v) if err != nil { - log.Printf("Error parsing %q (key %q) as bool: %+v - assuming false", key, *v, err) + log.Printf(" parsing %q (key %q) as bool: %+v - assuming false", key, *v, err) return false } @@ -1151,8 +1154,8 @@ func expandApiManagementPolicies(input []interface{}) (*apimanagement.PolicyCont if xmlContent != "" { return &apimanagement.PolicyContract{ PolicyContractProperties: &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.XML, - PolicyContent: utils.String(xmlContent), + Format: apimanagement.XML, + Value: utils.String(xmlContent), }, }, nil } @@ -1160,8 +1163,8 @@ func expandApiManagementPolicies(input []interface{}) (*apimanagement.PolicyCont if xmlLink != "" { return &apimanagement.PolicyContract{ PolicyContractProperties: &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.XMLLink, - PolicyContent: utils.String(xmlLink), + Format: apimanagement.XMLLink, + Value: utils.String(xmlLink), }, }, nil } @@ -1172,8 +1175,8 @@ func expandApiManagementPolicies(input []interface{}) (*apimanagement.PolicyCont func flattenApiManagementPolicies(d *schema.ResourceData, input apimanagement.PolicyContract) []interface{} { xmlContent := "" if props := input.PolicyContractProperties; props != nil { - if props.PolicyContent != nil { - xmlContent = *props.PolicyContent + if props.Value != nil { + xmlContent = *props.Value } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_api.go index 72bac26ee5566..ea79b207f4be2 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_api.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_api.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -207,14 +207,14 @@ func resourceArmApiManagementApiCreateUpdate(d *schema.ResourceData, meta interf versionSetId := d.Get("version_set_id").(string) if version != "" && versionSetId == "" { - return fmt.Errorf("Error setting `version` without the required `version_set_id`") + return fmt.Errorf("setting `version` without the required `version_set_id`") } if features.ShouldResourcesBeImported() && d.IsNewResource() { existing, err := client.Get(ctx, resourceGroup, serviceName, apiId) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing API %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing API %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -246,12 +246,12 @@ func resourceArmApiManagementApiCreateUpdate(d *schema.ResourceData, meta interf log.Printf("[DEBUG] Importing API Management API %q of type %q", name, contentFormat) apiParams := apimanagement.APICreateOrUpdateParameter{ APICreateOrUpdateProperties: &apimanagement.APICreateOrUpdateProperties{ - APIType: apiType, - SoapAPIType: soapApiType, - ContentFormat: apimanagement.ContentFormat(contentFormat), - ContentValue: utils.String(contentValue), - Path: utils.String(path), - APIVersion: utils.String(version), + APIType: apiType, + SoapAPIType: soapApiType, + Format: apimanagement.ContentFormat(contentFormat), + Value: utils.String(contentValue), + Path: utils.String(path), + APIVersion: utils.String(version), }, } wsdlSelectorVs := importV["wsdl_selector"].([]interface{}) @@ -271,7 +271,7 @@ func resourceArmApiManagementApiCreateUpdate(d *schema.ResourceData, meta interf } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apiId, apiParams, ""); err != nil { - return fmt.Errorf("Error creating/updating API Management API %q (Resource Group %q): %+v", name, resourceGroup, err) + return fmt.Errorf("creating/updating API Management API %q (Resource Group %q): %+v", name, resourceGroup, err) } } @@ -304,12 +304,12 @@ func resourceArmApiManagementApiCreateUpdate(d *schema.ResourceData, meta interf } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apiId, params, ""); err != nil { - return fmt.Errorf("Error creating/updating API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) } read, err := client.Get(ctx, resourceGroup, serviceName, apiId) if err != nil { - return fmt.Errorf("Error retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) } if read.ID == nil { @@ -349,7 +349,7 @@ func resourceArmApiManagementApiRead(d *schema.ResourceData, meta interface{}) e return nil } - return fmt.Errorf("Error retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving API %q / Revision %q (API Management Service %q / Resource Group %q): %+v", name, revision, serviceName, resourceGroup, err) } d.Set("api_management_name", serviceName) @@ -369,11 +369,11 @@ func resourceArmApiManagementApiRead(d *schema.ResourceData, meta interface{}) e d.Set("version_set_id", props.APIVersionSetID) if err := d.Set("protocols", flattenApiManagementApiProtocols(props.Protocols)); err != nil { - return fmt.Errorf("Error setting `protocols`: %s", err) + return fmt.Errorf("setting `protocols`: %s", err) } if err := d.Set("subscription_key_parameter_names", flattenApiManagementApiSubscriptionKeyParamNames(props.SubscriptionKeyParameterNames)); err != nil { - return fmt.Errorf("Error setting `subscription_key_parameter_names`: %+v", err) + return fmt.Errorf("setting `subscription_key_parameter_names`: %+v", err) } } @@ -404,7 +404,7 @@ func resourceArmApiManagementApiDelete(d *schema.ResourceData, meta interface{}) deleteRevisions := utils.Bool(true) if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, "", deleteRevisions); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting API %q / Revision %q (API Management Service %q / Resource Group %q): %s", name, revision, serviceName, resourceGroup, err) + return fmt.Errorf("deleting API %q / Revision %q (API Management Service %q / Resource Group %q): %s", name, revision, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation.go index 8bb615228573c..1a93f71e002dc 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -123,7 +123,7 @@ func resourceArmApiManagementApiOperationCreateUpdate(d *schema.ResourceData, me existing, err := client.Get(ctx, resourceGroup, serviceName, apiId, operationId) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Operation %q (API %q / API Management Service %q / Resource Group %q): %s", operationId, apiId, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Operation %q (API %q / API Management Service %q / Resource Group %q): %s", operationId, apiId, serviceName, resourceGroup, err) } } @@ -165,12 +165,12 @@ func resourceArmApiManagementApiOperationCreateUpdate(d *schema.ResourceData, me } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apiId, operationId, parameters, ""); err != nil { - return fmt.Errorf("Error creating/updating API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apiId, operationId) if err != nil { - return fmt.Errorf("Error retrieving API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) } d.SetId(*resp.ID) @@ -201,7 +201,7 @@ func resourceArmApiManagementApiOperationRead(d *schema.ResourceData, meta inter return nil } - return fmt.Errorf("Error retrieving API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) } d.Set("operation_id", operationId) @@ -217,17 +217,17 @@ func resourceArmApiManagementApiOperationRead(d *schema.ResourceData, meta inter flattenedRequest := flattenApiManagementOperationRequestContract(props.Request) if err := d.Set("request", flattenedRequest); err != nil { - return fmt.Errorf("Error flattening `request`: %+v", err) + return fmt.Errorf("flattening `request`: %+v", err) } flattenedResponse := flattenApiManagementOperationResponseContract(props.Responses) if err := d.Set("response", flattenedResponse); err != nil { - return fmt.Errorf("Error flattening `response`: %+v", err) + return fmt.Errorf("flattening `response`: %+v", err) } flattenedTemplateParams := azure.FlattenApiManagementOperationParameterContract(props.TemplateParameters) if err := d.Set("template_parameter", flattenedTemplateParams); err != nil { - return fmt.Errorf("Error flattening `template_parameter`: %+v", err) + return fmt.Errorf("flattening `template_parameter`: %+v", err) } } @@ -252,7 +252,7 @@ func resourceArmApiManagementApiOperationDelete(d *schema.ResourceData, meta int resp, err := client.Delete(ctx, resourceGroup, serviceName, apiId, operationId, "") if err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) + return fmt.Errorf("deleting API Operation %q (API %q / API Management Service %q / Resource Group %q): %+v", operationId, apiId, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation_policy.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation_policy.go index 64206fa158c43..0992d19f56311 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation_policy.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation_policy.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/suppress" @@ -70,10 +70,10 @@ func resourceArmApiManagementAPIOperationPolicyCreateUpdate(d *schema.ResourceDa operationID := d.Get("operation_id").(string) if features.ShouldResourcesBeImported() && d.IsNewResource() { - existing, err := client.Get(ctx, resourceGroup, serviceName, apiName, operationID) + existing, err := client.Get(ctx, resourceGroup, serviceName, apiName, operationID, apimanagement.PolicyExportFormatXML) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing API Operation Policy (API Management Service %q / API %q / Operation %q / Resource Group %q): %s", serviceName, apiName, operationID, resourceGroup, err) + return fmt.Errorf("checking for presence of existing API Operation Policy (API Management Service %q / API %q / Operation %q / Resource Group %q): %s", serviceName, apiName, operationID, resourceGroup, err) } } @@ -89,15 +89,15 @@ func resourceArmApiManagementAPIOperationPolicyCreateUpdate(d *schema.ResourceDa if xmlContent != "" { parameters.PolicyContractProperties = &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.XML, - PolicyContent: utils.String(xmlContent), + Format: apimanagement.XML, + Value: utils.String(xmlContent), } } if xmlLink != "" { parameters.PolicyContractProperties = &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.XMLLink, - PolicyContent: utils.String(xmlLink), + Format: apimanagement.XMLLink, + Value: utils.String(xmlLink), } } @@ -106,12 +106,12 @@ func resourceArmApiManagementAPIOperationPolicyCreateUpdate(d *schema.ResourceDa } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apiName, operationID, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) + return fmt.Errorf("creating or updating API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) } - resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, operationID) + resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, operationID, apimanagement.PolicyExportFormatXML) if err != nil { - return fmt.Errorf("Error retrieving API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) + return fmt.Errorf("retrieving API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) @@ -135,7 +135,7 @@ func resourceArmApiManagementAPIOperationPolicyRead(d *schema.ResourceData, meta apiName := id.Path["apis"] operationID := id.Path["operations"] - resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, operationID) + resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, operationID, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { log.Printf("[DEBUG] API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q) was not found - removing from state!", resourceGroup, serviceName, apiName, operationID) @@ -143,7 +143,7 @@ func resourceArmApiManagementAPIOperationPolicyRead(d *schema.ResourceData, meta return nil } - return fmt.Errorf("Error making Read request for API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) + return fmt.Errorf("making Read request for API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) } d.Set("resource_group_name", resourceGroup) @@ -154,7 +154,7 @@ func resourceArmApiManagementAPIOperationPolicyRead(d *schema.ResourceData, meta if properties := resp.PolicyContractProperties; properties != nil { // when you submit an `xml_link` to the API, the API downloads this link and stores it as `xml_content` // as such there is no way to set `xml_link` and we'll let Terraform handle it - d.Set("xml_content", properties.PolicyContent) + d.Set("xml_content", properties.Value) } return nil @@ -176,7 +176,7 @@ func resourceArmApiManagementAPIOperationPolicyDelete(d *schema.ResourceData, me if resp, err := client.Delete(ctx, resourceGroup, serviceName, apiName, operationID, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) + return fmt.Errorf("deleting API Operation Policy (Resource Group %q / API Management Service %q / API %q / Operation %q): %+v", resourceGroup, serviceName, apiName, operationID, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_policy.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_policy.go index 25c08754eae93..1ffc2d7fa2fe6 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_policy.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_policy.go @@ -6,7 +6,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" @@ -67,10 +67,10 @@ func resourceArmApiManagementAPIPolicyCreateUpdate(d *schema.ResourceData, meta apiName := d.Get("api_name").(string) if features.ShouldResourcesBeImported() && d.IsNewResource() { - existing, err := client.Get(ctx, resourceGroup, serviceName, apiName) + existing, err := client.Get(ctx, resourceGroup, serviceName, apiName, apimanagement.PolicyExportFormatXML) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing API Policy (API Management Service %q / API %q / Resource Group %q): %s", serviceName, apiName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing API Policy (API Management Service %q / API %q / Resource Group %q): %s", serviceName, apiName, resourceGroup, err) } } @@ -86,8 +86,8 @@ func resourceArmApiManagementAPIPolicyCreateUpdate(d *schema.ResourceData, meta if xmlLink != "" { parameters.PolicyContractProperties = &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.RawxmlLink, - PolicyContent: utils.String(xmlLink), + Format: apimanagement.RawxmlLink, + Value: utils.String(xmlLink), } } else if xmlContent != "" { // this is intentionally an else-if since `xml_content` is computed @@ -98,8 +98,8 @@ func resourceArmApiManagementAPIPolicyCreateUpdate(d *schema.ResourceData, meta } parameters.PolicyContractProperties = &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.Rawxml, - PolicyContent: utils.String(xmlContent), + Format: apimanagement.Rawxml, + Value: utils.String(xmlContent), } } @@ -108,12 +108,12 @@ func resourceArmApiManagementAPIPolicyCreateUpdate(d *schema.ResourceData, meta } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apiName, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) + return fmt.Errorf("creating or updating API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) } - resp, err := client.Get(ctx, resourceGroup, serviceName, apiName) + resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, apimanagement.PolicyExportFormatXML) if err != nil { - return fmt.Errorf("Error retrieving API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) + return fmt.Errorf("retrieving API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) @@ -136,7 +136,7 @@ func resourceArmApiManagementAPIPolicyRead(d *schema.ResourceData, meta interfac serviceName := id.Path["service"] apiName := id.Path["apis"] - resp, err := client.Get(ctx, resourceGroup, serviceName, apiName) + resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { log.Printf("[DEBUG] API Policy (Resource Group %q / API Management Service %q / API %q) was not found - removing from state!", resourceGroup, serviceName, apiName) @@ -144,7 +144,7 @@ func resourceArmApiManagementAPIPolicyRead(d *schema.ResourceData, meta interfac return nil } - return fmt.Errorf("Error making Read request for API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) + return fmt.Errorf("making Read request for API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) } d.Set("resource_group_name", resourceGroup) @@ -153,7 +153,7 @@ func resourceArmApiManagementAPIPolicyRead(d *schema.ResourceData, meta interfac if properties := resp.PolicyContractProperties; properties != nil { policyContent := "" - if pc := properties.PolicyContent; pc != nil { + if pc := properties.Value; pc != nil { policyContent = html.UnescapeString(*pc) } @@ -180,7 +180,7 @@ func resourceArmApiManagementAPIPolicyDelete(d *schema.ResourceData, meta interf if resp, err := client.Delete(ctx, resourceGroup, serviceName, apiName, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) + return fmt.Errorf("deleting API Policy (Resource Group %q / API Management Service %q / API %q): %+v", resourceGroup, serviceName, apiName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_schema.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_schema.go index 165750c8bb6b8..d9b808f6ec17f 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_schema.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_schema.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -71,7 +71,7 @@ func resourceArmApiManagementApiSchemaCreateUpdate(d *schema.ResourceData, meta existing, err := client.Get(ctx, resourceGroup, serviceName, apiName, schemaID) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) } } @@ -92,12 +92,12 @@ func resourceArmApiManagementApiSchemaCreateUpdate(d *schema.ResourceData, meta } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apiName, schemaID, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) + return fmt.Errorf("creating or updating API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apiName, schemaID) if err != nil { - return fmt.Errorf("Error retrieving API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) + return fmt.Errorf("retrieving API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) @@ -129,7 +129,7 @@ func resourceArmApiManagementApiSchemaRead(d *schema.ResourceData, meta interfac return nil } - return fmt.Errorf("Error making Read request for API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) + return fmt.Errorf("making Read request for API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) } d.Set("resource_group_name", resourceGroup) @@ -161,9 +161,9 @@ func resourceArmApiManagementApiSchemaDelete(d *schema.ResourceData, meta interf apiName := id.Path["apis"] schemaID := id.Path["schemas"] - if resp, err := client.Delete(ctx, resourceGroup, serviceName, apiName, schemaID, ""); err != nil { + if resp, err := client.Delete(ctx, resourceGroup, serviceName, apiName, schemaID, "", utils.Bool(false)); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) + return fmt.Errorf("deleting API Schema %q (API Management Service %q / API %q / Resource Group %q): %s", schemaID, serviceName, apiName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_version_set.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_version_set.go index 987d79b8593d5..6983656a61db2 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_version_set.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_api_version_set.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -92,7 +92,7 @@ func resourceArmApiManagementApiVersionSetCreateUpdate(d *schema.ResourceData, m existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Api Version Set %q (Api Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Api Version Set %q (Api Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -147,12 +147,12 @@ func resourceArmApiManagementApiVersionSetCreateUpdate(d *schema.ResourceData, m } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error creating/updating Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("creating/updating Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Api Version Set %q (Resource Group %q / Api Management Service %q)", name, resourceGroup, serviceName) @@ -183,7 +183,7 @@ func resourceArmApiManagementApiVersionSetRead(d *schema.ResourceData, meta inte return nil } - return fmt.Errorf("Error making Read request for Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) } d.Set("name", resp.Name) @@ -216,7 +216,7 @@ func resourceArmApiManagementApiVersionSetDelete(d *schema.ResourceData, meta in if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Api Version Set %q (Resource Group %q / Api Management Service %q): %+v", name, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_authorization_server.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_authorization_server.go index 204c26d7cf4fc..b1b868b7a4eb0 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_authorization_server.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_authorization_server.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -197,7 +197,7 @@ func resourceArmApiManagementAuthorizationServerCreateUpdate(d *schema.ResourceD existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Authorization Server %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Authorization Server %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -262,12 +262,12 @@ func resourceArmApiManagementAuthorizationServerCreateUpdate(d *schema.ResourceD } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, params, ""); err != nil { - return fmt.Errorf("Error creating/updating Authorization Server %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating Authorization Server %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } read, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving Authorization Server %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving Authorization Server %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } if read.ID == nil { @@ -300,7 +300,7 @@ func resourceArmApiManagementAuthorizationServerRead(d *schema.ResourceData, met return nil } - return fmt.Errorf("Error retrieving Authorization Server %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving Authorization Server %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } d.Set("api_management_name", serviceName) @@ -321,23 +321,23 @@ func resourceArmApiManagementAuthorizationServerRead(d *schema.ResourceData, met d.Set("token_endpoint", props.TokenEndpoint) if err := d.Set("authorization_methods", flattenApiManagementAuthorizationServerAuthorizationMethods(props.AuthorizationMethods)); err != nil { - return fmt.Errorf("Error flattening `authorization_methods`: %+v", err) + return fmt.Errorf("flattening `authorization_methods`: %+v", err) } if err := d.Set("bearer_token_sending_methods", flattenApiManagementAuthorizationServerBearerTokenSendingMethods(props.BearerTokenSendingMethods)); err != nil { - return fmt.Errorf("Error flattening `bearer_token_sending_methods`: %+v", err) + return fmt.Errorf("flattening `bearer_token_sending_methods`: %+v", err) } if err := d.Set("client_authentication_method", flattenApiManagementAuthorizationServerClientAuthenticationMethods(props.ClientAuthenticationMethod)); err != nil { - return fmt.Errorf("Error flattening `client_authentication_method`: %+v", err) + return fmt.Errorf("flattening `client_authentication_method`: %+v", err) } if err := d.Set("grant_types", flattenApiManagementAuthorizationServerGrantTypes(props.GrantTypes)); err != nil { - return fmt.Errorf("Error flattening `grant_types`: %+v", err) + return fmt.Errorf("flattening `grant_types`: %+v", err) } if err := d.Set("token_body_parameter", flattenApiManagementAuthorizationServerTokenBodyParameters(props.TokenBodyParameters)); err != nil { - return fmt.Errorf("Error flattening `token_body_parameter`: %+v", err) + return fmt.Errorf("flattening `token_body_parameter`: %+v", err) } } @@ -360,7 +360,7 @@ func resourceArmApiManagementAuthorizationServerDelete(d *schema.ResourceData, m if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Authorization Server %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("deleting Authorization Server %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_backend.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_backend.go index b4bde35a0cbfe..7b807633488e4 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_backend.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_backend.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -248,7 +248,7 @@ func resourceArmApiManagementBackendCreateUpdate(d *schema.ResourceData, meta in existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing backend %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing backend %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -296,12 +296,12 @@ func resourceArmApiManagementBackendCreateUpdate(d *schema.ResourceData, meta in } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, backendContract, ""); err != nil { - return fmt.Errorf("Error creating/updating backend %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating backend %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } read, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving backend %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving backend %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } if read.ID == nil { @@ -333,7 +333,7 @@ func resourceArmApiManagementBackendRead(d *schema.ResourceData, meta interface{ return nil } - return fmt.Errorf("Error retrieving backend %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving backend %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } d.Set("name", name) @@ -347,18 +347,18 @@ func resourceArmApiManagementBackendRead(d *schema.ResourceData, meta interface{ d.Set("title", props.Title) d.Set("url", props.URL) if err := d.Set("credentials", flattenApiManagementBackendCredentials(props.Credentials)); err != nil { - return fmt.Errorf("Error setting `credentials`: %s", err) + return fmt.Errorf("setting `credentials`: %s", err) } if err := d.Set("proxy", flattenApiManagementBackendProxy(props.Proxy)); err != nil { - return fmt.Errorf("Error setting `proxy`: %s", err) + return fmt.Errorf("setting `proxy`: %s", err) } if properties := props.Properties; properties != nil { if err := d.Set("service_fabric_cluster", flattenApiManagementBackendServiceFabricCluster(properties.ServiceFabricCluster)); err != nil { - return fmt.Errorf("Error setting `service_fabric_cluster`: %s", err) + return fmt.Errorf("setting `service_fabric_cluster`: %s", err) } } if err := d.Set("tls", flattenApiManagementBackendTls(props.TLS)); err != nil { - return fmt.Errorf("Error setting `tls`: %s", err) + return fmt.Errorf("setting `tls`: %s", err) } } @@ -381,7 +381,7 @@ func resourceArmApiManagementBackendDelete(d *schema.ResourceData, meta interfac if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting backend %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("deleting backend %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_certificate.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_certificate.go index a540651eebb23..d1b4dcacbcc35 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_certificate.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_certificate.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -86,7 +86,7 @@ func resourceArmApiManagementCertificateCreateUpdate(d *schema.ResourceData, met existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Certificate %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Certificate %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -103,12 +103,12 @@ func resourceArmApiManagementCertificateCreateUpdate(d *schema.ResourceData, met } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Certificate %q (Resource Group %q / API Management Service %q)", name, resourceGroup, serviceName) @@ -139,7 +139,7 @@ func resourceArmApiManagementCertificateRead(d *schema.ResourceData, meta interf return nil } - return fmt.Errorf("Error making Read request for Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } d.Set("name", resp.Name) @@ -174,7 +174,7 @@ func resourceArmApiManagementCertificateDelete(d *schema.ResourceData, meta inte if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Certificate %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_diagnostic.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_diagnostic.go index adffb9250b79d..d5024163d77b1 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_diagnostic.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_diagnostic.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -48,8 +48,9 @@ func resourceArmApiManagementDiagnostic() *schema.Resource { "api_management_name": azure.SchemaApiManagementName(), "enabled": { - Type: schema.TypeBool, - Required: true, + Type: schema.TypeBool, + Optional: true, + Deprecated: "this property has been removed from the API and will be removed in version 3.0 of the provider", }, }, } @@ -63,13 +64,12 @@ func resourceArmApiManagementDiagnosticCreateUpdate(d *schema.ResourceData, meta diagnosticId := d.Get("identifier").(string) resourceGroup := d.Get("resource_group_name").(string) serviceName := d.Get("api_management_name").(string) - enabled := d.Get("enabled").(bool) if features.ShouldResourcesBeImported() && d.IsNewResource() { existing, err := client.Get(ctx, resourceGroup, serviceName, diagnosticId) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Diagnostic %q (API Management Service %q / Resource Group %q): %s", diagnosticId, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Diagnostic %q (API Management Service %q / Resource Group %q): %s", diagnosticId, serviceName, resourceGroup, err) } } @@ -79,18 +79,16 @@ func resourceArmApiManagementDiagnosticCreateUpdate(d *schema.ResourceData, meta } parameters := apimanagement.DiagnosticContract{ - DiagnosticContractProperties: &apimanagement.DiagnosticContractProperties{ - Enabled: utils.Bool(enabled), - }, + DiagnosticContractProperties: &apimanagement.DiagnosticContractProperties{}, } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, diagnosticId, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, diagnosticId) if err != nil { - return fmt.Errorf("Error retrieving Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Diagnostic %q (Resource Group %q / API Management Service %q)", diagnosticId, resourceGroup, serviceName) @@ -121,17 +119,13 @@ func resourceArmApiManagementDiagnosticRead(d *schema.ResourceData, meta interfa return nil } - return fmt.Errorf("Error making Read request for Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) } d.Set("identifier", resp.Name) d.Set("resource_group_name", resourceGroup) d.Set("api_management_name", serviceName) - if props := resp.DiagnosticContractProperties; props != nil { - d.Set("enabled", props.Enabled) - } - return nil } @@ -150,7 +144,7 @@ func resourceArmApiManagementDiagnosticDelete(d *schema.ResourceData, meta inter if resp, err := client.Delete(ctx, resourceGroup, serviceName, diagnosticId, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Diagnostic %q (Resource Group %q / API Management Service %q): %+v", diagnosticId, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_group.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_group.go index 229239105e87f..a35d1e34af611 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_group.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_group.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -89,7 +89,7 @@ func resourceArmApiManagementGroupCreateUpdate(d *schema.ResourceData, meta inte existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Group %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Group %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -108,12 +108,12 @@ func resourceArmApiManagementGroupCreateUpdate(d *schema.ResourceData, meta inte } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Group %q (Resource Group %q / API Management Service %q)", name, resourceGroup, serviceName) @@ -144,7 +144,7 @@ func resourceArmApiManagementGroupRead(d *schema.ResourceData, meta interface{}) return nil } - return fmt.Errorf("Error making Read request for Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } d.Set("name", resp.Name) @@ -176,7 +176,7 @@ func resourceArmApiManagementGroupDelete(d *schema.ResourceData, meta interface{ if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Group %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_group_user.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_group_user.go index 2df9f01a12667..9942b7dd0801d 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_group_user.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_group_user.go @@ -56,7 +56,7 @@ func resourceArmApiManagementGroupUserCreate(d *schema.ResourceData, meta interf resp, err := client.CheckEntityExists(ctx, resourceGroup, serviceName, groupName, userId) if err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error checking for present of existing User %q / Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("checking for present of existing User %q / Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) } } @@ -69,7 +69,7 @@ func resourceArmApiManagementGroupUserCreate(d *schema.ResourceData, meta interf resp, err := client.Create(ctx, resourceGroup, serviceName, groupName, userId) if err != nil { - return fmt.Errorf("Error adding User %q to Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("adding User %q to Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) } // there's no Read so this is best-effort @@ -100,7 +100,7 @@ func resourceArmApiManagementGroupUserRead(d *schema.ResourceData, meta interfac return nil } - return fmt.Errorf("Error retrieving User %q / Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving User %q / Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) } d.Set("group_name", groupName) @@ -127,7 +127,7 @@ func resourceArmApiManagementGroupUserDelete(d *schema.ResourceData, meta interf if resp, err := client.Delete(ctx, resourceGroup, serviceName, groupName, userId); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error removing User %q from Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("removing User %q from Group %q (API Management Service %q / Resource Group %q): %+v", userId, groupName, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_aad.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_aad.go index 3cd60f701a13d..d08e3572da8ae 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_aad.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_aad.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -78,7 +78,7 @@ func resourceArmApiManagementIdentityProviderAADCreateUpdate(d *schema.ResourceD existing, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Aad) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Aad, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Aad, serviceName, resourceGroup, err) } } @@ -87,8 +87,8 @@ func resourceArmApiManagementIdentityProviderAADCreateUpdate(d *schema.ResourceD } } - parameters := apimanagement.IdentityProviderContract{ - IdentityProviderContractProperties: &apimanagement.IdentityProviderContractProperties{ + parameters := apimanagement.IdentityProviderCreateContract{ + IdentityProviderCreateContractProperties: &apimanagement.IdentityProviderCreateContractProperties{ ClientID: utils.String(clientID), ClientSecret: utils.String(clientSecret), Type: apimanagement.Aad, @@ -97,12 +97,12 @@ func resourceArmApiManagementIdentityProviderAADCreateUpdate(d *schema.ResourceD } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apimanagement.Aad, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Aad, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Aad, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Aad) if err != nil { - return fmt.Errorf("Error retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Aad, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Aad, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Identity Provider %q (Resource Group %q / API Management Service %q)", apimanagement.Aad, resourceGroup, serviceName) @@ -133,7 +133,7 @@ func resourceArmApiManagementIdentityProviderAADRead(d *schema.ResourceData, met return nil } - return fmt.Errorf("Error making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } d.Set("resource_group_name", resourceGroup) @@ -163,7 +163,7 @@ func resourceArmApiManagementIdentityProviderAADDelete(d *schema.ResourceData, m if resp, err := client.Delete(ctx, resourceGroup, serviceName, apimanagement.IdentityProviderType(identityProviderName), ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_facebook.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_facebook.go index 5b2de8d111c44..82d3cb3cd94b7 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_facebook.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_facebook.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -68,7 +68,7 @@ func resourceArmApiManagementIdentityProviderFacebookCreateUpdate(d *schema.Reso existing, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Facebook) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Facebook, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Facebook, serviceName, resourceGroup, err) } } @@ -77,8 +77,8 @@ func resourceArmApiManagementIdentityProviderFacebookCreateUpdate(d *schema.Reso } } - parameters := apimanagement.IdentityProviderContract{ - IdentityProviderContractProperties: &apimanagement.IdentityProviderContractProperties{ + parameters := apimanagement.IdentityProviderCreateContract{ + IdentityProviderCreateContractProperties: &apimanagement.IdentityProviderCreateContractProperties{ ClientID: utils.String(clientID), ClientSecret: utils.String(clientSecret), Type: apimanagement.Facebook, @@ -86,12 +86,12 @@ func resourceArmApiManagementIdentityProviderFacebookCreateUpdate(d *schema.Reso } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apimanagement.Facebook, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Facebook, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Facebook, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Facebook) if err != nil { - return fmt.Errorf("Error retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Facebook, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Facebook, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Identity Provider %q (Resource Group %q / API Management Service %q)", apimanagement.Facebook, resourceGroup, serviceName) @@ -122,7 +122,7 @@ func resourceArmApiManagementIdentityProviderFacebookRead(d *schema.ResourceData return nil } - return fmt.Errorf("Error making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } d.Set("resource_group_name", resourceGroup) @@ -151,7 +151,7 @@ func resourceArmApiManagementIdentityProviderFacebookDelete(d *schema.ResourceDa if resp, err := client.Delete(ctx, resourceGroup, serviceName, apimanagement.IdentityProviderType(identityProviderName), ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_google.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_google.go index 1aa03781f31d7..c74b44e3a99c0 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_google.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_google.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -69,7 +69,7 @@ func resourceArmApiManagementIdentityProviderGoogleCreateUpdate(d *schema.Resour existing, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Google) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Google, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Google, serviceName, resourceGroup, err) } } @@ -78,8 +78,8 @@ func resourceArmApiManagementIdentityProviderGoogleCreateUpdate(d *schema.Resour } } - parameters := apimanagement.IdentityProviderContract{ - IdentityProviderContractProperties: &apimanagement.IdentityProviderContractProperties{ + parameters := apimanagement.IdentityProviderCreateContract{ + IdentityProviderCreateContractProperties: &apimanagement.IdentityProviderCreateContractProperties{ ClientID: utils.String(clientID), ClientSecret: utils.String(clientSecret), Type: apimanagement.Google, @@ -87,12 +87,12 @@ func resourceArmApiManagementIdentityProviderGoogleCreateUpdate(d *schema.Resour } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apimanagement.Google, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Google, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Google, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Google) if err != nil { - return fmt.Errorf("Error retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Google, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Google, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Identity Provider %q (Resource Group %q / API Management Service %q)", apimanagement.Google, resourceGroup, serviceName) @@ -123,7 +123,7 @@ func resourceArmApiManagementIdentityProviderGoogleRead(d *schema.ResourceData, return nil } - return fmt.Errorf("Error making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } d.Set("resource_group_name", resourceGroup) @@ -152,7 +152,7 @@ func resourceArmApiManagementIdentityProviderGoogleDelete(d *schema.ResourceData if resp, err := client.Delete(ctx, resourceGroup, serviceName, apimanagement.IdentityProviderType(identityProviderName), ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_microsoft.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_microsoft.go index b8498d0d456e7..9e2cdbe2388e8 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_microsoft.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_microsoft.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -68,7 +68,7 @@ func resourceArmApiManagementIdentityProviderMicrosoftCreateUpdate(d *schema.Res existing, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Microsoft) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Microsoft, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Microsoft, serviceName, resourceGroup, err) } } @@ -77,8 +77,8 @@ func resourceArmApiManagementIdentityProviderMicrosoftCreateUpdate(d *schema.Res } } - parameters := apimanagement.IdentityProviderContract{ - IdentityProviderContractProperties: &apimanagement.IdentityProviderContractProperties{ + parameters := apimanagement.IdentityProviderCreateContract{ + IdentityProviderCreateContractProperties: &apimanagement.IdentityProviderCreateContractProperties{ ClientID: utils.String(clientID), ClientSecret: utils.String(clientSecret), Type: apimanagement.Microsoft, @@ -86,12 +86,12 @@ func resourceArmApiManagementIdentityProviderMicrosoftCreateUpdate(d *schema.Res } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apimanagement.Microsoft, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Microsoft, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Microsoft, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Microsoft) if err != nil { - return fmt.Errorf("Error retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Microsoft, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Microsoft, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Identity Provider %q (Resource Group %q / API Management Service %q)", apimanagement.Microsoft, resourceGroup, serviceName) @@ -122,7 +122,7 @@ func resourceArmApiManagementIdentityProviderMicrosoftRead(d *schema.ResourceDat return nil } - return fmt.Errorf("Error making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } d.Set("resource_group_name", resourceGroup) @@ -151,7 +151,7 @@ func resourceArmApiManagementIdentityProviderMicrosoftDelete(d *schema.ResourceD if resp, err := client.Delete(ctx, resourceGroup, serviceName, apimanagement.IdentityProviderType(identityProviderName), ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_twitter.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_twitter.go index 290eb738076db..b217fe348ec1d 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_twitter.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_twitter.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -68,7 +68,7 @@ func resourceArmApiManagementIdentityProviderTwitterCreateUpdate(d *schema.Resou existing, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Twitter) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Twitter, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Identity Provider %q (API Management Service %q / Resource Group %q): %s", apimanagement.Twitter, serviceName, resourceGroup, err) } } @@ -77,8 +77,8 @@ func resourceArmApiManagementIdentityProviderTwitterCreateUpdate(d *schema.Resou } } - parameters := apimanagement.IdentityProviderContract{ - IdentityProviderContractProperties: &apimanagement.IdentityProviderContractProperties{ + parameters := apimanagement.IdentityProviderCreateContract{ + IdentityProviderCreateContractProperties: &apimanagement.IdentityProviderCreateContractProperties{ ClientID: utils.String(clientID), ClientSecret: utils.String(clientSecret), Type: apimanagement.Twitter, @@ -86,12 +86,12 @@ func resourceArmApiManagementIdentityProviderTwitterCreateUpdate(d *schema.Resou } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, apimanagement.Twitter, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Twitter, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Twitter, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, apimanagement.Twitter) if err != nil { - return fmt.Errorf("Error retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Twitter, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Identity Provider %q (Resource Group %q / API Management Service %q): %+v", apimanagement.Twitter, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Identity Provider %q (Resource Group %q / API Management Service %q)", apimanagement.Twitter, resourceGroup, serviceName) @@ -122,7 +122,7 @@ func resourceArmApiManagementIdentityProviderTwitterRead(d *schema.ResourceData, return nil } - return fmt.Errorf("Error making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } d.Set("resource_group_name", resourceGroup) @@ -151,7 +151,7 @@ func resourceArmApiManagementIdentityProviderTwitterDelete(d *schema.ResourceDat if resp, err := client.Delete(ctx, resourceGroup, serviceName, apimanagement.IdentityProviderType(identityProviderName), ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Identity Provider %q (Resource Group %q / API Management Service %q): %+v", identityProviderName, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_logger.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_logger.go index 963ac28bf39fe..cf42f43b3a4f4 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_logger.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_logger.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -117,7 +117,7 @@ func resourceArmApiManagementLoggerCreate(d *schema.ResourceData, meta interface existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Logger %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Logger %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -142,12 +142,12 @@ func resourceArmApiManagementLoggerCreate(d *schema.ResourceData, meta interface } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error creating Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("creating Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read Logger %q (Resource Group %q / API Management Service %q) ID", name, resourceGroup, serviceName) @@ -177,7 +177,7 @@ func resourceArmApiManagementLoggerRead(d *schema.ResourceData, meta interface{} d.SetId("") return nil } - return fmt.Errorf("Error reading Logger %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("reading Logger %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } d.Set("name", resp.Name) @@ -188,7 +188,7 @@ func resourceArmApiManagementLoggerRead(d *schema.ResourceData, meta interface{} d.Set("buffered", properties.IsBuffered) d.Set("description", properties.Description) if err := d.Set("eventhub", flattenArmApiManagementLoggerEventHub(d, properties)); err != nil { - return fmt.Errorf("Error setting `eventhub`: %s", err) + return fmt.Errorf("setting `eventhub`: %s", err) } } @@ -223,7 +223,7 @@ func resourceArmApiManagementLoggerUpdate(d *schema.ResourceData, meta interface } if _, err := client.Update(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error updating Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("updating Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } return resourceArmApiManagementLoggerRead(d, meta) @@ -243,9 +243,9 @@ func resourceArmApiManagementLoggerDelete(d *schema.ResourceData, meta interface serviceName := id.Path["service"] name := id.Path["loggers"] - if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { + if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, "", utils.Bool(false)); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Logger %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_named_value.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_named_value.go new file mode 100644 index 0000000000000..02e688127a219 --- /dev/null +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_named_value.go @@ -0,0 +1,180 @@ +package apimanagement + +import ( + "fmt" + "log" + "time" + + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func resourceArmApiManagementNamedValue() *schema.Resource { + return &schema.Resource{ + Create: resourceArmApiManagementNamedValueCreateUpdate, + Read: resourceArmApiManagementNamedValueRead, + Update: resourceArmApiManagementNamedValueCreateUpdate, + Delete: resourceArmApiManagementNamedValueDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(30 * time.Minute), + Read: schema.DefaultTimeout(5 * time.Minute), + Update: schema.DefaultTimeout(30 * time.Minute), + Delete: schema.DefaultTimeout(30 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "name": azure.SchemaApiManagementChildName(), + + "resource_group_name": azure.SchemaResourceGroupName(), + + "api_management_name": azure.SchemaApiManagementName(), + + "display_name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "value": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "secret": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + + "tags": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + } +} + +func resourceArmApiManagementNamedValueCreateUpdate(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).ApiManagement.NamedValueClient + ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) + defer cancel() + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + serviceName := d.Get("api_management_name").(string) + + if features.ShouldResourcesBeImported() && d.IsNewResource() { + existing, err := client.Get(ctx, resourceGroup, serviceName, name) + if err != nil { + if !utils.ResponseWasNotFound(existing.Response) { + return fmt.Errorf(" checking for presence of existing Property %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + } + } + + if existing.ID != nil && *existing.ID != "" { + return tf.ImportAsExistsError("azurerm_api_management_property", *existing.ID) + } + } + + parameters := apimanagement.NamedValueCreateContract{ + NamedValueCreateContractProperties: &apimanagement.NamedValueCreateContractProperties{ + DisplayName: utils.String(d.Get("display_name").(string)), + Secret: utils.Bool(d.Get("secret").(bool)), + Value: utils.String(d.Get("value").(string)), + }, + } + + if tags, ok := d.GetOk("tags"); ok { + parameters.NamedValueCreateContractProperties.Tags = utils.ExpandStringSlice(tags.([]interface{})) + } + + if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { + return fmt.Errorf(" creating or updating Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + } + + resp, err := client.Get(ctx, resourceGroup, serviceName, name) + if err != nil { + return fmt.Errorf(" retrieving Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + } + if resp.ID == nil { + return fmt.Errorf("Cannot read ID for Property %q (Resource Group %q / API Management Service %q)", name, resourceGroup, serviceName) + } + d.SetId(*resp.ID) + + return resourceArmApiManagementNamedValueRead(d, meta) +} + +func resourceArmApiManagementNamedValueRead(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).ApiManagement.NamedValueClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := azure.ParseAzureResourceID(d.Id()) + if err != nil { + return err + } + resourceGroup := id.ResourceGroup + serviceName := id.Path["service"] + name := id.Path["namedValues"] + + resp, err := client.Get(ctx, resourceGroup, serviceName, name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + log.Printf("[DEBUG] Property %q (Resource Group %q / API Management Service %q) was not found - removing from state!", name, resourceGroup, serviceName) + d.SetId("") + return nil + } + + return fmt.Errorf(" making Read request for Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + } + + d.Set("name", resp.Name) + d.Set("resource_group_name", resourceGroup) + d.Set("api_management_name", serviceName) + + if properties := resp.NamedValueContractProperties; properties != nil { + d.Set("display_name", properties.DisplayName) + d.Set("secret", properties.Secret) + d.Set("value", properties.Value) + d.Set("tags", properties.Tags) + } + + return nil +} + +func resourceArmApiManagementNamedValueDelete(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).ApiManagement.NamedValueClient + ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := azure.ParseAzureResourceID(d.Id()) + if err != nil { + return err + } + resourceGroup := id.ResourceGroup + serviceName := id.Path["service"] + name := id.Path["namedValues"] + + if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { + if !utils.ResponseWasNotFound(resp) { + return fmt.Errorf(" deleting Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + } + } + + return nil +} diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_openid_connect_provider.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_openid_connect_provider.go index 85c580762ae12..1c12798730f7e 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_openid_connect_provider.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_openid_connect_provider.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -88,7 +88,7 @@ func resourceArmApiManagementOpenIDConnectProviderCreateUpdate(d *schema.Resourc existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing OpenID Connect Provider %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing OpenID Connect Provider %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -108,12 +108,12 @@ func resourceArmApiManagementOpenIDConnectProviderCreateUpdate(d *schema.Resourc } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error creating OpenID Connect Provider %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("creating OpenID Connect Provider %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving OpenID Connect Provider %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving OpenID Connect Provider %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read OpenID Connect Provider %q (Resource Group %q / API Management Service %q) ID", name, resourceGroup, serviceName) @@ -143,7 +143,7 @@ func resourceArmApiManagementOpenIDConnectProviderRead(d *schema.ResourceData, m d.SetId("") return nil } - return fmt.Errorf("Error reading OpenID Connect Provider %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) + return fmt.Errorf("reading OpenID Connect Provider %q (API Management Service %q / Resource Group %q): %+v", name, serviceName, resourceGroup, err) } d.Set("name", resp.Name) @@ -176,7 +176,7 @@ func resourceArmApiManagementOpenIDConnectProviderDelete(d *schema.ResourceData, if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting OpenID Connect Provider %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("deleting OpenID Connect Provider %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_product.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_product.go index 7ebae6bd29573..6785de665d18f 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_product.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_product.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -102,7 +102,7 @@ func resourceArmApiManagementProductCreateUpdate(d *schema.ResourceData, meta in existing, err := client.Get(ctx, resourceGroup, serviceName, productId) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Product %q (API Management Service %q / Resource Group %q): %s", productId, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Product %q (API Management Service %q / Resource Group %q): %s", productId, serviceName, resourceGroup, err) } } @@ -135,12 +135,12 @@ func resourceArmApiManagementProductCreateUpdate(d *schema.ResourceData, meta in } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, productId, properties, ""); err != nil { - return fmt.Errorf("Error creating/updating Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) } read, err := client.Get(ctx, resourceGroup, serviceName, productId) if err != nil { - return fmt.Errorf("Error retrieving Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) } if read.ID == nil { @@ -174,7 +174,7 @@ func resourceArmApiManagementProductRead(d *schema.ResourceData, meta interface{ return nil } - return fmt.Errorf("Error making Read request on Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) + return fmt.Errorf("making Read request on Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) } d.Set("product_id", productId) @@ -212,7 +212,7 @@ func resourceArmApiManagementProductDelete(d *schema.ResourceData, meta interfac resp, err := client.Delete(ctx, resourceGroup, serviceName, productId, "", utils.Bool(deleteSubscriptions)) if err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) + return fmt.Errorf("deleting Product %q (API Management Service %q / Resource Group %q): %+v", productId, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_api.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_product_api.go index 950fda861a2ff..555f6f15c1f7d 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_api.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_product_api.go @@ -56,7 +56,7 @@ func resourceArmApiManagementProductApiCreate(d *schema.ResourceData, meta inter resp, err := client.CheckEntityExists(ctx, resourceGroup, serviceName, productId, apiName) if err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error checking for present of existing API %q / Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) + return fmt.Errorf("checking for present of existing API %q / Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) } } @@ -69,7 +69,7 @@ func resourceArmApiManagementProductApiCreate(d *schema.ResourceData, meta inter resp, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, productId, apiName) if err != nil { - return fmt.Errorf("Error adding API %q to Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) + return fmt.Errorf("adding API %q to Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) } // there's no Read so this is best-effort @@ -100,7 +100,7 @@ func resourceArmApiManagementProductApiRead(d *schema.ResourceData, meta interfa return nil } - return fmt.Errorf("Error retrieving API %q / Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving API %q / Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) } // This can be removed once updated to apimanagement API to 2019-01-01 @@ -135,7 +135,7 @@ func resourceArmApiManagementProductApiDelete(d *schema.ResourceData, meta inter if resp, err := client.Delete(ctx, resourceGroup, serviceName, productId, apiName); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error removing API %q from Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) + return fmt.Errorf("removing API %q from Product %q (API Management Service %q / Resource Group %q): %+v", apiName, productId, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_group.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_product_group.go index d8ef73d3181fd..b2de69044605a 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_group.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_product_group.go @@ -56,7 +56,7 @@ func resourceArmApiManagementProductGroupCreate(d *schema.ResourceData, meta int resp, err := client.CheckEntityExists(ctx, resourceGroup, serviceName, productId, groupName) if err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error checking for present of existing Product %q / Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("checking for present of existing Product %q / Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) } } @@ -69,7 +69,7 @@ func resourceArmApiManagementProductGroupCreate(d *schema.ResourceData, meta int resp, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, productId, groupName) if err != nil { - return fmt.Errorf("Error adding Product %q to Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("adding Product %q to Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) } // there's no Read so this is best-effort @@ -100,7 +100,7 @@ func resourceArmApiManagementProductGroupRead(d *schema.ResourceData, meta inter return nil } - return fmt.Errorf("Error retrieving Product %q / Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving Product %q / Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) } d.Set("group_name", groupName) @@ -127,7 +127,7 @@ func resourceArmApiManagementProductGroupDelete(d *schema.ResourceData, meta int if resp, err := client.Delete(ctx, resourceGroup, serviceName, productId, groupName); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error removing Product %q from Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) + return fmt.Errorf("removing Product %q from Group %q (API Management Service %q / Resource Group %q): %+v", productId, groupName, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_policy.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_product_policy.go index 1987b3c401a0a..8ecab822a7c4a 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_policy.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_product_policy.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/suppress" @@ -67,10 +67,10 @@ func resourceArmApiManagementProductPolicyCreateUpdate(d *schema.ResourceData, m productID := d.Get("product_id").(string) if features.ShouldResourcesBeImported() && d.IsNewResource() { - existing, err := client.Get(ctx, resourceGroup, serviceName, productID) + existing, err := client.Get(ctx, resourceGroup, serviceName, productID, apimanagement.PolicyExportFormatXML) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Product Policy (API Management Service %q / Product %q / Resource Group %q): %s", serviceName, productID, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Product Policy (API Management Service %q / Product %q / Resource Group %q): %s", serviceName, productID, resourceGroup, err) } } @@ -86,15 +86,15 @@ func resourceArmApiManagementProductPolicyCreateUpdate(d *schema.ResourceData, m if xmlContent != "" { parameters.PolicyContractProperties = &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.XML, - PolicyContent: utils.String(xmlContent), + Format: apimanagement.XML, + Value: utils.String(xmlContent), } } if xmlLink != "" { parameters.PolicyContractProperties = &apimanagement.PolicyContractProperties{ - ContentFormat: apimanagement.XMLLink, - PolicyContent: utils.String(xmlLink), + Format: apimanagement.XMLLink, + Value: utils.String(xmlLink), } } @@ -103,12 +103,12 @@ func resourceArmApiManagementProductPolicyCreateUpdate(d *schema.ResourceData, m } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, productID, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) + return fmt.Errorf("creating or updating Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) } - resp, err := client.Get(ctx, resourceGroup, serviceName, productID) + resp, err := client.Get(ctx, resourceGroup, serviceName, productID, apimanagement.PolicyExportFormatXML) if err != nil { - return fmt.Errorf("Error retrieving Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) + return fmt.Errorf("retrieving Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) @@ -131,7 +131,7 @@ func resourceArmApiManagementProductPolicyRead(d *schema.ResourceData, meta inte serviceName := id.Path["service"] productID := id.Path["products"] - resp, err := client.Get(ctx, resourceGroup, serviceName, productID) + resp, err := client.Get(ctx, resourceGroup, serviceName, productID, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { log.Printf("[DEBUG] Product Policy (Resource Group %q / API Management Service %q / Product %q) was not found - removing from state!", resourceGroup, serviceName, productID) @@ -139,7 +139,7 @@ func resourceArmApiManagementProductPolicyRead(d *schema.ResourceData, meta inte return nil } - return fmt.Errorf("Error making Read request for Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) + return fmt.Errorf("making Read request for Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) } d.Set("resource_group_name", resourceGroup) @@ -149,7 +149,7 @@ func resourceArmApiManagementProductPolicyRead(d *schema.ResourceData, meta inte if properties := resp.PolicyContractProperties; properties != nil { // when you submit an `xml_link` to the API, the API downloads this link and stores it as `xml_content` // as such there is no way to set `xml_link` and we'll let Terraform handle it - d.Set("xml_content", properties.PolicyContent) + d.Set("xml_content", properties.Value) } return nil @@ -170,7 +170,7 @@ func resourceArmApiManagementProductPolicyDelete(d *schema.ResourceData, meta in if resp, err := client.Delete(ctx, resourceGroup, serviceName, productID, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) + return fmt.Errorf("deleting Product Policy (Resource Group %q / API Management Service %q / Product %q): %+v", resourceGroup, serviceName, productID, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_property.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_property.go index 318355fb65552..8c3188d11e813 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_property.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_property.go @@ -5,13 +5,14 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/apimanagement/migration" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -22,6 +23,9 @@ func resourceArmApiManagementProperty() *schema.Resource { Read: resourceArmApiManagementPropertyRead, Update: resourceArmApiManagementPropertyCreateUpdate, Delete: resourceArmApiManagementPropertyDelete, + + DeprecationMessage: "This resource has been superseded by `azurerm_api_management_named_value` to reflects changes in the API/SDK and will be removed in version 3.0 of the provider.", + Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -33,6 +37,15 @@ func resourceArmApiManagementProperty() *schema.Resource { Delete: schema.DefaultTimeout(30 * time.Minute), }, + SchemaVersion: 1, + StateUpgraders: []schema.StateUpgrader{ + { + Type: migration.APIManagementApiPropertyUpgradeV0Schema().CoreConfigSchema().ImpliedType(), + Upgrade: migration.APIManagementApiPropertyUpgradeV0ToV1, + Version: 0, + }, + }, + Schema: map[string]*schema.Schema{ "name": azure.SchemaApiManagementChildName(), @@ -70,7 +83,7 @@ func resourceArmApiManagementProperty() *schema.Resource { } func resourceArmApiManagementPropertyCreateUpdate(d *schema.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).ApiManagement.PropertyClient + client := meta.(*clients.Client).ApiManagement.NamedValueClient ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) defer cancel() @@ -82,7 +95,7 @@ func resourceArmApiManagementPropertyCreateUpdate(d *schema.ResourceData, meta i existing, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing Property %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing Property %q (API Management Service %q / Resource Group %q): %s", name, serviceName, resourceGroup, err) } } @@ -91,8 +104,8 @@ func resourceArmApiManagementPropertyCreateUpdate(d *schema.ResourceData, meta i } } - parameters := apimanagement.PropertyContract{ - PropertyContractProperties: &apimanagement.PropertyContractProperties{ + parameters := apimanagement.NamedValueCreateContract{ + NamedValueCreateContractProperties: &apimanagement.NamedValueCreateContractProperties{ DisplayName: utils.String(d.Get("display_name").(string)), Secret: utils.Bool(d.Get("secret").(bool)), Value: utils.String(d.Get("value").(string)), @@ -100,16 +113,16 @@ func resourceArmApiManagementPropertyCreateUpdate(d *schema.ResourceData, meta i } if tags, ok := d.GetOk("tags"); ok { - parameters.PropertyContractProperties.Tags = utils.ExpandStringSlice(tags.([]interface{})) + parameters.NamedValueCreateContractProperties.Tags = utils.ExpandStringSlice(tags.([]interface{})) } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, name, parameters, ""); err != nil { - return fmt.Errorf("Error creating or updating Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("creating or updating Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { - return fmt.Errorf("Error retrieving Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("retrieving Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } if resp.ID == nil { return fmt.Errorf("Cannot read ID for Property %q (Resource Group %q / API Management Service %q)", name, resourceGroup, serviceName) @@ -120,7 +133,7 @@ func resourceArmApiManagementPropertyCreateUpdate(d *schema.ResourceData, meta i } func resourceArmApiManagementPropertyRead(d *schema.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).ApiManagement.PropertyClient + client := meta.(*clients.Client).ApiManagement.NamedValueClient ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -130,7 +143,7 @@ func resourceArmApiManagementPropertyRead(d *schema.ResourceData, meta interface } resourceGroup := id.ResourceGroup serviceName := id.Path["service"] - name := id.Path["properties"] + name := id.Path["namedValues"] resp, err := client.Get(ctx, resourceGroup, serviceName, name) if err != nil { @@ -140,14 +153,14 @@ func resourceArmApiManagementPropertyRead(d *schema.ResourceData, meta interface return nil } - return fmt.Errorf("Error making Read request for Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("making Read request for Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } d.Set("name", resp.Name) d.Set("resource_group_name", resourceGroup) d.Set("api_management_name", serviceName) - if properties := resp.PropertyContractProperties; properties != nil { + if properties := resp.NamedValueContractProperties; properties != nil { d.Set("display_name", properties.DisplayName) d.Set("secret", properties.Secret) d.Set("value", properties.Value) @@ -158,7 +171,7 @@ func resourceArmApiManagementPropertyRead(d *schema.ResourceData, meta interface } func resourceArmApiManagementPropertyDelete(d *schema.ResourceData, meta interface{}) error { - client := meta.(*clients.Client).ApiManagement.PropertyClient + client := meta.(*clients.Client).ApiManagement.NamedValueClient ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() @@ -168,11 +181,11 @@ func resourceArmApiManagementPropertyDelete(d *schema.ResourceData, meta interfa } resourceGroup := id.ResourceGroup serviceName := id.Path["service"] - name := id.Path["properties"] + name := id.Path["namedValues"] if resp, err := client.Delete(ctx, resourceGroup, serviceName, name, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) + return fmt.Errorf("deleting Property %q (Resource Group %q / API Management Service %q): %+v", name, resourceGroup, serviceName, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_subscription.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_subscription.go index d1bf7c511f872..d049752217e39 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_subscription.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_subscription.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/satori/uuid" @@ -43,10 +43,9 @@ func resourceArmApiManagementSubscription() *schema.Resource { ValidateFunc: validation.Any(validation.IsUUID, validation.StringIsEmpty), }, + // 3.0 this seems to have been renamed to owner id? "user_id": azure.SchemaApiManagementChildID(), - "product_id": azure.SchemaApiManagementChildID(), - "resource_group_name": azure.SchemaResourceGroupName(), "api_management_name": azure.SchemaApiManagementName(), @@ -57,6 +56,14 @@ func resourceArmApiManagementSubscription() *schema.Resource { ValidateFunc: validation.StringIsNotEmpty, }, + // TODO this now sets the scope property - either a scope block needs adding or additional properties `api_id` and maybe `all_apis` + "product_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: azure.ValidateResourceID, + }, + "state": { Type: schema.TypeString, Optional: true, @@ -104,7 +111,7 @@ func resourceArmApiManagementSubscriptionCreateUpdate(d *schema.ResourceData, me resp, err := client.Get(ctx, resourceGroup, serviceName, subscriptionId) if err != nil { if !utils.ResponseWasNotFound(resp.Response) { - return fmt.Errorf("Error checking for present of existing Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) + return fmt.Errorf("checking for present of existing Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) } } @@ -121,9 +128,9 @@ func resourceArmApiManagementSubscriptionCreateUpdate(d *schema.ResourceData, me params := apimanagement.SubscriptionCreateParameters{ SubscriptionCreateParameterProperties: &apimanagement.SubscriptionCreateParameterProperties{ DisplayName: utils.String(displayName), - ProductID: utils.String(productId), + Scope: utils.String(productId), State: apimanagement.SubscriptionState(state), - UserID: utils.String(userId), + OwnerID: utils.String(userId), }, } @@ -138,12 +145,12 @@ func resourceArmApiManagementSubscriptionCreateUpdate(d *schema.ResourceData, me sendEmail := utils.Bool(false) _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, subscriptionId, params, sendEmail, "") if err != nil { - return fmt.Errorf("Error creating/updating Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) } resp, err := client.Get(ctx, resourceGroup, serviceName, subscriptionId) if err != nil { - return fmt.Errorf("Error retrieving Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) } d.SetId(*resp.ID) @@ -172,7 +179,7 @@ func resourceArmApiManagementSubscriptionRead(d *schema.ResourceData, meta inter return nil } - return fmt.Errorf("Error retrieving Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) } d.Set("subscription_id", subscriptionId) @@ -184,8 +191,8 @@ func resourceArmApiManagementSubscriptionRead(d *schema.ResourceData, meta inter d.Set("primary_key", props.PrimaryKey) d.Set("secondary_key", props.SecondaryKey) d.Set("state", string(props.State)) - d.Set("product_id", props.ProductID) - d.Set("user_id", props.UserID) + d.Set("product_id", props.Scope) + d.Set("user_id", props.OwnerID) } return nil @@ -206,7 +213,7 @@ func resourceArmApiManagementSubscriptionDelete(d *schema.ResourceData, meta int if resp, err := client.Delete(ctx, resourceGroup, serviceName, subscriptionId, ""); err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error removing Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) + return fmt.Errorf("removing Subscription %q (API Management Service %q / Resource Group %q): %+v", subscriptionId, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_user.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_user.go index 65e05a630d07d..91d8b104ac907 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_user.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_user.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" @@ -115,7 +115,7 @@ func resourceArmApiManagementUserCreateUpdate(d *schema.ResourceData, meta inter existing, err := client.Get(ctx, resourceGroup, serviceName, userId) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing User %q (API Management Service %q / Resource Group %q): %s", userId, serviceName, resourceGroup, err) + return fmt.Errorf("checking for presence of existing User %q (API Management Service %q / Resource Group %q): %s", userId, serviceName, resourceGroup, err) } } @@ -147,12 +147,12 @@ func resourceArmApiManagementUserCreateUpdate(d *schema.ResourceData, meta inter } if _, err := client.CreateOrUpdate(ctx, resourceGroup, serviceName, userId, properties, ""); err != nil { - return fmt.Errorf("Error creating/updating User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) + return fmt.Errorf("creating/updating User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) } read, err := client.Get(ctx, resourceGroup, serviceName, userId) if err != nil { - return fmt.Errorf("Error retrieving User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) + return fmt.Errorf("retrieving User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) } if read.ID == nil { @@ -186,7 +186,7 @@ func resourceArmApiManagementUserRead(d *schema.ResourceData, meta interface{}) return nil } - return fmt.Errorf("Error making Read request on User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) + return fmt.Errorf("making Read request on User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) } d.Set("user_id", userId) @@ -223,7 +223,7 @@ func resourceArmApiManagementUserDelete(d *schema.ResourceData, meta interface{} resp, err := client.Delete(ctx, resourceGroup, serviceName, userId, "", deleteSubscriptions, notify) if err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) + return fmt.Errorf("deleting User %q (API Management Service %q / Resource Group %q): %+v", userId, serviceName, resourceGroup, err) } } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_policy_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_policy_test.go index 699c970db8d97..bd7e74cc25216 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_policy_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_policy_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" @@ -100,7 +101,7 @@ func testCheckAzureRMApiManagementAPIOperationPolicyExists(resourceName string) resourceGroup := rs.Primary.Attributes["resource_group_name"] operationID := rs.Primary.Attributes["operation_id"] - resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName, operationID) + resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName, operationID, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return fmt.Errorf("Bad: API Policy (API Management Service %q / API %q / Operation %q / Resource Group %q) does not exist", serviceName, apiName, operationID, resourceGroup) @@ -127,7 +128,7 @@ func testCheckAzureRMApiManagementAPIOperationPolicyDestroy(s *terraform.State) resourceGroup := rs.Primary.Attributes["resource_group_name"] operationID := rs.Primary.Attributes["operation_id"] - resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName, operationID) + resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName, operationID, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return nil diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_policy_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_policy_test.go index 75f710ad2eec8..5339dd1e27d1c 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_policy_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_policy_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" @@ -123,7 +124,7 @@ func testCheckAzureRMApiManagementAPIPolicyExists(resourceName string) resource. serviceName := rs.Primary.Attributes["api_management_name"] resourceGroup := rs.Primary.Attributes["resource_group_name"] - resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName) + resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return fmt.Errorf("Bad: API Policy (API Management Service %q / API %q/ Resource Group %q) does not exist", serviceName, apiName, resourceGroup) @@ -149,7 +150,7 @@ func testCheckAzureRMApiManagementAPIPolicyDestroy(s *terraform.State) error { serviceName := rs.Primary.Attributes["api_management_name"] resourceGroup := rs.Primary.Attributes["resource_group_name"] - resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName) + resp, err := conn.Get(ctx, resourceGroup, serviceName, apiName, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return nil diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go index ae0fe570fa18e..4010e6e17181f 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go @@ -63,7 +63,7 @@ func TestAccAzureRMAPIManagementAuthorizationServer_complete(t *testing.T) { testCheckAzureRMAPIManagementAuthorizationServerExists(data.ResourceName), ), }, - data.ImportStep(), + data.ImportStep("client_secret"), }, }) } diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_aad_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_aad_test.go index d9ece846b691a..3a889bb8c096f 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_aad_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_aad_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_facebook_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_facebook_test.go index 413ff7477d0b1..d71c28242937b 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_facebook_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_facebook_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_google_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_google_test.go index e752072baa92d..6b9b237d0cd85 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_google_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_google_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_microsoft_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_microsoft_test.go index 273362ae8beeb..975821e5a9f21 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_microsoft_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_microsoft_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_twitter_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_twitter_test.go index e85177501bfe7..5ea1504ee45e5 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_twitter_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_twitter_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_named_value_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_named_value_test.go new file mode 100644 index 0000000000000..ba1fb9b37d5b2 --- /dev/null +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_named_value_test.go @@ -0,0 +1,190 @@ +package tests + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func TestAccAzureRMAPIManagementNamedValue_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_api_management_named_value", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMAPIManagementNamedValueDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMAPIManagementNamedValue_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMAPIManagementNamedValueExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "display_name", fmt.Sprintf("TestProperty%d", data.RandomInteger)), + resource.TestCheckResourceAttr(data.ResourceName, "value", "Test Value"), + resource.TestCheckResourceAttr(data.ResourceName, "tags.0", "tag1"), + resource.TestCheckResourceAttr(data.ResourceName, "tags.1", "tag2"), + ), + }, + data.ImportStep(), + }, + }) +} + +func TestAccAzureRMAPIManagementNamedValue_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_api_management_named_value", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMAPIManagementNamedValueDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMAPIManagementNamedValue_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMAPIManagementNamedValueExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "display_name", fmt.Sprintf("TestProperty%d", data.RandomInteger)), + resource.TestCheckResourceAttr(data.ResourceName, "value", "Test Value"), + resource.TestCheckResourceAttr(data.ResourceName, "tags.0", "tag1"), + resource.TestCheckResourceAttr(data.ResourceName, "tags.1", "tag2"), + ), + }, + { + Config: testAccAzureRMAPIManagementNamedValue_update(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMAPIManagementNamedValueExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "display_name", fmt.Sprintf("TestProperty2%d", data.RandomInteger)), + resource.TestCheckResourceAttr(data.ResourceName, "value", "Test Value2"), + resource.TestCheckResourceAttr(data.ResourceName, "secret", "true"), + resource.TestCheckResourceAttr(data.ResourceName, "tags.0", "tag3"), + resource.TestCheckResourceAttr(data.ResourceName, "tags.1", "tag4"), + ), + }, + data.ImportStep(), + }, + }) +} + +func testCheckAzureRMAPIManagementNamedValueDestroy(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).ApiManagement.NamedValueClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + for _, rs := range s.RootModule().Resources { + if rs.Type != "azurerm_api_management_named_value" { + continue + } + + name := rs.Primary.Attributes["name"] + resourceGroup := rs.Primary.Attributes["resource_group_name"] + serviceName := rs.Primary.Attributes["api_management_name"] + + resp, err := client.Get(ctx, resourceGroup, serviceName, name) + + if err != nil { + if !utils.ResponseWasNotFound(resp.Response) { + return err + } + } + + return nil + } + return nil +} + +func testCheckAzureRMAPIManagementNamedValueExists(resourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).ApiManagement.NamedValueClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + name := rs.Primary.Attributes["name"] + resourceGroup := rs.Primary.Attributes["resource_group_name"] + serviceName := rs.Primary.Attributes["api_management_name"] + + resp, err := client.Get(ctx, resourceGroup, serviceName, name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Bad: API Management Property %q (Resource Group %q / API Management Service %q) does not exist", name, resourceGroup, serviceName) + } + return fmt.Errorf("Bad: Get on apiManagement.NamedValueClient: %+v", err) + } + + return nil + } +} + +/* + + */ + +func testAccAzureRMAPIManagementNamedValue_basic(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_api_management" "test" { + name = "acctestAM-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + publisher_name = "pub1" + publisher_email = "pub1@email.com" + + sku_name = "Developer_1" +} + +resource "azurerm_api_management_named_value" "test" { + name = "acctestAMProperty-%d" + resource_group_name = azurerm_api_management.test.resource_group_name + api_management_name = azurerm_api_management.test.name + display_name = "TestProperty%d" + value = "Test Value" + tags = ["tag1", "tag2"] +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger) +} + +func testAccAzureRMAPIManagementNamedValue_update(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_api_management" "test" { + name = "acctestAM-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + publisher_name = "pub1" + publisher_email = "pub1@email.com" + + sku_name = "Developer_1" +} + +resource "azurerm_api_management_named_value" "test" { + name = "acctestAMProperty-%d" + resource_group_name = azurerm_api_management.test.resource_group_name + api_management_name = azurerm_api_management.test.name + display_name = "TestProperty2%d" + value = "Test Value2" + secret = true + tags = ["tag3", "tag4"] +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger, data.RandomInteger) +} diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_policy_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_policy_test.go index 79bcf035726cb..6249e8121d1b1 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_policy_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_policy_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" @@ -99,7 +100,7 @@ func testCheckAzureRMApiManagementProductPolicyExists(resourceName string) resou serviceName := rs.Primary.Attributes["api_management_name"] resourceGroup := rs.Primary.Attributes["resource_group_name"] - resp, err := conn.Get(ctx, resourceGroup, serviceName, productID) + resp, err := conn.Get(ctx, resourceGroup, serviceName, productID, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return fmt.Errorf("Bad: Product Policy (API Management Service %q / Product %q/ Resource Group %q) does not exist", serviceName, productID, resourceGroup) @@ -124,7 +125,7 @@ func testCheckAzureRMApiManagementProductPolicyDestroy(s *terraform.State) error productID := rs.Primary.Attributes["product_id"] serviceName := rs.Primary.Attributes["api_management_name"] resourceGroup := rs.Primary.Attributes["resource_group_name"] - resp, err := conn.Get(ctx, resourceGroup, serviceName, productID) + resp, err := conn.Get(ctx, resourceGroup, serviceName, productID, apimanagement.PolicyExportFormatXML) if err != nil { if utils.ResponseWasNotFound(resp.Response) { return nil diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go index a2cb8630738b6..a183a37d6c300 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go @@ -52,6 +52,7 @@ func TestAccAzureRMAPIManagementProperty_update(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "tags.1", "tag2"), ), }, + data.ImportStep(), { Config: testAccAzureRMAPIManagementProperty_update(data), Check: resource.ComposeTestCheckFunc( @@ -69,7 +70,7 @@ func TestAccAzureRMAPIManagementProperty_update(t *testing.T) { } func testCheckAzureRMAPIManagementPropertyDestroy(s *terraform.State) error { - client := acceptance.AzureProvider.Meta().(*clients.Client).ApiManagement.PropertyClient + client := acceptance.AzureProvider.Meta().(*clients.Client).ApiManagement.NamedValueClient ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext for _, rs := range s.RootModule().Resources { @@ -96,7 +97,7 @@ func testCheckAzureRMAPIManagementPropertyDestroy(s *terraform.State) error { func testCheckAzureRMAPIManagementPropertyExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - client := acceptance.AzureProvider.Meta().(*clients.Client).ApiManagement.PropertyClient + client := acceptance.AzureProvider.Meta().(*clients.Client).ApiManagement.NamedValueClient ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext rs, ok := s.RootModule().Resources[resourceName] @@ -113,7 +114,7 @@ func testCheckAzureRMAPIManagementPropertyExists(resourceName string) resource.T if utils.ResponseWasNotFound(resp.Response) { return fmt.Errorf("Bad: API Management Property %q (Resource Group %q / API Management Service %q) does not exist", name, resourceGroup, serviceName) } - return fmt.Errorf("Bad: Get on apiManagement.PropertyClient: %+v", err) + return fmt.Errorf("Bad: Get on apiManagement.NamedValueClient: %+v", err) } return nil diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go index a709f9c18c569..b9b029821e3ef 100644 --- a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go +++ b/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go @@ -24,8 +24,6 @@ func TestAccAzureRMAPIManagementSubscription_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testCheckAzureRMAPIManagementSubscriptionExists(data.ResourceName), resource.TestCheckResourceAttrSet(data.ResourceName, "subscription_id"), - resource.TestCheckResourceAttrSet(data.ResourceName, "primary_key"), - resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_key"), ), }, data.ImportStep(), @@ -46,8 +44,6 @@ func TestAccAzureRMAPIManagementSubscription_requiresImport(t *testing.T) { Check: resource.ComposeTestCheckFunc( testCheckAzureRMAPIManagementSubscriptionExists(data.ResourceName), resource.TestCheckResourceAttrSet(data.ResourceName, "subscription_id"), - resource.TestCheckResourceAttrSet(data.ResourceName, "primary_key"), - resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_key"), ), }, data.RequiresImportErrorStep(testAccAzureRMAPIManagementSubscription_requiresImport), @@ -69,8 +65,6 @@ func TestAccAzureRMAPIManagementSubscription_update(t *testing.T) { testCheckAzureRMAPIManagementSubscriptionExists(data.ResourceName), resource.TestCheckResourceAttr(data.ResourceName, "state", "submitted"), resource.TestCheckResourceAttrSet(data.ResourceName, "subscription_id"), - resource.TestCheckResourceAttrSet(data.ResourceName, "primary_key"), - resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_key"), ), }, { @@ -112,8 +106,6 @@ func TestAccAzureRMAPIManagementSubscription_complete(t *testing.T) { testCheckAzureRMAPIManagementSubscriptionExists(data.ResourceName), resource.TestCheckResourceAttr(data.ResourceName, "state", "active"), resource.TestCheckResourceAttrSet(data.ResourceName, "subscription_id"), - resource.TestCheckResourceAttrSet(data.ResourceName, "primary_key"), - resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_key"), ), }, data.ImportStep(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnosticlogger.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnosticlogger.go deleted file mode 100644 index 84f0176ba9574..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnosticlogger.go +++ /dev/null @@ -1,500 +0,0 @@ -package apimanagement - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// APIDiagnosticLoggerClient is the apiManagement Client -type APIDiagnosticLoggerClient struct { - BaseClient -} - -// NewAPIDiagnosticLoggerClient creates an instance of the APIDiagnosticLoggerClient client. -func NewAPIDiagnosticLoggerClient(subscriptionID string) APIDiagnosticLoggerClient { - return NewAPIDiagnosticLoggerClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewAPIDiagnosticLoggerClientWithBaseURI creates an instance of the APIDiagnosticLoggerClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewAPIDiagnosticLoggerClientWithBaseURI(baseURI string, subscriptionID string) APIDiagnosticLoggerClient { - return APIDiagnosticLoggerClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckEntityExists checks that logger entity specified by identifier is associated with the diagnostics entity. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// apiid - API identifier. Must be unique in the current API Management service instance. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client APIDiagnosticLoggerClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, loggerid string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIDiagnosticLoggerClient.CheckEntityExists") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: apiid, - Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.APIDiagnosticLoggerClient", "CheckEntityExists", err.Error()) - } - - req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, apiid, diagnosticID, loggerid) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "CheckEntityExists", nil, "Failure preparing request") - return - } - - resp, err := client.CheckEntityExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "CheckEntityExists", resp, "Failure sending request") - return - } - - result, err = client.CheckEntityExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "CheckEntityExists", resp, "Failure responding to request") - } - - return -} - -// CheckEntityExistsPreparer prepares the CheckEntityExists request. -func (client APIDiagnosticLoggerClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, loggerid string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "apiId": autorest.Encode("path", apiid), - "diagnosticId": autorest.Encode("path", diagnosticID), - "loggerid": autorest.Encode("path", loggerid), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers/{loggerid}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckEntityExistsSender sends the CheckEntityExists request. The method will close the -// http.Response Body if it receives an error. -func (client APIDiagnosticLoggerClient) CheckEntityExistsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CheckEntityExistsResponder handles the response to the CheckEntityExists request. The method always -// closes the http.Response Body. -func (client APIDiagnosticLoggerClient) CheckEntityExistsResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate attaches a logger to a diagnostic for an API. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// apiid - API identifier. Must be unique in the current API Management service instance. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client APIDiagnosticLoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, loggerid string) (result LoggerContract, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIDiagnosticLoggerClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: apiid, - Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.APIDiagnosticLoggerClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, diagnosticID, loggerid) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client APIDiagnosticLoggerClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, loggerid string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "apiId": autorest.Encode("path", apiid), - "diagnosticId": autorest.Encode("path", diagnosticID), - "loggerid": autorest.Encode("path", loggerid), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers/{loggerid}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client APIDiagnosticLoggerClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client APIDiagnosticLoggerClient) CreateOrUpdateResponder(resp *http.Response) (result LoggerContract, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Logger from Diagnostic for an API. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// apiid - API identifier. Must be unique in the current API Management service instance. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client APIDiagnosticLoggerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, loggerid string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIDiagnosticLoggerClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: apiid, - Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.APIDiagnosticLoggerClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, diagnosticID, loggerid) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client APIDiagnosticLoggerClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, loggerid string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "apiId": autorest.Encode("path", apiid), - "diagnosticId": autorest.Encode("path", diagnosticID), - "loggerid": autorest.Encode("path", loggerid), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers/{loggerid}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client APIDiagnosticLoggerClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client APIDiagnosticLoggerClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// ListByService lists all loggers associated with the specified Diagnostic of an API. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// apiid - API identifier. Must be unique in the current API Management service instance. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | type | eq | | -// top - number of records to return. -// skip - number of records to skip. -func (client APIDiagnosticLoggerClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, filter string, top *int32, skip *int32) (result LoggerCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIDiagnosticLoggerClient.ListByService") - defer func() { - sc := -1 - if result.lc.Response.Response != nil { - sc = result.lc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: apiid, - Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { - return result, validation.NewError("apimanagement.APIDiagnosticLoggerClient", "ListByService", err.Error()) - } - - result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, diagnosticID, filter, top, skip) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "ListByService", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServiceSender(req) - if err != nil { - result.lc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "ListByService", resp, "Failure sending request") - return - } - - result.lc, err = client.ListByServiceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "ListByService", resp, "Failure responding to request") - } - - return -} - -// ListByServicePreparer prepares the ListByService request. -func (client APIDiagnosticLoggerClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, filter string, top *int32, skip *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "apiId": autorest.Encode("path", apiid), - "diagnosticId": autorest.Encode("path", diagnosticID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/diagnostics/{diagnosticId}/loggers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServiceSender sends the ListByService request. The method will close the -// http.Response Body if it receives an error. -func (client APIDiagnosticLoggerClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServiceResponder handles the response to the ListByService request. The method always -// closes the http.Response Body. -func (client APIDiagnosticLoggerClient) ListByServiceResponder(resp *http.Response) (result LoggerCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServiceNextResults retrieves the next set of results, if any. -func (client APIDiagnosticLoggerClient) listByServiceNextResults(ctx context.Context, lastResults LoggerCollection) (result LoggerCollection, err error) { - req, err := lastResults.loggerCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "listByServiceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServiceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "listByServiceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServiceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIDiagnosticLoggerClient", "listByServiceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIDiagnosticLoggerClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, diagnosticID string, filter string, top *int32, skip *int32) (result LoggerCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIDiagnosticLoggerClient.ListByService") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, diagnosticID, filter, top, skip) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnosticlogger.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnosticlogger.go deleted file mode 100644 index 86d9a145d8606..0000000000000 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnosticlogger.go +++ /dev/null @@ -1,476 +0,0 @@ -package apimanagement - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -import ( - "context" - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/validation" - "github.com/Azure/go-autorest/tracing" - "net/http" -) - -// DiagnosticLoggerClient is the apiManagement Client -type DiagnosticLoggerClient struct { - BaseClient -} - -// NewDiagnosticLoggerClient creates an instance of the DiagnosticLoggerClient client. -func NewDiagnosticLoggerClient(subscriptionID string) DiagnosticLoggerClient { - return NewDiagnosticLoggerClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewDiagnosticLoggerClientWithBaseURI creates an instance of the DiagnosticLoggerClient client using a custom -// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure -// stack). -func NewDiagnosticLoggerClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticLoggerClient { - return DiagnosticLoggerClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CheckEntityExists checks that logger entity specified by identifier is associated with the diagnostics entity. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client DiagnosticLoggerClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, loggerid string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticLoggerClient.CheckEntityExists") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.DiagnosticLoggerClient", "CheckEntityExists", err.Error()) - } - - req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, diagnosticID, loggerid) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "CheckEntityExists", nil, "Failure preparing request") - return - } - - resp, err := client.CheckEntityExistsSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "CheckEntityExists", resp, "Failure sending request") - return - } - - result, err = client.CheckEntityExistsResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "CheckEntityExists", resp, "Failure responding to request") - } - - return -} - -// CheckEntityExistsPreparer prepares the CheckEntityExists request. -func (client DiagnosticLoggerClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, loggerid string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diagnosticId": autorest.Encode("path", diagnosticID), - "loggerid": autorest.Encode("path", loggerid), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsHead(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers/{loggerid}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CheckEntityExistsSender sends the CheckEntityExists request. The method will close the -// http.Response Body if it receives an error. -func (client DiagnosticLoggerClient) CheckEntityExistsSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CheckEntityExistsResponder handles the response to the CheckEntityExists request. The method always -// closes the http.Response Body. -func (client DiagnosticLoggerClient) CheckEntityExistsResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), - autorest.ByClosing()) - result.Response = resp - return -} - -// CreateOrUpdate attaches a logger to a diagnostic. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client DiagnosticLoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, loggerid string) (result LoggerContract, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticLoggerClient.CreateOrUpdate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.DiagnosticLoggerClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, diagnosticID, loggerid) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DiagnosticLoggerClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, loggerid string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diagnosticId": autorest.Encode("path", diagnosticID), - "loggerid": autorest.Encode("path", loggerid), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers/{loggerid}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the -// http.Response Body if it receives an error. -func (client DiagnosticLoggerClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client DiagnosticLoggerClient) CreateOrUpdateResponder(resp *http.Response) (result LoggerContract, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes the specified Logger from Diagnostic. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client DiagnosticLoggerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, loggerid string) (result autorest.Response, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticLoggerClient.Delete") - defer func() { - sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.DiagnosticLoggerClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, diagnosticID, loggerid) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client DiagnosticLoggerClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, loggerid string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diagnosticId": autorest.Encode("path", diagnosticID), - "loggerid": autorest.Encode("path", loggerid), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers/{loggerid}", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// DeleteSender sends the Delete request. The method will close the -// http.Response Body if it receives an error. -func (client DiagnosticLoggerClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client DiagnosticLoggerClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), - autorest.ByClosing()) - result.Response = resp - return -} - -// ListByService lists all loggers associated with the specified Diagnostic of the API Management service instance. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// diagnosticID - diagnostic identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | type | eq | | -// top - number of records to return. -// skip - number of records to skip. -func (client DiagnosticLoggerClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, filter string, top *int32, skip *int32) (result LoggerCollectionPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticLoggerClient.ListByService") - defer func() { - sc := -1 - if result.lc.Response.Response != nil { - sc = result.lc.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: diagnosticID, - Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: top, - Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, - {TargetValue: skip, - Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { - return result, validation.NewError("apimanagement.DiagnosticLoggerClient", "ListByService", err.Error()) - } - - result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, diagnosticID, filter, top, skip) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "ListByService", nil, "Failure preparing request") - return - } - - resp, err := client.ListByServiceSender(req) - if err != nil { - result.lc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "ListByService", resp, "Failure sending request") - return - } - - result.lc, err = client.ListByServiceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "ListByService", resp, "Failure responding to request") - } - - return -} - -// ListByServicePreparer prepares the ListByService request. -func (client DiagnosticLoggerClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, filter string, top *int32, skip *int32) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "diagnosticId": autorest.Encode("path", diagnosticID), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } - if top != nil { - queryParameters["$top"] = autorest.Encode("query", *top) - } - if skip != nil { - queryParameters["$skip"] = autorest.Encode("query", *skip) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/diagnostics/{diagnosticId}/loggers", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListByServiceSender sends the ListByService request. The method will close the -// http.Response Body if it receives an error. -func (client DiagnosticLoggerClient) ListByServiceSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListByServiceResponder handles the response to the ListByService request. The method always -// closes the http.Response Body. -func (client DiagnosticLoggerClient) ListByServiceResponder(resp *http.Response) (result LoggerCollection, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listByServiceNextResults retrieves the next set of results, if any. -func (client DiagnosticLoggerClient) listByServiceNextResults(ctx context.Context, lastResults LoggerCollection) (result LoggerCollection, err error) { - req, err := lastResults.loggerCollectionPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "listByServiceNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListByServiceSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "listByServiceNextResults", resp, "Failure sending next results request") - } - result, err = client.ListByServiceResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.DiagnosticLoggerClient", "listByServiceNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client DiagnosticLoggerClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, filter string, top *int32, skip *int32) (result LoggerCollectionIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticLoggerClient.ListByService") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, diagnosticID, filter, top, skip) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/api.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/api.go similarity index 91% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/api.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/api.go index 78b85c06e52f6..daf54dd9f0e3d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/api.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/api.go @@ -50,13 +50,13 @@ func NewAPIClientWithBaseURI(baseURI string, subscriptionID string) APIClient { // revision has ;rev=n as a suffix where n is the revision number. // parameters - create or update parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client APIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, parameters APICreateOrUpdateParameter, ifMatch string) (result APIContract, err error) { +func (client APIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, parameters APICreateOrUpdateParameter, ifMatch string) (result APICreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -79,18 +79,12 @@ func (client APIClient) CreateOrUpdate(ctx context.Context, resourceGroupName st return } - resp, err := client.CreateOrUpdateSender(req) + result, err = client.CreateOrUpdateSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "CreateOrUpdate", resp, "Failure responding to request") - } - return } @@ -103,7 +97,7 @@ func (client APIClient) CreateOrUpdatePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -124,8 +118,14 @@ func (client APIClient) CreateOrUpdatePreparer(ctx context.Context, resourceGrou // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client APIClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client APIClient) CreateOrUpdateSender(req *http.Request) (future APICreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -134,7 +134,7 @@ func (client APIClient) CreateOrUpdateResponder(resp *http.Response) (result API err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -203,7 +203,7 @@ func (client APIClient) DeletePreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -297,7 +297,7 @@ func (client APIClient) GetPreparer(ctx context.Context, resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -388,7 +388,7 @@ func (client APIClient) GetEntityTagPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -423,17 +423,18 @@ func (client APIClient) GetEntityTagResponder(resp *http.Response) (result autor // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | serviceUrl | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | path | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. +// tags - include tags in the response. // expandAPIVersionSet - include full ApiVersionSet resource in response -func (client APIClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandAPIVersionSet *bool) (result APICollectionPage, err error) { +func (client APIClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, tags string, expandAPIVersionSet *bool) (result APICollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIClient.ListByService") defer func() { @@ -459,7 +460,7 @@ func (client APIClient) ListByService(ctx context.Context, resourceGroupName str } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, expandAPIVersionSet) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, tags, expandAPIVersionSet) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "ListByService", nil, "Failure preparing request") return @@ -481,14 +482,14 @@ func (client APIClient) ListByService(ctx context.Context, resourceGroupName str } // ListByServicePreparer prepares the ListByService request. -func (client APIClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandAPIVersionSet *bool) (*http.Request, error) { +func (client APIClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, tags string, expandAPIVersionSet *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -501,10 +502,11 @@ func (client APIClient) ListByServicePreparer(ctx context.Context, resourceGroup if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(tags) > 0 { + queryParameters["tags"] = autorest.Encode("query", tags) + } if expandAPIVersionSet != nil { queryParameters["expandApiVersionSet"] = autorest.Encode("query", *expandAPIVersionSet) - } else { - queryParameters["expandApiVersionSet"] = autorest.Encode("query", false) } preparer := autorest.CreatePreparer( @@ -556,7 +558,7 @@ func (client APIClient) listByServiceNextResults(ctx context.Context, lastResult } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandAPIVersionSet *bool) (result APICollectionIterator, err error) { +func (client APIClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, tags string, expandAPIVersionSet *bool) (result APICollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIClient.ListByService") defer func() { @@ -567,7 +569,7 @@ func (client APIClient) ListByServiceComplete(ctx context.Context, resourceGroup tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, expandAPIVersionSet) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, tags, expandAPIVersionSet) return } @@ -575,19 +577,20 @@ func (client APIClient) ListByServiceComplete(ctx context.Context, resourceGroup // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | isCurrent | eq | substringof, contains, startswith, endswith | +// filter - | Field | Supported operators | Supported functions | +// |-------------|------------------------|-----------------------------------| +// +// |name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// |displayName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// |apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// |path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// |description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// |serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// |isCurrent | eq | | // top - number of records to return. // skip - number of records to skip. -func (client APIClient) ListByTags(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagResourceCollectionPage, err error) { +// includeNotTaggedApis - include not tagged APIs. +func (client APIClient) ListByTags(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, includeNotTaggedApis *bool) (result TagResourceCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIClient.ListByTags") defer func() { @@ -613,7 +616,7 @@ func (client APIClient) ListByTags(ctx context.Context, resourceGroupName string } result.fn = client.listByTagsNextResults - req, err := client.ListByTagsPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByTagsPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, includeNotTaggedApis) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIClient", "ListByTags", nil, "Failure preparing request") return @@ -635,14 +638,14 @@ func (client APIClient) ListByTags(ctx context.Context, resourceGroupName string } // ListByTagsPreparer prepares the ListByTags request. -func (client APIClient) ListByTagsPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client APIClient) ListByTagsPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, includeNotTaggedApis *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -655,6 +658,9 @@ func (client APIClient) ListByTagsPreparer(ctx context.Context, resourceGroupNam if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if includeNotTaggedApis != nil { + queryParameters["includeNotTaggedApis"] = autorest.Encode("query", *includeNotTaggedApis) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -705,7 +711,7 @@ func (client APIClient) listByTagsNextResults(ctx context.Context, lastResults T } // ListByTagsComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIClient) ListByTagsComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagResourceCollectionIterator, err error) { +func (client APIClient) ListByTagsComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, includeNotTaggedApis *bool) (result TagResourceCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIClient.ListByTags") defer func() { @@ -716,7 +722,7 @@ func (client APIClient) ListByTagsComplete(ctx context.Context, resourceGroupNam tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByTags(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByTags(ctx, resourceGroupName, serviceName, filter, top, skip, includeNotTaggedApis) return } @@ -782,7 +788,7 @@ func (client APIClient) UpdatePreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnostic.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apidiagnostic.go similarity index 87% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnostic.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apidiagnostic.go index ed355bf253157..c662aac38f004 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apidiagnostic.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apidiagnostic.go @@ -68,15 +68,49 @@ func (client APIDiagnosticClient) CreateOrUpdate(ctx context.Context, resourceGr {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.LoggerID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DiagnosticContractProperties.Sampling", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Frontend", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Frontend.Response", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Backend", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Backend.Response", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + }}, + }}}}}); err != nil { return result, validation.NewError("apimanagement.APIDiagnosticClient", "CreateOrUpdate", err.Error()) } @@ -111,7 +145,7 @@ func (client APIDiagnosticClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -175,12 +209,11 @@ func (client APIDiagnosticClient) Delete(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIDiagnosticClient", "Delete", err.Error()) } @@ -215,7 +248,7 @@ func (client APIDiagnosticClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -271,12 +304,11 @@ func (client APIDiagnosticClient) Get(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIDiagnosticClient", "Get", err.Error()) } @@ -311,7 +343,7 @@ func (client APIDiagnosticClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -367,12 +399,11 @@ func (client APIDiagnosticClient) GetEntityTag(ctx context.Context, resourceGrou {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIDiagnosticClient", "GetEntityTag", err.Error()) } @@ -407,7 +438,7 @@ func (client APIDiagnosticClient) GetEntityTagPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -443,9 +474,9 @@ func (client APIDiagnosticClient) GetEntityTagResponder(resp *http.Response) (re // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client APIDiagnosticClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result DiagnosticCollectionPage, err error) { @@ -466,8 +497,7 @@ func (client APIDiagnosticClient) ListByService(ctx context.Context, resourceGro {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -508,7 +538,7 @@ func (client APIDiagnosticClient) ListByServicePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -613,12 +643,11 @@ func (client APIDiagnosticClient) Update(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIDiagnosticClient", "Update", err.Error()) } @@ -653,7 +682,7 @@ func (client APIDiagnosticClient) UpdatePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiexport.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiexport.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiexport.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiexport.go index 5f0356cd9221e..849552b455c4f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiexport.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiexport.go @@ -104,7 +104,7 @@ func (client APIExportClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "export": autorest.Encode("query", "true"), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissue.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissue.go similarity index 92% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissue.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissue.go index 98124a95ac868..2dd822dd10f1c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissue.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissue.go @@ -49,8 +49,7 @@ func NewAPIIssueClientWithBaseURI(baseURI string, subscriptionID string) APIIssu // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. // parameters - create parameters. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. func (client APIIssueClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, parameters IssueContract, ifMatch string) (result IssueContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueClient.CreateOrUpdate") @@ -69,8 +68,7 @@ func (client APIIssueClient) CreateOrUpdate(ctx context.Context, resourceGroupNa {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -115,7 +113,7 @@ func (client APIIssueClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -159,8 +157,8 @@ func (client APIIssueClient) CreateOrUpdateResponder(resp *http.Response) (resul // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. func (client APIIssueClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueClient.Delete") @@ -179,8 +177,7 @@ func (client APIIssueClient) Delete(ctx context.Context, resourceGroupName strin {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -219,7 +216,7 @@ func (client APIIssueClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -257,7 +254,8 @@ func (client APIIssueClient) DeleteResponder(resp *http.Response) (result autore // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. -func (client APIIssueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string) (result IssueContract, err error) { +// expandCommentsAttachments - expand the comment attachments. +func (client APIIssueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, expandCommentsAttachments *bool) (result IssueContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueClient.Get") defer func() { @@ -275,8 +273,7 @@ func (client APIIssueClient) Get(ctx context.Context, resourceGroupName string, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -284,7 +281,7 @@ func (client APIIssueClient) Get(ctx context.Context, resourceGroupName string, return result, validation.NewError("apimanagement.APIIssueClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, issueID) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, issueID, expandCommentsAttachments) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "Get", nil, "Failure preparing request") return @@ -306,7 +303,7 @@ func (client APIIssueClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client APIIssueClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string) (*http.Request, error) { +func (client APIIssueClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, expandCommentsAttachments *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "issueId": autorest.Encode("path", issueID), @@ -315,10 +312,13 @@ func (client APIIssueClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if expandCommentsAttachments != nil { + queryParameters["expandCommentsAttachments"] = autorest.Encode("query", *expandCommentsAttachments) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -371,8 +371,7 @@ func (client APIIssueClient) GetEntityTag(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -411,7 +410,7 @@ func (client APIIssueClient) GetEntityTagPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -447,14 +446,14 @@ func (client APIIssueClient) GetEntityTagResponder(resp *http.Response) (result // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | state | eq | | -// | userId | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| state | filter | eq | |
+// expandCommentsAttachments - expand the comment attachments. // top - number of records to return. // skip - number of records to skip. -func (client APIIssueClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result IssueCollectionPage, err error) { +func (client APIIssueClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, expandCommentsAttachments *bool, top *int32, skip *int32) (result IssueCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueClient.ListByService") defer func() { @@ -472,8 +471,7 @@ func (client APIIssueClient) ListByService(ctx context.Context, resourceGroupNam {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -484,7 +482,7 @@ func (client APIIssueClient) ListByService(ctx context.Context, resourceGroupNam } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, filter, expandCommentsAttachments, top, skip) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIIssueClient", "ListByService", nil, "Failure preparing request") return @@ -506,7 +504,7 @@ func (client APIIssueClient) ListByService(ctx context.Context, resourceGroupNam } // ListByServicePreparer prepares the ListByService request. -func (client APIIssueClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client APIIssueClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, expandCommentsAttachments *bool, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -514,13 +512,16 @@ func (client APIIssueClient) ListByServicePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } if len(filter) > 0 { queryParameters["$filter"] = autorest.Encode("query", filter) } + if expandCommentsAttachments != nil { + queryParameters["expandCommentsAttachments"] = autorest.Encode("query", *expandCommentsAttachments) + } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } @@ -577,7 +578,7 @@ func (client APIIssueClient) listByServiceNextResults(ctx context.Context, lastR } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIIssueClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result IssueCollectionIterator, err error) { +func (client APIIssueClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, expandCommentsAttachments *bool, top *int32, skip *int32) (result IssueCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueClient.ListByService") defer func() { @@ -588,7 +589,7 @@ func (client APIIssueClient) ListByServiceComplete(ctx context.Context, resource tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, expandCommentsAttachments, top, skip) return } @@ -599,8 +600,8 @@ func (client APIIssueClient) ListByServiceComplete(ctx context.Context, resource // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. // parameters - update parameters. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. func (client APIIssueClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, parameters IssueUpdateContract, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueClient.Update") @@ -619,8 +620,7 @@ func (client APIIssueClient) Update(ctx context.Context, resourceGroupName strin {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -659,7 +659,7 @@ func (client APIIssueClient) UpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -670,11 +670,8 @@ func (client APIIssueClient) UpdatePreparer(ctx context.Context, resourceGroupNa autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/issues/{issueId}", pathParameters), autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissueattachment.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissueattachment.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissueattachment.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissueattachment.go index 645b80bcfeefd..ca88a7a534678 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissueattachment.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissueattachment.go @@ -51,8 +51,7 @@ func NewAPIIssueAttachmentClientWithBaseURI(baseURI string, subscriptionID strin // issueID - issue identifier. Must be unique in the current API Management service instance. // attachmentID - attachment identifier within an Issue. Must be unique in the current Issue. // parameters - create parameters. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. func (client APIIssueAttachmentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, attachmentID string, parameters IssueAttachmentContract, ifMatch string) (result IssueAttachmentContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueAttachmentClient.CreateOrUpdate") @@ -71,8 +70,7 @@ func (client APIIssueAttachmentClient) CreateOrUpdate(ctx context.Context, resou {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -122,7 +120,7 @@ func (client APIIssueAttachmentClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -167,8 +165,8 @@ func (client APIIssueAttachmentClient) CreateOrUpdateResponder(resp *http.Respon // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. // attachmentID - attachment identifier within an Issue. Must be unique in the current Issue. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. func (client APIIssueAttachmentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, attachmentID string, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueAttachmentClient.Delete") @@ -187,8 +185,7 @@ func (client APIIssueAttachmentClient) Delete(ctx context.Context, resourceGroup {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -232,7 +229,7 @@ func (client APIIssueAttachmentClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -289,8 +286,7 @@ func (client APIIssueAttachmentClient) Get(ctx context.Context, resourceGroupNam {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -334,7 +330,7 @@ func (client APIIssueAttachmentClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -391,8 +387,7 @@ func (client APIIssueAttachmentClient) GetEntityTag(ctx context.Context, resourc {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -436,7 +431,7 @@ func (client APIIssueAttachmentClient) GetEntityTagPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -467,16 +462,16 @@ func (client APIIssueAttachmentClient) GetEntityTagResponder(resp *http.Response return } -// ListByService lists all comments for the Issue associated with the specified API. +// ListByService lists all attachments for the Issue associated with the specified API. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | userId | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client APIIssueAttachmentClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, filter string, top *int32, skip *int32) (result IssueAttachmentCollectionPage, err error) { @@ -497,8 +492,7 @@ func (client APIIssueAttachmentClient) ListByService(ctx context.Context, resour {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -544,7 +538,7 @@ func (client APIIssueAttachmentClient) ListByServicePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissuecomment.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissuecomment.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissuecomment.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissuecomment.go index 126a11d74472e..ff2891dba47bd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiissuecomment.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiissuecomment.go @@ -50,8 +50,7 @@ func NewAPIIssueCommentClientWithBaseURI(baseURI string, subscriptionID string) // issueID - issue identifier. Must be unique in the current API Management service instance. // commentID - comment identifier within an Issue. Must be unique in the current Issue. // parameters - create parameters. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. func (client APIIssueCommentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, commentID string, parameters IssueCommentContract, ifMatch string) (result IssueCommentContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueCommentClient.CreateOrUpdate") @@ -70,8 +69,7 @@ func (client APIIssueCommentClient) CreateOrUpdate(ctx context.Context, resource {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -120,7 +118,7 @@ func (client APIIssueCommentClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,8 +163,8 @@ func (client APIIssueCommentClient) CreateOrUpdateResponder(resp *http.Response) // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. // commentID - comment identifier within an Issue. Must be unique in the current Issue. -// ifMatch - eTag of the Issue Entity. ETag should match the current entity state from the header response of -// the GET request or it should be * for unconditional update. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. func (client APIIssueCommentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, commentID string, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIIssueCommentClient.Delete") @@ -185,8 +183,7 @@ func (client APIIssueCommentClient) Delete(ctx context.Context, resourceGroupNam {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -230,7 +227,7 @@ func (client APIIssueCommentClient) DeletePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -287,8 +284,7 @@ func (client APIIssueCommentClient) Get(ctx context.Context, resourceGroupName s {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -332,7 +328,7 @@ func (client APIIssueCommentClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -389,8 +385,7 @@ func (client APIIssueCommentClient) GetEntityTag(ctx context.Context, resourceGr {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -434,7 +429,7 @@ func (client APIIssueCommentClient) GetEntityTagPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -471,10 +466,10 @@ func (client APIIssueCommentClient) GetEntityTagResponder(resp *http.Response) ( // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. // issueID - issue identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | userId | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client APIIssueCommentClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, issueID string, filter string, top *int32, skip *int32) (result IssueCommentCollectionPage, err error) { @@ -495,8 +490,7 @@ func (client APIIssueCommentClient) ListByService(ctx context.Context, resourceG {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: issueID, Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -542,7 +536,7 @@ func (client APIIssueCommentClient) ListByServicePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apioperation.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apioperation.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apioperation.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apioperation.go index 16dfd9f4890fb..600a656a9a3fe 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apioperation.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apioperation.go @@ -74,8 +74,7 @@ func (client APIOperationClient) CreateOrUpdate(ctx context.Context, resourceGro {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.OperationContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.OperationContractProperties.DisplayName", Name: validation.Null, Rule: true, @@ -122,7 +121,7 @@ func (client APIOperationClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -192,8 +191,7 @@ func (client APIOperationClient) Delete(ctx context.Context, resourceGroupName s {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationClient", "Delete", err.Error()) } @@ -228,7 +226,7 @@ func (client APIOperationClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -290,8 +288,7 @@ func (client APIOperationClient) Get(ctx context.Context, resourceGroupName stri {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationClient", "Get", err.Error()) } @@ -326,7 +323,7 @@ func (client APIOperationClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -388,8 +385,7 @@ func (client APIOperationClient) GetEntityTag(ctx context.Context, resourceGroup {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationClient", "GetEntityTag", err.Error()) } @@ -424,7 +420,7 @@ func (client APIOperationClient) GetEntityTagPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -461,15 +457,17 @@ func (client APIOperationClient) GetEntityTagResponder(resp *http.Response) (res // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | name | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | method | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | -// | urlTemplate | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client APIOperationClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result OperationCollectionPage, err error) { +// tags - include tags in the response. +func (client APIOperationClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32, tags string) (result OperationCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIOperationClient.ListByAPI") defer func() { @@ -499,7 +497,7 @@ func (client APIOperationClient) ListByAPI(ctx context.Context, resourceGroupNam } result.fn = client.listByAPINextResults - req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip, tags) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIOperationClient", "ListByAPI", nil, "Failure preparing request") return @@ -521,7 +519,7 @@ func (client APIOperationClient) ListByAPI(ctx context.Context, resourceGroupNam } // ListByAPIPreparer prepares the ListByAPI request. -func (client APIOperationClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client APIOperationClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32, tags string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -529,7 +527,7 @@ func (client APIOperationClient) ListByAPIPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -542,6 +540,9 @@ func (client APIOperationClient) ListByAPIPreparer(ctx context.Context, resource if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(tags) > 0 { + queryParameters["tags"] = autorest.Encode("query", tags) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -592,7 +593,7 @@ func (client APIOperationClient) listByAPINextResults(ctx context.Context, lastR } // ListByAPIComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIOperationClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result OperationCollectionIterator, err error) { +func (client APIOperationClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32, tags string) (result OperationCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIOperationClient.ListByAPI") defer func() { @@ -603,7 +604,7 @@ func (client APIOperationClient) ListByAPIComplete(ctx context.Context, resource tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid, filter, top, skip, tags) return } @@ -640,8 +641,7 @@ func (client APIOperationClient) Update(ctx context.Context, resourceGroupName s {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationClient", "Update", err.Error()) } @@ -676,7 +676,7 @@ func (client APIOperationClient) UpdatePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apioperationpolicy.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apioperationpolicy.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apioperationpolicy.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apioperationpolicy.go index ca0203ff7f6c2..218fa9515218b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apioperationpolicy.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apioperationpolicy.go @@ -75,11 +75,10 @@ func (client APIOperationPolicyClient) CreateOrUpdate(ctx context.Context, resou {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.PolicyContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.PolicyContent", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.Value", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationPolicyClient", "CreateOrUpdate", err.Error()) } @@ -115,7 +114,7 @@ func (client APIOperationPolicyClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -185,8 +184,7 @@ func (client APIOperationPolicyClient) Delete(ctx context.Context, resourceGroup {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationPolicyClient", "Delete", err.Error()) } @@ -222,7 +220,7 @@ func (client APIOperationPolicyClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -262,7 +260,8 @@ func (client APIOperationPolicyClient) DeleteResponder(resp *http.Response) (res // revision has ;rev=n as a suffix where n is the revision number. // operationID - operation identifier within an API. Must be unique in the current API Management service // instance. -func (client APIOperationPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (result PolicyContract, err error) { +// formatParameter - policy Export Format. +func (client APIOperationPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, formatParameter PolicyExportFormat) (result PolicyContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIOperationPolicyClient.Get") defer func() { @@ -284,12 +283,11 @@ func (client APIOperationPolicyClient) Get(ctx context.Context, resourceGroupNam {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationPolicyClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, operationID) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, formatParameter) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIOperationPolicyClient", "Get", nil, "Failure preparing request") return @@ -311,7 +309,7 @@ func (client APIOperationPolicyClient) Get(ctx context.Context, resourceGroupNam } // GetPreparer prepares the Get request. -func (client APIOperationPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string) (*http.Request, error) { +func (client APIOperationPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, formatParameter PolicyExportFormat) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "operationId": autorest.Encode("path", operationID), @@ -321,10 +319,15 @@ func (client APIOperationPolicyClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(formatParameter)) > 0 { + queryParameters["format"] = autorest.Encode("query", formatParameter) + } else { + queryParameters["format"] = autorest.Encode("query", "xml") + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -383,8 +386,7 @@ func (client APIOperationPolicyClient) GetEntityTag(ctx context.Context, resourc {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationPolicyClient", "GetEntityTag", err.Error()) } @@ -420,7 +422,7 @@ func (client APIOperationPolicyClient) GetEntityTagPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -481,8 +483,7 @@ func (client APIOperationPolicyClient) ListByOperation(ctx context.Context, reso {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIOperationPolicyClient", "ListByOperation", err.Error()) } @@ -517,7 +518,7 @@ func (client APIOperationPolicyClient) ListByOperationPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apipolicy.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apipolicy.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apipolicy.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apipolicy.go index f48c89b596211..3b7044fc0b1eb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apipolicy.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apipolicy.go @@ -72,7 +72,7 @@ func (client APIPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupN {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.PolicyContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.PolicyContent", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.Value", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.APIPolicyClient", "CreateOrUpdate", err.Error()) } @@ -107,7 +107,7 @@ func (client APIPolicyClient) CreateOrUpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -207,7 +207,7 @@ func (client APIPolicyClient) DeletePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -245,7 +245,8 @@ func (client APIPolicyClient) DeleteResponder(resp *http.Response) (result autor // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -func (client APIPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (result PolicyContract, err error) { +// formatParameter - policy Export Format. +func (client APIPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, formatParameter PolicyExportFormat) (result PolicyContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APIPolicyClient.Get") defer func() { @@ -268,7 +269,7 @@ func (client APIPolicyClient) Get(ctx context.Context, resourceGroupName string, return result, validation.NewError("apimanagement.APIPolicyClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, formatParameter) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APIPolicyClient", "Get", nil, "Failure preparing request") return @@ -290,7 +291,7 @@ func (client APIPolicyClient) Get(ctx context.Context, resourceGroupName string, } // GetPreparer prepares the Get request. -func (client APIPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (*http.Request, error) { +func (client APIPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, formatParameter PolicyExportFormat) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "policyId": autorest.Encode("path", "policy"), @@ -299,10 +300,15 @@ func (client APIPolicyClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(formatParameter)) > 0 { + queryParameters["format"] = autorest.Encode("query", formatParameter) + } else { + queryParameters["format"] = autorest.Encode("query", "xml") + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -391,7 +397,7 @@ func (client APIPolicyClient) GetEntityTagPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -481,7 +487,7 @@ func (client APIPolicyClient) ListByAPIPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiproduct.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiproduct.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiproduct.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiproduct.go index e96239f2ff35f..eae723989954c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiproduct.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiproduct.go @@ -47,9 +47,9 @@ func NewAPIProductClientWithBaseURI(baseURI string, subscriptionID string) APIPr // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|---------------------------------------------| -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client APIProductClient) ListByApis(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result ProductCollectionPage, err error) { @@ -70,8 +70,7 @@ func (client APIProductClient) ListByApis(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -112,7 +111,7 @@ func (client APIProductClient) ListByApisPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apirelease.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apirelease.go similarity index 82% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apirelease.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apirelease.go index 8628f4fb0e53c..a68c1eeeee913 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apirelease.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apirelease.go @@ -42,16 +42,17 @@ func NewAPIReleaseClientWithBaseURI(baseURI string, subscriptionID string) APIRe return APIReleaseClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Create creates a new Release for the API. +// CreateOrUpdate creates a new Release for the API. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. // releaseID - release identifier within an API. Must be unique in the current API Management service instance. // parameters - create parameters. -func (client APIReleaseClient) Create(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, parameters APIReleaseContract) (result APIReleaseContract, err error) { +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client APIReleaseClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, parameters APIReleaseContract, ifMatch string) (result APIReleaseContract, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseClient.Create") + ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseClient.CreateOrUpdate") defer func() { sc := -1 if result.Response.Response != nil { @@ -67,38 +68,37 @@ func (client APIReleaseClient) Create(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: releaseID, Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.APIReleaseClient", "Create", err.Error()) + {Target: "releaseID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APIReleaseClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreatePreparer(ctx, resourceGroupName, serviceName, apiid, releaseID, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, releaseID, parameters, ifMatch) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Create", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "CreateOrUpdate", nil, "Failure preparing request") return } - resp, err := client.CreateSender(req) + resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Create", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "CreateOrUpdate", resp, "Failure sending request") return } - result, err = client.CreateResponder(resp) + result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "Create", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "CreateOrUpdate", resp, "Failure responding to request") } return } -// CreatePreparer prepares the Create request. -func (client APIReleaseClient) CreatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, parameters APIReleaseContract) (*http.Request, error) { +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client APIReleaseClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, releaseID string, parameters APIReleaseContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "releaseId": autorest.Encode("path", releaseID), @@ -107,7 +107,7 @@ func (client APIReleaseClient) CreatePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -119,18 +119,22 @@ func (client APIReleaseClient) CreatePreparer(ctx context.Context, resourceGroup autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/releases/{releaseId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// CreateSender sends the Create request. The method will close the +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client APIReleaseClient) CreateSender(req *http.Request) (*http.Response, error) { +func (client APIReleaseClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// CreateResponder handles the response to the Create request. The method always +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client APIReleaseClient) CreateResponder(resp *http.Response) (result APIReleaseContract, err error) { +func (client APIReleaseClient) CreateOrUpdateResponder(resp *http.Response) (result APIReleaseContract, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -167,12 +171,11 @@ func (client APIReleaseClient) Delete(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: releaseID, Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "releaseID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIReleaseClient", "Delete", err.Error()) } @@ -207,7 +210,7 @@ func (client APIReleaseClient) DeletePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -263,12 +266,11 @@ func (client APIReleaseClient) Get(ctx context.Context, resourceGroupName string {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: releaseID, Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "releaseID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIReleaseClient", "Get", err.Error()) } @@ -303,7 +305,7 @@ func (client APIReleaseClient) GetPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -359,12 +361,11 @@ func (client APIReleaseClient) GetEntityTag(ctx context.Context, resourceGroupNa {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: releaseID, Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "releaseID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIReleaseClient", "GetEntityTag", err.Error()) } @@ -399,7 +400,7 @@ func (client APIReleaseClient) GetEntityTagPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -430,22 +431,21 @@ func (client APIReleaseClient) GetEntityTagResponder(resp *http.Response) (resul return } -// List lists all releases of an API. An API release is created when making an API Revision current. Releases are also -// used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip +// ListByService lists all releases of an API. An API release is created when making an API Revision current. Releases +// are also used to rollback to previous revisions. Results will be paged and can be constrained by the $top and $skip // parameters. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|---------------------------------------------| -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// |notes|ge le eq ne gt lt|substringof contains startswith endswith| +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| notes | filter | ge, le, eq, ne, gt, +// lt | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client APIReleaseClient) List(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIReleaseCollectionPage, err error) { +func (client APIReleaseClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIReleaseCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseClient.ListByService") defer func() { sc := -1 if result.arc.Response.Response != nil { @@ -461,41 +461,40 @@ func (client APIReleaseClient) List(ctx context.Context, resourceGroupName strin {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { - return result, validation.NewError("apimanagement.APIReleaseClient", "List", err.Error()) + return result, validation.NewError("apimanagement.APIReleaseClient", "ListByService", err.Error()) } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "ListByService", nil, "Failure preparing request") return } - resp, err := client.ListSender(req) + resp, err := client.ListByServiceSender(req) if err != nil { result.arc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "ListByService", resp, "Failure sending request") return } - result.arc, err = client.ListResponder(resp) + result.arc, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "ListByService", resp, "Failure responding to request") } return } -// ListPreparer prepares the List request. -func (client APIReleaseClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { +// ListByServicePreparer prepares the ListByService request. +func (client APIReleaseClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -503,7 +502,7 @@ func (client APIReleaseClient) ListPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -525,15 +524,15 @@ func (client APIReleaseClient) ListPreparer(ctx context.Context, resourceGroupNa return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListSender sends the List request. The method will close the +// ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. -func (client APIReleaseClient) ListSender(req *http.Request) (*http.Response, error) { +func (client APIReleaseClient) ListByServiceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListResponder handles the response to the List request. The method always +// ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client APIReleaseClient) ListResponder(resp *http.Response) (result APIReleaseCollection, err error) { +func (client APIReleaseClient) ListByServiceResponder(resp *http.Response) (result APIReleaseCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -544,31 +543,31 @@ func (client APIReleaseClient) ListResponder(resp *http.Response) (result APIRel return } -// listNextResults retrieves the next set of results, if any. -func (client APIReleaseClient) listNextResults(ctx context.Context, lastResults APIReleaseCollection) (result APIReleaseCollection, err error) { +// listByServiceNextResults retrieves the next set of results, if any. +func (client APIReleaseClient) listByServiceNextResults(ctx context.Context, lastResults APIReleaseCollection) (result APIReleaseCollection, err error) { req, err := lastResults.aPIReleaseCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listByServiceNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListSender(req) + resp, err := client.ListByServiceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listByServiceNextResults", resp, "Failure sending next results request") } - result, err = client.ListResponder(resp) + result, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "apimanagement.APIReleaseClient", "listByServiceNextResults", resp, "Failure responding to next results request") } return } -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIReleaseClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIReleaseCollectionIterator, err error) { +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIReleaseClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIReleaseCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/APIReleaseClient.ListByService") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -577,7 +576,7 @@ func (client APIReleaseClient) ListComplete(ctx context.Context, resourceGroupNa tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) return } @@ -608,12 +607,11 @@ func (client APIReleaseClient) Update(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: releaseID, Constraints: []validation.Constraint{{Target: "releaseID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "releaseID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "releaseID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "releaseID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIReleaseClient", "Update", err.Error()) } @@ -648,7 +646,7 @@ func (client APIReleaseClient) UpdatePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apirevisions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apirevision.go similarity index 60% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apirevisions.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apirevision.go index ef6335b07d1bf..1365912bdf1ab 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apirevisions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apirevision.go @@ -26,36 +26,35 @@ import ( "net/http" ) -// APIRevisionsClient is the apiManagement Client -type APIRevisionsClient struct { +// APIRevisionClient is the apiManagement Client +type APIRevisionClient struct { BaseClient } -// NewAPIRevisionsClient creates an instance of the APIRevisionsClient client. -func NewAPIRevisionsClient(subscriptionID string) APIRevisionsClient { - return NewAPIRevisionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewAPIRevisionClient creates an instance of the APIRevisionClient client. +func NewAPIRevisionClient(subscriptionID string) APIRevisionClient { + return NewAPIRevisionClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewAPIRevisionsClientWithBaseURI creates an instance of the APIRevisionsClient client using a custom endpoint. Use +// NewAPIRevisionClientWithBaseURI creates an instance of the APIRevisionClient client using a custom endpoint. Use // this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewAPIRevisionsClientWithBaseURI(baseURI string, subscriptionID string) APIRevisionsClient { - return APIRevisionsClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewAPIRevisionClientWithBaseURI(baseURI string, subscriptionID string) APIRevisionClient { + return APIRevisionClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all revisions of an API. +// ListByService lists all revisions of an API. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// -// |apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| apiRevision | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client APIRevisionsClient) List(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIRevisionCollectionPage, err error) { +func (client APIRevisionClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIRevisionCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionsClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionClient.ListByService") defer func() { sc := -1 if result.arc.Response.Response != nil { @@ -71,41 +70,40 @@ func (client APIRevisionsClient) List(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { - return result, validation.NewError("apimanagement.APIRevisionsClient", "List", err.Error()) + return result, validation.NewError("apimanagement.APIRevisionClient", "ListByService", err.Error()) } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "List", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionClient", "ListByService", nil, "Failure preparing request") return } - resp, err := client.ListSender(req) + resp, err := client.ListByServiceSender(req) if err != nil { result.arc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "List", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionClient", "ListByService", resp, "Failure sending request") return } - result.arc, err = client.ListResponder(resp) + result.arc, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "List", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionClient", "ListByService", resp, "Failure responding to request") } return } -// ListPreparer prepares the List request. -func (client APIRevisionsClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { +// ListByServicePreparer prepares the ListByService request. +func (client APIRevisionClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -113,7 +111,7 @@ func (client APIRevisionsClient) ListPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -135,15 +133,15 @@ func (client APIRevisionsClient) ListPreparer(ctx context.Context, resourceGroup return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListSender sends the List request. The method will close the +// ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. -func (client APIRevisionsClient) ListSender(req *http.Request) (*http.Response, error) { +func (client APIRevisionClient) ListByServiceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListResponder handles the response to the List request. The method always +// ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client APIRevisionsClient) ListResponder(resp *http.Response) (result APIRevisionCollection, err error) { +func (client APIRevisionClient) ListByServiceResponder(resp *http.Response) (result APIRevisionCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -154,31 +152,31 @@ func (client APIRevisionsClient) ListResponder(resp *http.Response) (result APIR return } -// listNextResults retrieves the next set of results, if any. -func (client APIRevisionsClient) listNextResults(ctx context.Context, lastResults APIRevisionCollection) (result APIRevisionCollection, err error) { +// listByServiceNextResults retrieves the next set of results, if any. +func (client APIRevisionClient) listByServiceNextResults(ctx context.Context, lastResults APIRevisionCollection) (result APIRevisionCollection, err error) { req, err := lastResults.aPIRevisionCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "listNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.APIRevisionClient", "listByServiceNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListSender(req) + resp, err := client.ListByServiceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "listNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.APIRevisionClient", "listByServiceNextResults", resp, "Failure sending next results request") } - result, err = client.ListResponder(resp) + result, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionsClient", "listNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "apimanagement.APIRevisionClient", "listByServiceNextResults", resp, "Failure responding to next results request") } return } -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client APIRevisionsClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIRevisionCollectionIterator, err error) { +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client APIRevisionClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result APIRevisionCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionsClient.List") + ctx = tracing.StartSpan(ctx, fqdn+"/APIRevisionClient.ListByService") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -187,6 +185,6 @@ func (client APIRevisionsClient) ListComplete(ctx context.Context, resourceGroup tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apischema.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apischema.go similarity index 89% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apischema.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apischema.go index 08a4758d7b98c..5527fb24fe631 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apischema.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apischema.go @@ -51,13 +51,13 @@ func NewAPISchemaClientWithBaseURI(baseURI string, subscriptionID string) APISch // schemaID - schema identifier within an API. Must be unique in the current API Management service instance. // parameters - the schema contents to apply. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client APISchemaClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, parameters SchemaContract, ifMatch string) (result SchemaContract, err error) { +func (client APISchemaClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, parameters SchemaContract, ifMatch string) (result APISchemaCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APISchemaClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -74,7 +74,7 @@ func (client APISchemaClient) CreateOrUpdate(ctx context.Context, resourceGroupN {TargetValue: schemaID, Constraints: []validation.Constraint{{Target: "schemaID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "schemaID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "schemaID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "schemaID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SchemaContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.SchemaContractProperties.ContentType", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { @@ -87,18 +87,12 @@ func (client APISchemaClient) CreateOrUpdate(ctx context.Context, resourceGroupN return } - resp, err := client.CreateOrUpdateSender(req) + result, err = client.CreateOrUpdateSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "CreateOrUpdate", result.Response(), "Failure sending request") return } - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "CreateOrUpdate", resp, "Failure responding to request") - } - return } @@ -112,7 +106,7 @@ func (client APISchemaClient) CreateOrUpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -133,8 +127,14 @@ func (client APISchemaClient) CreateOrUpdatePreparer(ctx context.Context, resour // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client APISchemaClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client APISchemaClient) CreateOrUpdateSender(req *http.Request) (future APISchemaCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -143,7 +143,7 @@ func (client APISchemaClient) CreateOrUpdateResponder(resp *http.Response) (resu err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} @@ -159,7 +159,8 @@ func (client APISchemaClient) CreateOrUpdateResponder(resp *http.Response) (resu // schemaID - schema identifier within an API. Must be unique in the current API Management service instance. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client APISchemaClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, ifMatch string) (result autorest.Response, err error) { +// force - if true removes all references to the schema before deleting it. +func (client APISchemaClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, ifMatch string, force *bool) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APISchemaClient.Delete") defer func() { @@ -182,11 +183,11 @@ func (client APISchemaClient) Delete(ctx context.Context, resourceGroupName stri {TargetValue: schemaID, Constraints: []validation.Constraint{{Target: "schemaID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "schemaID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "schemaID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "schemaID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APISchemaClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, schemaID, ifMatch) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, schemaID, ifMatch, force) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "Delete", nil, "Failure preparing request") return @@ -208,7 +209,7 @@ func (client APISchemaClient) Delete(ctx context.Context, resourceGroupName stri } // DeletePreparer prepares the Delete request. -func (client APISchemaClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, ifMatch string) (*http.Request, error) { +func (client APISchemaClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, schemaID string, ifMatch string, force *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -217,10 +218,13 @@ func (client APISchemaClient) DeletePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } preparer := autorest.CreatePreparer( autorest.AsDelete(), @@ -279,7 +283,7 @@ func (client APISchemaClient) Get(ctx context.Context, resourceGroupName string, {TargetValue: schemaID, Constraints: []validation.Constraint{{Target: "schemaID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "schemaID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "schemaID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "schemaID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APISchemaClient", "Get", err.Error()) } @@ -314,7 +318,7 @@ func (client APISchemaClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -376,7 +380,7 @@ func (client APISchemaClient) GetEntityTag(ctx context.Context, resourceGroupNam {TargetValue: schemaID, Constraints: []validation.Constraint{{Target: "schemaID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "schemaID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "schemaID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "schemaID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APISchemaClient", "GetEntityTag", err.Error()) } @@ -411,7 +415,7 @@ func (client APISchemaClient) GetEntityTagPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -448,7 +452,12 @@ func (client APISchemaClient) GetEntityTagResponder(resp *http.Response) (result // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -func (client APISchemaClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (result SchemaCollectionPage, err error) { +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| contentType | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
+// top - number of records to return. +// skip - number of records to skip. +func (client APISchemaClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result SchemaCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APISchemaClient.ListByAPI") defer func() { @@ -467,12 +476,18 @@ func (client APISchemaClient) ListByAPI(ctx context.Context, resourceGroupName s {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.APISchemaClient", "ListByAPI", err.Error()) } result.fn = client.listByAPINextResults - req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid) + req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.APISchemaClient", "ListByAPI", nil, "Failure preparing request") return @@ -494,7 +509,7 @@ func (client APISchemaClient) ListByAPI(ctx context.Context, resourceGroupName s } // ListByAPIPreparer prepares the ListByAPI request. -func (client APISchemaClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (*http.Request, error) { +func (client APISchemaClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -502,10 +517,19 @@ func (client APISchemaClient) ListByAPIPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -556,7 +580,7 @@ func (client APISchemaClient) listByAPINextResults(ctx context.Context, lastResu } // ListByAPIComplete enumerates all values, automatically crossing page boundaries as required. -func (client APISchemaClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string) (result SchemaCollectionIterator, err error) { +func (client APISchemaClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result SchemaCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/APISchemaClient.ListByAPI") defer func() { @@ -567,6 +591,6 @@ func (client APISchemaClient) ListByAPIComplete(ctx context.Context, resourceGro tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid) + result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tagdescription.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apitagdescription.go similarity index 58% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tagdescription.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apitagdescription.go index 8c0a5e8158447..fcfaa5b388098 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tagdescription.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apitagdescription.go @@ -26,20 +26,21 @@ import ( "net/http" ) -// TagDescriptionClient is the apiManagement Client -type TagDescriptionClient struct { +// APITagDescriptionClient is the apiManagement Client +type APITagDescriptionClient struct { BaseClient } -// NewTagDescriptionClient creates an instance of the TagDescriptionClient client. -func NewTagDescriptionClient(subscriptionID string) TagDescriptionClient { - return NewTagDescriptionClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewAPITagDescriptionClient creates an instance of the APITagDescriptionClient client. +func NewAPITagDescriptionClient(subscriptionID string) APITagDescriptionClient { + return NewAPITagDescriptionClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewTagDescriptionClientWithBaseURI creates an instance of the TagDescriptionClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewTagDescriptionClientWithBaseURI(baseURI string, subscriptionID string) TagDescriptionClient { - return TagDescriptionClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewAPITagDescriptionClientWithBaseURI creates an instance of the APITagDescriptionClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewAPITagDescriptionClientWithBaseURI(baseURI string, subscriptionID string) APITagDescriptionClient { + return APITagDescriptionClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create/Update tag description in scope of the Api. @@ -48,12 +49,13 @@ func NewTagDescriptionClientWithBaseURI(baseURI string, subscriptionID string) T // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// tagID - tag identifier. Must be unique in the current API Management service instance. +// tagDescriptionID - tag description identifier. Used when creating tagDescription for API/Tag association. +// Based on API and Tag names. // parameters - create parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client TagDescriptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, parameters TagDescriptionCreateParameters, ifMatch string) (result TagDescriptionContract, err error) { +func (client APITagDescriptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string, parameters TagDescriptionCreateParameters, ifMatch string) (result TagDescriptionContract, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/APITagDescriptionClient.CreateOrUpdate") defer func() { sc := -1 if result.Response.Response != nil { @@ -71,50 +73,50 @@ func (client TagDescriptionClient) CreateOrUpdate(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, - {TargetValue: tagID, - Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: tagDescriptionID, + Constraints: []validation.Constraint{{Target: "tagDescriptionID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.TagDescriptionBaseProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.TagDescriptionBaseProperties.ExternalDocsURL", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.TagDescriptionBaseProperties.ExternalDocsURL", Name: validation.MaxLength, Rule: 2000, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewError("apimanagement.TagDescriptionClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("apimanagement.APITagDescriptionClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, tagID, parameters, ifMatch) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, apiid, tagDescriptionID, parameters, ifMatch) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client TagDescriptionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, parameters TagDescriptionCreateParameters, ifMatch string) (*http.Request, error) { +func (client APITagDescriptionClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string, parameters TagDescriptionCreateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tagId": autorest.Encode("path", tagID), + "tagDescriptionId": autorest.Encode("path", tagDescriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -123,7 +125,7 @@ func (client TagDescriptionClient) CreateOrUpdatePreparer(ctx context.Context, r autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) if len(ifMatch) > 0 { @@ -135,13 +137,13 @@ func (client TagDescriptionClient) CreateOrUpdatePreparer(ctx context.Context, r // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client TagDescriptionClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client APITagDescriptionClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client TagDescriptionClient) CreateOrUpdateResponder(resp *http.Response) (result TagDescriptionContract, err error) { +func (client APITagDescriptionClient) CreateOrUpdateResponder(resp *http.Response) (result TagDescriptionContract, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -158,12 +160,13 @@ func (client TagDescriptionClient) CreateOrUpdateResponder(resp *http.Response) // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// tagID - tag identifier. Must be unique in the current API Management service instance. +// tagDescriptionID - tag description identifier. Used when creating tagDescription for API/Tag association. +// Based on API and Tag names. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client TagDescriptionClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (result autorest.Response, err error) { +func (client APITagDescriptionClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionClient.Delete") + ctx = tracing.StartSpan(ctx, fqdn+"/APITagDescriptionClient.Delete") defer func() { sc := -1 if result.Response != nil { @@ -181,45 +184,45 @@ func (client TagDescriptionClient) Delete(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, - {TargetValue: tagID, - Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.TagDescriptionClient", "Delete", err.Error()) + {TargetValue: tagDescriptionID, + Constraints: []validation.Constraint{{Target: "tagDescriptionID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APITagDescriptionClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, tagID, ifMatch) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, apiid, tagDescriptionID, ifMatch) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. -func (client TagDescriptionClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (*http.Request, error) { +func (client APITagDescriptionClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tagId": autorest.Encode("path", tagID), + "tagDescriptionId": autorest.Encode("path", tagDescriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -227,7 +230,7 @@ func (client TagDescriptionClient) DeletePreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}", pathParameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -235,13 +238,13 @@ func (client TagDescriptionClient) DeletePreparer(ctx context.Context, resourceG // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client TagDescriptionClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client APITagDescriptionClient) DeleteSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client TagDescriptionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client APITagDescriptionClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -251,16 +254,17 @@ func (client TagDescriptionClient) DeleteResponder(resp *http.Response) (result return } -// Get get tag associated with the API. +// Get get Tag description in scope of API // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// tagID - tag identifier. Must be unique in the current API Management service instance. -func (client TagDescriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (result TagDescriptionContract, err error) { +// tagDescriptionID - tag description identifier. Used when creating tagDescription for API/Tag association. +// Based on API and Tag names. +func (client APITagDescriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string) (result TagDescriptionContract, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/APITagDescriptionClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -278,45 +282,45 @@ func (client TagDescriptionClient) Get(ctx context.Context, resourceGroupName st Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, - {TargetValue: tagID, - Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.TagDescriptionClient", "Get", err.Error()) + {TargetValue: tagDescriptionID, + Constraints: []validation.Constraint{{Target: "tagDescriptionID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APITagDescriptionClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, tagID) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, apiid, tagDescriptionID) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client TagDescriptionClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (*http.Request, error) { +func (client APITagDescriptionClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tagId": autorest.Encode("path", tagID), + "tagDescriptionId": autorest.Encode("path", tagDescriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -324,20 +328,20 @@ func (client TagDescriptionClient) GetPreparer(ctx context.Context, resourceGrou preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client TagDescriptionClient) GetSender(req *http.Request) (*http.Response, error) { +func (client APITagDescriptionClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client TagDescriptionClient) GetResponder(resp *http.Response) (result TagDescriptionContract, err error) { +func (client APITagDescriptionClient) GetResponder(resp *http.Response) (result TagDescriptionContract, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -348,16 +352,17 @@ func (client TagDescriptionClient) GetResponder(resp *http.Response) (result Tag return } -// GetEntityState gets the entity state version of the tag specified by its identifier. +// GetEntityTag gets the entity state version of the tag specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// tagID - tag identifier. Must be unique in the current API Management service instance. -func (client TagDescriptionClient) GetEntityState(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (result autorest.Response, err error) { +// tagDescriptionID - tag description identifier. Used when creating tagDescription for API/Tag association. +// Based on API and Tag names. +func (client APITagDescriptionClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionClient.GetEntityState") + ctx = tracing.StartSpan(ctx, fqdn+"/APITagDescriptionClient.GetEntityTag") defer func() { sc := -1 if result.Response != nil { @@ -375,45 +380,45 @@ func (client TagDescriptionClient) GetEntityState(ctx context.Context, resourceG Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, - {TargetValue: tagID, - Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.TagDescriptionClient", "GetEntityState", err.Error()) + {TargetValue: tagDescriptionID, + Constraints: []validation.Constraint{{Target: "tagDescriptionID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "tagDescriptionID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.APITagDescriptionClient", "GetEntityTag", err.Error()) } - req, err := client.GetEntityStatePreparer(ctx, resourceGroupName, serviceName, apiid, tagID) + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, apiid, tagDescriptionID) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "GetEntityState", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "GetEntityTag", nil, "Failure preparing request") return } - resp, err := client.GetEntityStateSender(req) + resp, err := client.GetEntityTagSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "GetEntityState", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "GetEntityTag", resp, "Failure sending request") return } - result, err = client.GetEntityStateResponder(resp) + result, err = client.GetEntityTagResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "GetEntityState", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "GetEntityTag", resp, "Failure responding to request") } return } -// GetEntityStatePreparer prepares the GetEntityState request. -func (client TagDescriptionClient) GetEntityStatePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (*http.Request, error) { +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client APITagDescriptionClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagDescriptionID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "tagId": autorest.Encode("path", tagID), + "tagDescriptionId": autorest.Encode("path", tagDescriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -421,20 +426,20 @@ func (client TagDescriptionClient) GetEntityStatePreparer(ctx context.Context, r preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tagDescriptions/{tagDescriptionId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetEntityStateSender sends the GetEntityState request. The method will close the +// GetEntityTagSender sends the GetEntityTag request. The method will close the // http.Response Body if it receives an error. -func (client TagDescriptionClient) GetEntityStateSender(req *http.Request) (*http.Response, error) { +func (client APITagDescriptionClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// GetEntityStateResponder handles the response to the GetEntityState request. The method always +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always // closes the http.Response Body. -func (client TagDescriptionClient) GetEntityStateResponder(resp *http.Response) (result autorest.Response, err error) { +func (client APITagDescriptionClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -444,22 +449,22 @@ func (client TagDescriptionClient) GetEntityStateResponder(resp *http.Response) return } -// ListByAPI lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on API -// level but tag may be assigned to the Operations +// ListByService lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined on +// API level but tag may be assigned to the Operations // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client TagDescriptionClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagDescriptionCollectionPage, err error) { +func (client APITagDescriptionClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagDescriptionCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionClient.ListByAPI") + ctx = tracing.StartSpan(ctx, fqdn+"/APITagDescriptionClient.ListByService") defer func() { sc := -1 if result.tdc.Response.Response != nil { @@ -483,33 +488,33 @@ func (client TagDescriptionClient) ListByAPI(ctx context.Context, resourceGroupN {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { - return result, validation.NewError("apimanagement.TagDescriptionClient", "ListByAPI", err.Error()) + return result, validation.NewError("apimanagement.APITagDescriptionClient", "ListByService", err.Error()) } - result.fn = client.listByAPINextResults - req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "ListByAPI", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "ListByService", nil, "Failure preparing request") return } - resp, err := client.ListByAPISender(req) + resp, err := client.ListByServiceSender(req) if err != nil { result.tdc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "ListByAPI", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "ListByService", resp, "Failure sending request") return } - result.tdc, err = client.ListByAPIResponder(resp) + result.tdc, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "ListByAPI", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "ListByService", resp, "Failure responding to request") } return } -// ListByAPIPreparer prepares the ListByAPI request. -func (client TagDescriptionClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { +// ListByServicePreparer prepares the ListByService request. +func (client APITagDescriptionClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -517,7 +522,7 @@ func (client TagDescriptionClient) ListByAPIPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -539,15 +544,15 @@ func (client TagDescriptionClient) ListByAPIPreparer(ctx context.Context, resour return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListByAPISender sends the ListByAPI request. The method will close the +// ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. -func (client TagDescriptionClient) ListByAPISender(req *http.Request) (*http.Response, error) { +func (client APITagDescriptionClient) ListByServiceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListByAPIResponder handles the response to the ListByAPI request. The method always +// ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client TagDescriptionClient) ListByAPIResponder(resp *http.Response) (result TagDescriptionCollection, err error) { +func (client APITagDescriptionClient) ListByServiceResponder(resp *http.Response) (result TagDescriptionCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -558,31 +563,31 @@ func (client TagDescriptionClient) ListByAPIResponder(resp *http.Response) (resu return } -// listByAPINextResults retrieves the next set of results, if any. -func (client TagDescriptionClient) listByAPINextResults(ctx context.Context, lastResults TagDescriptionCollection) (result TagDescriptionCollection, err error) { +// listByServiceNextResults retrieves the next set of results, if any. +func (client APITagDescriptionClient) listByServiceNextResults(ctx context.Context, lastResults TagDescriptionCollection) (result TagDescriptionCollection, err error) { req, err := lastResults.tagDescriptionCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "listByAPINextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "listByServiceNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListByAPISender(req) + resp, err := client.ListByServiceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "listByAPINextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "listByServiceNextResults", resp, "Failure sending next results request") } - result, err = client.ListByAPIResponder(resp) + result, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.TagDescriptionClient", "listByAPINextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "apimanagement.APITagDescriptionClient", "listByServiceNextResults", resp, "Failure responding to next results request") } return } -// ListByAPIComplete enumerates all values, automatically crossing page boundaries as required. -func (client TagDescriptionClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagDescriptionCollectionIterator, err error) { +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client APITagDescriptionClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagDescriptionCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/TagDescriptionClient.ListByAPI") + ctx = tracing.StartSpan(ctx, fqdn+"/APITagDescriptionClient.ListByService") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -591,6 +596,6 @@ func (client TagDescriptionClient) ListByAPIComplete(ctx context.Context, resour tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiversionset.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiversionset.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiversionset.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiversionset.go index 5afde1fc2b997..8d23ba2ed0e34 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/apiversionset.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/apiversionset.go @@ -68,7 +68,7 @@ func (client APIVersionSetClient) CreateOrUpdate(ctx context.Context, resourceGr {TargetValue: versionSetID, Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "versionSetID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.APIVersionSetContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.APIVersionSetContractProperties.DisplayName", Name: validation.Null, Rule: true, @@ -109,7 +109,7 @@ func (client APIVersionSetClient) CreateOrUpdatePreparer(ctx context.Context, re "versionSetId": autorest.Encode("path", versionSetID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -118,7 +118,7 @@ func (client APIVersionSetClient) CreateOrUpdatePreparer(ctx context.Context, re autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) if len(ifMatch) > 0 { @@ -173,7 +173,7 @@ func (client APIVersionSetClient) Delete(ctx context.Context, resourceGroupName {TargetValue: versionSetID, Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "versionSetID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIVersionSetClient", "Delete", err.Error()) } @@ -207,7 +207,7 @@ func (client APIVersionSetClient) DeletePreparer(ctx context.Context, resourceGr "versionSetId": autorest.Encode("path", versionSetID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -215,7 +215,7 @@ func (client APIVersionSetClient) DeletePreparer(ctx context.Context, resourceGr preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}", pathParameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -263,7 +263,7 @@ func (client APIVersionSetClient) Get(ctx context.Context, resourceGroupName str {TargetValue: versionSetID, Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "versionSetID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIVersionSetClient", "Get", err.Error()) } @@ -297,7 +297,7 @@ func (client APIVersionSetClient) GetPreparer(ctx context.Context, resourceGroup "versionSetId": autorest.Encode("path", versionSetID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -305,7 +305,7 @@ func (client APIVersionSetClient) GetPreparer(ctx context.Context, resourceGroup preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -353,7 +353,7 @@ func (client APIVersionSetClient) GetEntityTag(ctx context.Context, resourceGrou {TargetValue: versionSetID, Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "versionSetID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIVersionSetClient", "GetEntityTag", err.Error()) } @@ -387,7 +387,7 @@ func (client APIVersionSetClient) GetEntityTagPreparer(ctx context.Context, reso "versionSetId": autorest.Encode("path", versionSetID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -395,7 +395,7 @@ func (client APIVersionSetClient) GetEntityTagPreparer(ctx context.Context, reso preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -422,15 +422,8 @@ func (client APIVersionSetClient) GetEntityTagResponder(resp *http.Response) (re // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |------------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | N/A | -// | registrationDate | ge, le, eq, ne, gt, lt | N/A | -// | note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
// top - number of records to return. // skip - number of records to skip. func (client APIVersionSetClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result APIVersionSetCollectionPage, err error) { @@ -488,7 +481,7 @@ func (client APIVersionSetClient) ListByServicePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -505,7 +498,7 @@ func (client APIVersionSetClient) ListByServicePreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -593,7 +586,7 @@ func (client APIVersionSetClient) Update(ctx context.Context, resourceGroupName {TargetValue: versionSetID, Constraints: []validation.Constraint{{Target: "versionSetID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "versionSetID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "versionSetID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "versionSetID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.APIVersionSetClient", "Update", err.Error()) } @@ -627,7 +620,7 @@ func (client APIVersionSetClient) UpdatePreparer(ctx context.Context, resourceGr "versionSetId": autorest.Encode("path", versionSetID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -636,7 +629,7 @@ func (client APIVersionSetClient) UpdatePreparer(ctx context.Context, resourceGr autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/api-version-sets/{versionSetId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apiVersionSets/{versionSetId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/authorizationserver.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/authorizationserver.go similarity index 85% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/authorizationserver.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/authorizationserver.go index 26ed84a7f5896..a540e7f823c59 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/authorizationserver.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/authorizationserver.go @@ -69,7 +69,7 @@ func (client AuthorizationServerClient) CreateOrUpdate(ctx context.Context, reso {TargetValue: authsid, Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "authsid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.AuthorizationServerContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.AuthorizationServerContractProperties.DisplayName", Name: validation.Null, Rule: true, @@ -114,7 +114,7 @@ func (client AuthorizationServerClient) CreateOrUpdatePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -178,7 +178,7 @@ func (client AuthorizationServerClient) Delete(ctx context.Context, resourceGrou {TargetValue: authsid, Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "authsid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.AuthorizationServerClient", "Delete", err.Error()) } @@ -212,7 +212,7 @@ func (client AuthorizationServerClient) DeletePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -268,7 +268,7 @@ func (client AuthorizationServerClient) Get(ctx context.Context, resourceGroupNa {TargetValue: authsid, Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "authsid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.AuthorizationServerClient", "Get", err.Error()) } @@ -302,7 +302,7 @@ func (client AuthorizationServerClient) GetPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -358,7 +358,7 @@ func (client AuthorizationServerClient) GetEntityTag(ctx context.Context, resour {TargetValue: authsid, Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "authsid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.AuthorizationServerClient", "GetEntityTag", err.Error()) } @@ -392,7 +392,7 @@ func (client AuthorizationServerClient) GetEntityTagPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -427,10 +427,10 @@ func (client AuthorizationServerClient) GetEntityTagResponder(resp *http.Respons // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client AuthorizationServerClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result AuthorizationServerCollectionPage, err error) { @@ -488,7 +488,7 @@ func (client AuthorizationServerClient) ListByServicePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -566,6 +566,96 @@ func (client AuthorizationServerClient) ListByServiceComplete(ctx context.Contex return } +// ListSecrets gets the client secret details of the authorization server. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// authsid - identifier of the authorization server. +func (client AuthorizationServerClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, authsid string) (result ClientSecretContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AuthorizationServerClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: authsid, + Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "authsid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.AuthorizationServerClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName, authsid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.AuthorizationServerClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client AuthorizationServerClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string, authsid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authsid": autorest.Encode("path", authsid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationServers/{authsid}/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client AuthorizationServerClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client AuthorizationServerClient) ListSecretsResponder(resp *http.Response) (result ClientSecretContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Update updates the details of the authorization server specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. @@ -593,7 +683,7 @@ func (client AuthorizationServerClient) Update(ctx context.Context, resourceGrou {TargetValue: authsid, Constraints: []validation.Constraint{{Target: "authsid", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "authsid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "authsid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "authsid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.AuthorizationServerClient", "Update", err.Error()) } @@ -627,7 +717,7 @@ func (client AuthorizationServerClient) UpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/backend.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/backend.go similarity index 87% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/backend.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/backend.go index d9ed0c518d54d..29a9e9516674b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/backend.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/backend.go @@ -46,10 +46,10 @@ func NewBackendClientWithBaseURI(baseURI string, subscriptionID string) BackendC // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +// backendID - identifier of the Backend entity. Must be unique in the current API Management service instance. // parameters - create parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendContract, ifMatch string) (result BackendContract, err error) { +func (client BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters BackendContract, ifMatch string) (result BackendContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackendClient.CreateOrUpdate") defer func() { @@ -65,10 +65,9 @@ func (client BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupNam Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: backendid, - Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: backendID, + Constraints: []validation.Constraint{{Target: "backendID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.BackendContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.BackendContractProperties.URL", Name: validation.Null, Rule: true, @@ -79,7 +78,7 @@ func (client BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupNam return result, validation.NewError("apimanagement.BackendClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, backendid, parameters, ifMatch) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, backendID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -101,15 +100,15 @@ func (client BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupNam } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client BackendClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendContract, ifMatch string) (*http.Request, error) { +func (client BackendClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters BackendContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backendid": autorest.Encode("path", backendid), + "backendId": autorest.Encode("path", backendID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -118,7 +117,7 @@ func (client BackendClient) CreateOrUpdatePreparer(ctx context.Context, resource autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) if len(ifMatch) > 0 { @@ -151,10 +150,10 @@ func (client BackendClient) CreateOrUpdateResponder(resp *http.Response) (result // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +// backendID - identifier of the Backend entity. Must be unique in the current API Management service instance. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client BackendClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, backendid string, ifMatch string) (result autorest.Response, err error) { +func (client BackendClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, backendID string, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackendClient.Delete") defer func() { @@ -170,14 +169,13 @@ func (client BackendClient) Delete(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: backendid, - Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: backendID, + Constraints: []validation.Constraint{{Target: "backendID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.BackendClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, backendid, ifMatch) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, backendID, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Delete", nil, "Failure preparing request") return @@ -199,15 +197,15 @@ func (client BackendClient) Delete(ctx context.Context, resourceGroupName string } // DeletePreparer prepares the Delete request. -func (client BackendClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, ifMatch string) (*http.Request, error) { +func (client BackendClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendID string, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backendid": autorest.Encode("path", backendid), + "backendId": autorest.Encode("path", backendID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -215,7 +213,7 @@ func (client BackendClient) DeletePreparer(ctx context.Context, resourceGroupNam preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}", pathParameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -243,8 +241,8 @@ func (client BackendClient) DeleteResponder(resp *http.Response) (result autores // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. -func (client BackendClient) Get(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (result BackendContract, err error) { +// backendID - identifier of the Backend entity. Must be unique in the current API Management service instance. +func (client BackendClient) Get(ctx context.Context, resourceGroupName string, serviceName string, backendID string) (result BackendContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackendClient.Get") defer func() { @@ -260,14 +258,13 @@ func (client BackendClient) Get(ctx context.Context, resourceGroupName string, s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: backendid, - Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: backendID, + Constraints: []validation.Constraint{{Target: "backendID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.BackendClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, backendid) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, backendID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Get", nil, "Failure preparing request") return @@ -289,15 +286,15 @@ func (client BackendClient) Get(ctx context.Context, resourceGroupName string, s } // GetPreparer prepares the Get request. -func (client BackendClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (*http.Request, error) { +func (client BackendClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backendid": autorest.Encode("path", backendid), + "backendId": autorest.Encode("path", backendID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -305,7 +302,7 @@ func (client BackendClient) GetPreparer(ctx context.Context, resourceGroupName s preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -333,8 +330,8 @@ func (client BackendClient) GetResponder(resp *http.Response) (result BackendCon // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. -func (client BackendClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (result autorest.Response, err error) { +// backendID - identifier of the Backend entity. Must be unique in the current API Management service instance. +func (client BackendClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, backendID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackendClient.GetEntityTag") defer func() { @@ -350,14 +347,13 @@ func (client BackendClient) GetEntityTag(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: backendid, - Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: backendID, + Constraints: []validation.Constraint{{Target: "backendID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.BackendClient", "GetEntityTag", err.Error()) } - req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, backendid) + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, backendID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "GetEntityTag", nil, "Failure preparing request") return @@ -379,15 +375,15 @@ func (client BackendClient) GetEntityTag(ctx context.Context, resourceGroupName } // GetEntityTagPreparer prepares the GetEntityTag request. -func (client BackendClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string) (*http.Request, error) { +func (client BackendClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backendid": autorest.Encode("path", backendid), + "backendId": autorest.Encode("path", backendID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -395,7 +391,7 @@ func (client BackendClient) GetEntityTagPreparer(ctx context.Context, resourceGr preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -422,10 +418,11 @@ func (client BackendClient) GetEntityTagResponder(resp *http.Response) (result a // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | host | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| title | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| url | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client BackendClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result BackendCollectionPage, err error) { @@ -483,7 +480,7 @@ func (client BackendClient) ListByServicePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -566,9 +563,9 @@ func (client BackendClient) ListByServiceComplete(ctx context.Context, resourceG // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +// backendID - identifier of the Backend entity. Must be unique in the current API Management service instance. // parameters - reconnect request parameters. -func (client BackendClient) Reconnect(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters *BackendReconnectContract) (result autorest.Response, err error) { +func (client BackendClient) Reconnect(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters *BackendReconnectContract) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackendClient.Reconnect") defer func() { @@ -584,14 +581,13 @@ func (client BackendClient) Reconnect(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: backendid, - Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: backendID, + Constraints: []validation.Constraint{{Target: "backendID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.BackendClient", "Reconnect", err.Error()) } - req, err := client.ReconnectPreparer(ctx, resourceGroupName, serviceName, backendid, parameters) + req, err := client.ReconnectPreparer(ctx, resourceGroupName, serviceName, backendID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Reconnect", nil, "Failure preparing request") return @@ -613,15 +609,15 @@ func (client BackendClient) Reconnect(ctx context.Context, resourceGroupName str } // ReconnectPreparer prepares the Reconnect request. -func (client BackendClient) ReconnectPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters *BackendReconnectContract) (*http.Request, error) { +func (client BackendClient) ReconnectPreparer(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters *BackendReconnectContract) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backendid": autorest.Encode("path", backendid), + "backendId": autorest.Encode("path", backendID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -630,7 +626,7 @@ func (client BackendClient) ReconnectPreparer(ctx context.Context, resourceGroup autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}/reconnect", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}/reconnect", pathParameters), autorest.WithQueryParameters(queryParameters)) if parameters != nil { preparer = autorest.DecoratePreparer(preparer, @@ -661,11 +657,11 @@ func (client BackendClient) ReconnectResponder(resp *http.Response) (result auto // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// backendid - identifier of the Backend entity. Must be unique in the current API Management service instance. +// backendID - identifier of the Backend entity. Must be unique in the current API Management service instance. // parameters - update parameters. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client BackendClient) Update(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendUpdateParameters, ifMatch string) (result autorest.Response, err error) { +func (client BackendClient) Update(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters BackendUpdateParameters, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BackendClient.Update") defer func() { @@ -681,14 +677,13 @@ func (client BackendClient) Update(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: backendid, - Constraints: []validation.Constraint{{Target: "backendid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "backendid", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "backendid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: backendID, + Constraints: []validation.Constraint{{Target: "backendID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "backendID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.BackendClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, backendid, parameters, ifMatch) + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, backendID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.BackendClient", "Update", nil, "Failure preparing request") return @@ -710,15 +705,15 @@ func (client BackendClient) Update(ctx context.Context, resourceGroupName string } // UpdatePreparer prepares the Update request. -func (client BackendClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendid string, parameters BackendUpdateParameters, ifMatch string) (*http.Request, error) { +func (client BackendClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters BackendUpdateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "backendid": autorest.Encode("path", backendid), + "backendId": autorest.Encode("path", backendID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -727,7 +722,7 @@ func (client BackendClient) UpdatePreparer(ctx context.Context, resourceGroupNam autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/backends/{backendId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/property.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/cache.go similarity index 57% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/property.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/cache.go index a8a07ce20791e..f35d07a154ab0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/property.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/cache.go @@ -26,32 +26,33 @@ import ( "net/http" ) -// PropertyClient is the apiManagement Client -type PropertyClient struct { +// CacheClient is the apiManagement Client +type CacheClient struct { BaseClient } -// NewPropertyClient creates an instance of the PropertyClient client. -func NewPropertyClient(subscriptionID string) PropertyClient { - return NewPropertyClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewCacheClient creates an instance of the CacheClient client. +func NewCacheClient(subscriptionID string) CacheClient { + return NewCacheClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewPropertyClientWithBaseURI creates an instance of the PropertyClient client using a custom endpoint. Use this -// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPropertyClientWithBaseURI(baseURI string, subscriptionID string) PropertyClient { - return PropertyClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewCacheClientWithBaseURI creates an instance of the CacheClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewCacheClientWithBaseURI(baseURI string, subscriptionID string) CacheClient { + return CacheClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a property. +// CreateOrUpdate creates or updates an External Cache to be used in Api Management instance. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// propID - identifier of the property. -// parameters - create parameters. +// cacheID - identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region +// identifier). +// parameters - create or Update parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client PropertyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, propID string, parameters PropertyContract, ifMatch string) (result PropertyContract, err error) { +func (client CacheClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, parameters CacheContract, ifMatch string) (result CacheContract, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.CreateOrUpdate") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.CreateOrUpdate") defer func() { sc := -1 if result.Response.Response != nil { @@ -65,55 +66,53 @@ func (client PropertyClient) CreateOrUpdate(ctx context.Context, resourceGroupNa Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: propID, - Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: cacheID, + Constraints: []validation.Constraint{{Target: "cacheID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "cacheID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "cacheID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.PropertyContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PropertyContractProperties.DisplayName", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.PropertyContractProperties.DisplayName", Name: validation.MaxLength, Rule: 256, Chain: nil}, - {Target: "parameters.PropertyContractProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "parameters.PropertyContractProperties.DisplayName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]+$`, Chain: nil}, - }}, - {Target: "parameters.PropertyContractProperties.Value", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.PropertyContractProperties.Value", Name: validation.MaxLength, Rule: 4096, Chain: nil}, - {Target: "parameters.PropertyContractProperties.Value", Name: validation.MinLength, Rule: 1, Chain: nil}, - }}, + Constraints: []validation.Constraint{{Target: "parameters.CacheContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.CacheContractProperties.Description", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.CacheContractProperties.Description", Name: validation.MaxLength, Rule: 2000, Chain: nil}}}, + {Target: "parameters.CacheContractProperties.ConnectionString", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.CacheContractProperties.ConnectionString", Name: validation.MaxLength, Rule: 300, Chain: nil}}}, + {Target: "parameters.CacheContractProperties.ResourceID", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.CacheContractProperties.ResourceID", Name: validation.MaxLength, Rule: 2000, Chain: nil}}}, }}}}}); err != nil { - return result, validation.NewError("apimanagement.PropertyClient", "CreateOrUpdate", err.Error()) + return result, validation.NewError("apimanagement.CacheClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, propID, parameters, ifMatch) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, cacheID, parameters, ifMatch) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "CreateOrUpdate", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "CreateOrUpdate", nil, "Failure preparing request") return } resp, err := client.CreateOrUpdateSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "CreateOrUpdate", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "CreateOrUpdate", resp, "Failure sending request") return } result, err = client.CreateOrUpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "CreateOrUpdate", resp, "Failure responding to request") } return } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PropertyClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string, parameters PropertyContract, ifMatch string) (*http.Request, error) { +func (client CacheClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, parameters CacheContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "propId": autorest.Encode("path", propID), + "cacheId": autorest.Encode("path", cacheID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -122,7 +121,7 @@ func (client PropertyClient) CreateOrUpdatePreparer(ctx context.Context, resourc autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) if len(ifMatch) > 0 { @@ -134,13 +133,13 @@ func (client PropertyClient) CreateOrUpdatePreparer(ctx context.Context, resourc // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client PropertyClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { +func (client CacheClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always // closes the http.Response Body. -func (client PropertyClient) CreateOrUpdateResponder(resp *http.Response) (result PropertyContract, err error) { +func (client CacheClient) CreateOrUpdateResponder(resp *http.Response) (result CacheContract, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -151,16 +150,17 @@ func (client PropertyClient) CreateOrUpdateResponder(resp *http.Response) (resul return } -// Delete deletes specific property from the API Management service instance. +// Delete deletes specific Cache. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// propID - identifier of the property. +// cacheID - identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region +// identifier). // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client PropertyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, propID string, ifMatch string) (result autorest.Response, err error) { +func (client CacheClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.Delete") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.Delete") defer func() { sc := -1 if result.Response != nil { @@ -174,43 +174,44 @@ func (client PropertyClient) Delete(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: propID, - Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.PropertyClient", "Delete", err.Error()) + {TargetValue: cacheID, + Constraints: []validation.Constraint{{Target: "cacheID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "cacheID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "cacheID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.CacheClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, propID, ifMatch) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, cacheID, ifMatch) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Delete", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Delete", nil, "Failure preparing request") return } resp, err := client.DeleteSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Delete", resp, "Failure sending request") return } result, err = client.DeleteResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Delete", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Delete", resp, "Failure responding to request") } return } // DeletePreparer prepares the Delete request. -func (client PropertyClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string, ifMatch string) (*http.Request, error) { +func (client CacheClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "propId": autorest.Encode("path", propID), + "cacheId": autorest.Encode("path", cacheID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -218,7 +219,7 @@ func (client PropertyClient) DeletePreparer(ctx context.Context, resourceGroupNa preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}", pathParameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -226,13 +227,13 @@ func (client PropertyClient) DeletePreparer(ctx context.Context, resourceGroupNa // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client PropertyClient) DeleteSender(req *http.Request) (*http.Response, error) { +func (client CacheClient) DeleteSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client PropertyClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client CacheClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -242,14 +243,15 @@ func (client PropertyClient) DeleteResponder(resp *http.Response) (result autore return } -// Get gets the details of the property specified by its identifier. +// Get gets the details of the Cache specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// propID - identifier of the property. -func (client PropertyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, propID string) (result PropertyContract, err error) { +// cacheID - identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region +// identifier). +func (client CacheClient) Get(ctx context.Context, resourceGroupName string, serviceName string, cacheID string) (result CacheContract, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.Get") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -263,43 +265,44 @@ func (client PropertyClient) Get(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: propID, - Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.PropertyClient", "Get", err.Error()) + {TargetValue: cacheID, + Constraints: []validation.Constraint{{Target: "cacheID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "cacheID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "cacheID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.CacheClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, propID) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, cacheID) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Get", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Get", nil, "Failure preparing request") return } resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Get", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Get", resp, "Failure sending request") return } result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Get", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Get", resp, "Failure responding to request") } return } // GetPreparer prepares the Get request. -func (client PropertyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string) (*http.Request, error) { +func (client CacheClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, cacheID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "propId": autorest.Encode("path", propID), + "cacheId": autorest.Encode("path", cacheID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -307,20 +310,20 @@ func (client PropertyClient) GetPreparer(ctx context.Context, resourceGroupName preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client PropertyClient) GetSender(req *http.Request) (*http.Response, error) { +func (client CacheClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client PropertyClient) GetResponder(resp *http.Response) (result PropertyContract, err error) { +func (client CacheClient) GetResponder(resp *http.Response) (result CacheContract, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -331,14 +334,15 @@ func (client PropertyClient) GetResponder(resp *http.Response) (result PropertyC return } -// GetEntityTag gets the entity state (Etag) version of the property specified by its identifier. +// GetEntityTag gets the entity state (Etag) version of the Cache specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// propID - identifier of the property. -func (client PropertyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, propID string) (result autorest.Response, err error) { +// cacheID - identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region +// identifier). +func (client CacheClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, cacheID string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.GetEntityTag") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.GetEntityTag") defer func() { sc := -1 if result.Response != nil { @@ -352,43 +356,44 @@ func (client PropertyClient) GetEntityTag(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: propID, - Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.PropertyClient", "GetEntityTag", err.Error()) + {TargetValue: cacheID, + Constraints: []validation.Constraint{{Target: "cacheID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "cacheID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "cacheID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.CacheClient", "GetEntityTag", err.Error()) } - req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, propID) + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, cacheID) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "GetEntityTag", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "GetEntityTag", nil, "Failure preparing request") return } resp, err := client.GetEntityTagSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "GetEntityTag", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "GetEntityTag", resp, "Failure sending request") return } result, err = client.GetEntityTagResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "GetEntityTag", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "GetEntityTag", resp, "Failure responding to request") } return } // GetEntityTagPreparer prepares the GetEntityTag request. -func (client PropertyClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string) (*http.Request, error) { +func (client CacheClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, cacheID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "propId": autorest.Encode("path", propID), + "cacheId": autorest.Encode("path", cacheID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -396,20 +401,20 @@ func (client PropertyClient) GetEntityTagPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // GetEntityTagSender sends the GetEntityTag request. The method will close the // http.Response Body if it receives an error. -func (client PropertyClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { +func (client CacheClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // GetEntityTagResponder handles the response to the GetEntityTag request. The method always // closes the http.Response Body. -func (client PropertyClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { +func (client CacheClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -419,23 +424,19 @@ func (client PropertyClient) GetEntityTagResponder(resp *http.Response) (result return } -// ListByService lists a collection of properties defined within a service instance. +// ListByService lists a collection of all external Caches in the specified service instance. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|-------------------------------------------------------| -// | tags | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith, any, all | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | // top - number of records to return. // skip - number of records to skip. -func (client PropertyClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result PropertyCollectionPage, err error) { +func (client CacheClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result CacheCollectionPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.ListByService") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.ListByService") defer func() { sc := -1 - if result.pc.Response.Response != nil { - sc = result.pc.Response.Response.StatusCode + if result.cc.Response.Response != nil { + sc = result.cc.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -451,46 +452,43 @@ func (client PropertyClient) ListByService(ctx context.Context, resourceGroupNam {TargetValue: skip, Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { - return result, validation.NewError("apimanagement.PropertyClient", "ListByService", err.Error()) + return result, validation.NewError("apimanagement.CacheClient", "ListByService", err.Error()) } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, top, skip) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "ListByService", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "ListByService", nil, "Failure preparing request") return } resp, err := client.ListByServiceSender(req) if err != nil { - result.pc.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "ListByService", resp, "Failure sending request") + result.cc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "ListByService", resp, "Failure sending request") return } - result.pc, err = client.ListByServiceResponder(resp) + result.cc, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "ListByService", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "ListByService", resp, "Failure responding to request") } return } // ListByServicePreparer prepares the ListByService request. -func (client PropertyClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client CacheClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } @@ -501,20 +499,20 @@ func (client PropertyClient) ListByServicePreparer(ctx context.Context, resource preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. -func (client PropertyClient) ListByServiceSender(req *http.Request) (*http.Response, error) { +func (client CacheClient) ListByServiceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client PropertyClient) ListByServiceResponder(resp *http.Response) (result PropertyCollection, err error) { +func (client CacheClient) ListByServiceResponder(resp *http.Response) (result CacheCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -526,10 +524,10 @@ func (client PropertyClient) ListByServiceResponder(resp *http.Response) (result } // listByServiceNextResults retrieves the next set of results, if any. -func (client PropertyClient) listByServiceNextResults(ctx context.Context, lastResults PropertyCollection) (result PropertyCollection, err error) { - req, err := lastResults.propertyCollectionPreparer(ctx) +func (client CacheClient) listByServiceNextResults(ctx context.Context, lastResults CacheCollection) (result CacheCollection, err error) { + req, err := lastResults.cacheCollectionPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "listByServiceNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.CacheClient", "listByServiceNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -537,19 +535,19 @@ func (client PropertyClient) listByServiceNextResults(ctx context.Context, lastR resp, err := client.ListByServiceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "listByServiceNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.CacheClient", "listByServiceNextResults", resp, "Failure sending next results request") } result, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "listByServiceNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "listByServiceNextResults", resp, "Failure responding to next results request") } return } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client PropertyClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result PropertyCollectionIterator, err error) { +func (client CacheClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result CacheCollectionIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.ListByService") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.ListByService") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -558,21 +556,22 @@ func (client PropertyClient) ListByServiceComplete(ctx context.Context, resource tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, top, skip) return } -// Update updates the specific property. +// Update updates the details of the cache specified by its identifier. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// propID - identifier of the property. +// cacheID - identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region +// identifier). // parameters - update parameters. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client PropertyClient) Update(ctx context.Context, resourceGroupName string, serviceName string, propID string, parameters PropertyUpdateParameters, ifMatch string) (result autorest.Response, err error) { +func (client CacheClient) Update(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, parameters CacheUpdateParameters, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.Update") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheClient.Update") defer func() { sc := -1 if result.Response != nil { @@ -586,43 +585,44 @@ func (client PropertyClient) Update(ctx context.Context, resourceGroupName strin Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: propID, - Constraints: []validation.Constraint{{Target: "propID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "propID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.PropertyClient", "Update", err.Error()) + {TargetValue: cacheID, + Constraints: []validation.Constraint{{Target: "cacheID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "cacheID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "cacheID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.CacheClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, propID, parameters, ifMatch) + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, cacheID, parameters, ifMatch) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Update", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Update", nil, "Failure preparing request") return } resp, err := client.UpdateSender(req) if err != nil { result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Update", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Update", resp, "Failure sending request") return } result, err = client.UpdateResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PropertyClient", "Update", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.CacheClient", "Update", resp, "Failure responding to request") } return } // UpdatePreparer prepares the Update request. -func (client PropertyClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, propID string, parameters PropertyUpdateParameters, ifMatch string) (*http.Request, error) { +func (client CacheClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, parameters CacheUpdateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "propId": autorest.Encode("path", propID), + "cacheId": autorest.Encode("path", cacheID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -631,7 +631,7 @@ func (client PropertyClient) UpdatePreparer(ctx context.Context, resourceGroupNa autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/properties/{propId}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/caches/{cacheId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) @@ -640,13 +640,13 @@ func (client PropertyClient) UpdatePreparer(ctx context.Context, resourceGroupNa // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. -func (client PropertyClient) UpdateSender(req *http.Request) (*http.Response, error) { +func (client CacheClient) UpdateSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // UpdateResponder handles the response to the Update request. The method always // closes the http.Response Body. -func (client PropertyClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { +func (client CacheClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/certificate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/certificate.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/certificate.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/certificate.go index d5be196ed8367..ff7d01fa16b11 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/certificate.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/certificate.go @@ -69,7 +69,7 @@ func (client CertificateClient) CreateOrUpdate(ctx context.Context, resourceGrou {TargetValue: certificateID, Constraints: []validation.Constraint{{Target: "certificateID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "certificateID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "certificateID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "certificateID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.CertificateCreateOrUpdateProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.CertificateCreateOrUpdateProperties.Data", Name: validation.Null, Rule: true, Chain: nil}, @@ -108,7 +108,7 @@ func (client CertificateClient) CreateOrUpdatePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -173,7 +173,7 @@ func (client CertificateClient) Delete(ctx context.Context, resourceGroupName st {TargetValue: certificateID, Constraints: []validation.Constraint{{Target: "certificateID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "certificateID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "certificateID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "certificateID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.CertificateClient", "Delete", err.Error()) } @@ -207,7 +207,7 @@ func (client CertificateClient) DeletePreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -264,7 +264,7 @@ func (client CertificateClient) Get(ctx context.Context, resourceGroupName strin {TargetValue: certificateID, Constraints: []validation.Constraint{{Target: "certificateID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "certificateID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "certificateID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "certificateID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.CertificateClient", "Get", err.Error()) } @@ -298,7 +298,7 @@ func (client CertificateClient) GetPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -355,7 +355,7 @@ func (client CertificateClient) GetEntityTag(ctx context.Context, resourceGroupN {TargetValue: certificateID, Constraints: []validation.Constraint{{Target: "certificateID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "certificateID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "certificateID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "certificateID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.CertificateClient", "GetEntityTag", err.Error()) } @@ -389,7 +389,7 @@ func (client CertificateClient) GetEntityTagPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -424,12 +424,12 @@ func (client CertificateClient) GetEntityTagResponder(resp *http.Response) (resu // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |----------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | subject | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | thumbprint | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | expirationDate | ge, le, eq, ne, gt, lt | N/A | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| subject | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| thumbprint | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| expirationDate | filter | ge, le, eq, ne, gt, lt | +// |
// top - number of records to return. // skip - number of records to skip. func (client CertificateClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result CertificateCollectionPage, err error) { @@ -487,7 +487,7 @@ func (client CertificateClient) ListByServicePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/client.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/client.go index cf2bd32aeeec0..cbbdf246465bb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/client.go @@ -1,4 +1,4 @@ -// Package apimanagement implements the Azure ARM Apimanagement service API version 2018-01-01. +// Package apimanagement implements the Azure ARM Apimanagement service API version 2019-12-01. // // ApiManagement Client package apimanagement diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/delegationsettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/delegationsettings.go similarity index 79% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/delegationsettings.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/delegationsettings.go index b1dae8116b9dd..ab2b8d844c64e 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/delegationsettings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/delegationsettings.go @@ -48,7 +48,8 @@ func NewDelegationSettingsClientWithBaseURI(baseURI string, subscriptionID strin // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // parameters - create or update parameters. -func (client DelegationSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings) (result PortalDelegationSettings, err error) { +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client DelegationSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings, ifMatch string) (result PortalDelegationSettings, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DelegationSettingsClient.CreateOrUpdate") defer func() { @@ -67,7 +68,7 @@ func (client DelegationSettingsClient) CreateOrUpdate(ctx context.Context, resou return result, validation.NewError("apimanagement.DelegationSettingsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -89,14 +90,14 @@ func (client DelegationSettingsClient) CreateOrUpdate(ctx context.Context, resou } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client DelegationSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings) (*http.Request, error) { +func (client DelegationSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -108,6 +109,10 @@ func (client DelegationSettingsClient) CreateOrUpdatePreparer(ctx context.Contex autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -130,7 +135,7 @@ func (client DelegationSettingsClient) CreateOrUpdateResponder(resp *http.Respon return } -// Get get Delegation settings. +// Get get Delegation Settings for the Portal. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -182,7 +187,7 @@ func (client DelegationSettingsClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -266,7 +271,7 @@ func (client DelegationSettingsClient) GetEntityTagPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -297,6 +302,90 @@ func (client DelegationSettingsClient) GetEntityTagResponder(resp *http.Response return } +// ListSecrets gets the secret validation key of the DelegationSettings. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client DelegationSettingsClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string) (result PortalSettingValidationKeyContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DelegationSettingsClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.DelegationSettingsClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.DelegationSettingsClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client DelegationSettingsClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/delegation/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client DelegationSettingsClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client DelegationSettingsClient) ListSecretsResponder(resp *http.Response) (result PortalSettingValidationKeyContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Update update Delegation settings. // Parameters: // resourceGroupName - the name of the resource group. @@ -352,7 +441,7 @@ func (client DelegationSettingsClient) UpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnostic.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/diagnostic.go similarity index 86% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnostic.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/diagnostic.go index a6b1fa54d2a74..261e3cd2b2eb1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/diagnostic.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/diagnostic.go @@ -68,10 +68,45 @@ func (client DiagnosticClient) CreateOrUpdate(ctx context.Context, resourceGroup {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.LoggerID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.DiagnosticContractProperties.Sampling", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.DiagnosticContractProperties.Sampling.Percentage", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Frontend", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Request.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Frontend.Response", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Frontend.Response.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Backend", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Request.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + {Target: "parameters.DiagnosticContractProperties.Backend.Response", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body.Bytes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DiagnosticContractProperties.Backend.Response.Body.Bytes", Name: validation.InclusiveMaximum, Rule: int64(8192), Chain: nil}}}, + }}, + }}, + }}, + }}}}}); err != nil { return result, validation.NewError("apimanagement.DiagnosticClient", "CreateOrUpdate", err.Error()) } @@ -105,7 +140,7 @@ func (client DiagnosticClient) CreateOrUpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -169,7 +204,7 @@ func (client DiagnosticClient) Delete(ctx context.Context, resourceGroupName str {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.DiagnosticClient", "Delete", err.Error()) } @@ -203,7 +238,7 @@ func (client DiagnosticClient) DeletePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -259,7 +294,7 @@ func (client DiagnosticClient) Get(ctx context.Context, resourceGroupName string {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.DiagnosticClient", "Get", err.Error()) } @@ -293,7 +328,7 @@ func (client DiagnosticClient) GetPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -349,7 +384,7 @@ func (client DiagnosticClient) GetEntityTag(ctx context.Context, resourceGroupNa {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.DiagnosticClient", "GetEntityTag", err.Error()) } @@ -383,7 +418,7 @@ func (client DiagnosticClient) GetEntityTagPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -418,9 +453,9 @@ func (client DiagnosticClient) GetEntityTagResponder(resp *http.Response) (resul // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client DiagnosticClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result DiagnosticCollectionPage, err error) { @@ -478,7 +513,7 @@ func (client DiagnosticClient) ListByServicePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -583,7 +618,7 @@ func (client DiagnosticClient) Update(ctx context.Context, resourceGroupName str {TargetValue: diagnosticID, Constraints: []validation.Constraint{{Target: "diagnosticID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "diagnosticID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "diagnosticID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "diagnosticID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.DiagnosticClient", "Update", err.Error()) } @@ -617,7 +652,7 @@ func (client DiagnosticClient) UpdatePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/emailtemplate.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/emailtemplate.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/emailtemplate.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/emailtemplate.go index a8b320afd02b4..f8c001cec5afe 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/emailtemplate.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/emailtemplate.go @@ -107,7 +107,7 @@ func (client EmailTemplateClient) CreateOrUpdatePreparer(ctx context.Context, re "templateName": autorest.Encode("path", templateName), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -201,7 +201,7 @@ func (client EmailTemplateClient) DeletePreparer(ctx context.Context, resourceGr "templateName": autorest.Encode("path", templateName), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -287,7 +287,7 @@ func (client EmailTemplateClient) GetPreparer(ctx context.Context, resourceGroup "templateName": autorest.Encode("path", templateName), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -373,7 +373,7 @@ func (client EmailTemplateClient) GetEntityTagPreparer(ctx context.Context, reso "templateName": autorest.Encode("path", templateName), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -408,9 +408,12 @@ func (client EmailTemplateClient) GetEntityTagResponder(resp *http.Response) (re // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client EmailTemplateClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result EmailTemplateCollectionPage, err error) { +func (client EmailTemplateClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result EmailTemplateCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateClient.ListByService") defer func() { @@ -436,7 +439,7 @@ func (client EmailTemplateClient) ListByService(ctx context.Context, resourceGro } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, top, skip) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "ListByService", nil, "Failure preparing request") return @@ -458,17 +461,20 @@ func (client EmailTemplateClient) ListByService(ctx context.Context, resourceGro } // ListByServicePreparer prepares the ListByService request. -func (client EmailTemplateClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (*http.Request, error) { +func (client EmailTemplateClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } @@ -525,7 +531,7 @@ func (client EmailTemplateClient) listByServiceNextResults(ctx context.Context, } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client EmailTemplateClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result EmailTemplateCollectionIterator, err error) { +func (client EmailTemplateClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result EmailTemplateCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateClient.ListByService") defer func() { @@ -536,7 +542,7 @@ func (client EmailTemplateClient) ListByServiceComplete(ctx context.Context, res tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) return } @@ -546,7 +552,9 @@ func (client EmailTemplateClient) ListByServiceComplete(ctx context.Context, res // serviceName - the name of the API Management service. // templateName - email Template Name Identifier. // parameters - update parameters. -func (client EmailTemplateClient) Update(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters) (result autorest.Response, err error) { +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client EmailTemplateClient) Update(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateClient.Update") defer func() { @@ -565,7 +573,7 @@ func (client EmailTemplateClient) Update(ctx context.Context, resourceGroupName return result, validation.NewError("apimanagement.EmailTemplateClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, templateName, parameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, templateName, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.EmailTemplateClient", "Update", nil, "Failure preparing request") return @@ -587,7 +595,7 @@ func (client EmailTemplateClient) Update(ctx context.Context, resourceGroupName } // UpdatePreparer prepares the Update request. -func (client EmailTemplateClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters) (*http.Request, error) { +func (client EmailTemplateClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), @@ -595,7 +603,7 @@ func (client EmailTemplateClient) UpdatePreparer(ctx context.Context, resourceGr "templateName": autorest.Encode("path", templateName), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -606,7 +614,8 @@ func (client EmailTemplateClient) UpdatePreparer(ctx context.Context, resourceGr autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/templates/{templateName}", pathParameters), autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gateway.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gateway.go new file mode 100644 index 0000000000000..0f3387758eb5e --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gateway.go @@ -0,0 +1,931 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GatewayClient is the apiManagement Client +type GatewayClient struct { + BaseClient +} + +// NewGatewayClient creates an instance of the GatewayClient client. +func NewGatewayClient(subscriptionID string) GatewayClient { + return NewGatewayClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGatewayClientWithBaseURI creates an instance of the GatewayClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewGatewayClientWithBaseURI(baseURI string, subscriptionID string) GatewayClient { + return GatewayClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a Gateway to be used in Api Management instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client GatewayClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayContract, ifMatch string) (result GatewayContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.GatewayContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.LocationData", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.LocationData.Name", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.LocationData.Name", Name: validation.MaxLength, Rule: 256, Chain: nil}}}, + {Target: "parameters.GatewayContractProperties.LocationData.City", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.LocationData.City", Name: validation.MaxLength, Rule: 256, Chain: nil}}}, + {Target: "parameters.GatewayContractProperties.LocationData.District", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.LocationData.District", Name: validation.MaxLength, Rule: 256, Chain: nil}}}, + {Target: "parameters.GatewayContractProperties.LocationData.CountryOrRegion", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.LocationData.CountryOrRegion", Name: validation.MaxLength, Rule: 256, Chain: nil}}}, + }}, + {Target: "parameters.GatewayContractProperties.Description", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.GatewayContractProperties.Description", Name: validation.MaxLength, Rule: 1000, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, gatewayID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client GatewayClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client GatewayClient) CreateOrUpdateResponder(resp *http.Response) (result GatewayContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specific Gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client GatewayClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, ifMatch string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, gatewayID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GatewayClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GatewayClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GenerateToken gets the Shared Access Authorization Token for the gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +func (client GatewayClient) GenerateToken(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayTokenRequestContract) (result GatewayTokenContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.GenerateToken") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Expiry", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "GenerateToken", err.Error()) + } + + req, err := client.GenerateTokenPreparer(ctx, resourceGroupName, serviceName, gatewayID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "GenerateToken", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateTokenSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "GenerateToken", resp, "Failure sending request") + return + } + + result, err = client.GenerateTokenResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "GenerateToken", resp, "Failure responding to request") + } + + return +} + +// GenerateTokenPreparer prepares the GenerateToken request. +func (client GatewayClient) GenerateTokenPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayTokenRequestContract) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/generateToken", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateTokenSender sends the GenerateToken request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) GenerateTokenSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GenerateTokenResponder handles the response to the GenerateToken request. The method always +// closes the http.Response Body. +func (client GatewayClient) GenerateTokenResponder(resp *http.Response) (result GatewayTokenContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets the details of the Gateway specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +func (client GatewayClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string) (result GatewayContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, gatewayID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client GatewayClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client GatewayClient) GetResponder(resp *http.Response) (result GatewayContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the Gateway specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +func (client GatewayClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.GetEntityTag") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, gatewayID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client GatewayClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client GatewayClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of gateways registered with service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// top - number of records to return. +// skip - number of records to skip. +func (client GatewayClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result GatewayCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.ListByService") + defer func() { + sc := -1 + if result.gc.Response.Response != nil { + sc = result.gc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.gc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "ListByService", resp, "Failure sending request") + return + } + + result.gc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client GatewayClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client GatewayClient) ListByServiceResponder(resp *http.Response) (result GatewayCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client GatewayClient) listByServiceNextResults(ctx context.Context, lastResults GatewayCollection) (result GatewayCollection, err error) { + req, err := lastResults.gatewayCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client GatewayClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, top *int32, skip *int32) (result GatewayCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.ListByService") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, top, skip) + return +} + +// ListKeys retrieves gateway keys. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +func (client GatewayClient) ListKeys(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string) (result GatewayKeysContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.ListKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "ListKeys", err.Error()) + } + + req, err := client.ListKeysPreparer(ctx, resourceGroupName, serviceName, gatewayID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "ListKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "ListKeys", resp, "Failure responding to request") + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client GatewayClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/listKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeysSender sends the ListKeys request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) ListKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListKeysResponder handles the response to the ListKeys request. The method always +// closes the http.Response Body. +func (client GatewayClient) ListKeysResponder(resp *http.Response) (result GatewayKeysContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateKey regenerates specified gateway key invalidating any tokens created with it. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +func (client GatewayClient) RegenerateKey(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayKeyRegenerationRequestContract) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.RegenerateKey") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "RegenerateKey", err.Error()) + } + + req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, serviceName, gatewayID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "RegenerateKey", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateKeySender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "RegenerateKey", resp, "Failure sending request") + return + } + + result, err = client.RegenerateKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "RegenerateKey", resp, "Failure responding to request") + } + + return +} + +// RegenerateKeyPreparer prepares the RegenerateKey request. +func (client GatewayClient) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayKeyRegenerationRequestContract) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/regenerateKey", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateKeySender sends the RegenerateKey request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) RegenerateKeySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always +// closes the http.Response Body. +func (client GatewayClient) RegenerateKeyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates the details of the gateway specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client GatewayClient) Update(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayContract, ifMatch string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayClient.Update") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, gatewayID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client GatewayClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client GatewayClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayapi.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayapi.go new file mode 100644 index 0000000000000..90d8f99565f3d --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayapi.go @@ -0,0 +1,473 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GatewayAPIClient is the apiManagement Client +type GatewayAPIClient struct { + BaseClient +} + +// NewGatewayAPIClient creates an instance of the GatewayAPIClient client. +func NewGatewayAPIClient(subscriptionID string) GatewayAPIClient { + return NewGatewayAPIClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGatewayAPIClientWithBaseURI creates an instance of the GatewayAPIClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewGatewayAPIClientWithBaseURI(baseURI string, subscriptionID string) GatewayAPIClient { + return GatewayAPIClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate adds an API to the specified Gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// apiid - API identifier. Must be unique in the current API Management service instance. +func (client GatewayAPIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiid string, parameters *AssociationContract) (result APIContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayAPIClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayAPIClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, gatewayID, apiid, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client GatewayAPIClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiid string, parameters *AssociationContract) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayAPIClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client GatewayAPIClient) CreateOrUpdateResponder(resp *http.Response) (result APIContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified API from the specified Gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// apiid - API identifier. Must be unique in the current API Management service instance. +func (client GatewayAPIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiid string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayAPIClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayAPIClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, gatewayID, apiid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GatewayAPIClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayAPIClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GatewayAPIClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetEntityTag checks that API entity specified by identifier is associated with the Gateway entity. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// apiid - API identifier. Must be unique in the current API Management service instance. +func (client GatewayAPIClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiid string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayAPIClient.GetEntityTag") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: apiid, + Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayAPIClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, gatewayID, apiid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client GatewayAPIClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "apiId": autorest.Encode("path", apiid), + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis/{apiId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayAPIClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client GatewayAPIClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of the APIs associated with a gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// top - number of records to return. +// skip - number of records to skip. +func (client GatewayAPIClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, top *int32, skip *int32) (result APICollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayAPIClient.ListByService") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayAPIClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, gatewayID, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "ListByService", resp, "Failure sending request") + return + } + + result.ac, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client GatewayAPIClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/apis", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayAPIClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client GatewayAPIClient) ListByServiceResponder(resp *http.Response) (result APICollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client GatewayAPIClient) listByServiceNextResults(ctx context.Context, lastResults APICollection) (result APICollection, err error) { + req, err := lastResults.aPICollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayAPIClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client GatewayAPIClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, top *int32, skip *int32) (result APICollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayAPIClient.ListByService") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, gatewayID, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayhostnameconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayhostnameconfiguration.go new file mode 100644 index 0000000000000..9918fef1ccf8f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/gatewayhostnameconfiguration.go @@ -0,0 +1,566 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GatewayHostnameConfigurationClient is the apiManagement Client +type GatewayHostnameConfigurationClient struct { + BaseClient +} + +// NewGatewayHostnameConfigurationClient creates an instance of the GatewayHostnameConfigurationClient client. +func NewGatewayHostnameConfigurationClient(subscriptionID string) GatewayHostnameConfigurationClient { + return NewGatewayHostnameConfigurationClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGatewayHostnameConfigurationClientWithBaseURI creates an instance of the GatewayHostnameConfigurationClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewGatewayHostnameConfigurationClientWithBaseURI(baseURI string, subscriptionID string) GatewayHostnameConfigurationClient { + return GatewayHostnameConfigurationClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates of updates hostname configuration for a Gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// hcID - gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. +func (client GatewayHostnameConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string, parameters GatewayHostnameConfigurationContract) (result GatewayHostnameConfigurationContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: hcID, + Constraints: []validation.Constraint{{Target: "hcID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "hcID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayHostnameConfigurationClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, gatewayID, hcID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client GatewayHostnameConfigurationClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string, parameters GatewayHostnameConfigurationContract) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "hcId": autorest.Encode("path", hcID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayHostnameConfigurationClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client GatewayHostnameConfigurationClient) CreateOrUpdateResponder(resp *http.Response) (result GatewayHostnameConfigurationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified hostname configuration from the specified Gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// hcID - gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. +func (client GatewayHostnameConfigurationClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: hcID, + Constraints: []validation.Constraint{{Target: "hcID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "hcID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayHostnameConfigurationClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, gatewayID, hcID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GatewayHostnameConfigurationClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "hcId": autorest.Encode("path", hcID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayHostnameConfigurationClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client GatewayHostnameConfigurationClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the Gateway hostname configuration specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// hcID - gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. +func (client GatewayHostnameConfigurationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string) (result GatewayHostnameConfigurationContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: hcID, + Constraints: []validation.Constraint{{Target: "hcID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "hcID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayHostnameConfigurationClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, gatewayID, hcID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client GatewayHostnameConfigurationClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "hcId": autorest.Encode("path", hcID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayHostnameConfigurationClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client GatewayHostnameConfigurationClient) GetResponder(resp *http.Response) (result GatewayHostnameConfigurationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag checks that hostname configuration entity specified by identifier exists for specified Gateway entity. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// hcID - gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. +func (client GatewayHostnameConfigurationClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationClient.GetEntityTag") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: hcID, + Constraints: []validation.Constraint{{Target: "hcID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "hcID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayHostnameConfigurationClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, gatewayID, hcID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client GatewayHostnameConfigurationClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "hcId": autorest.Encode("path", hcID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations/{hcId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayHostnameConfigurationClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client GatewayHostnameConfigurationClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists the collection of hostname configurations for the specified gateway. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// gatewayID - gateway entity identifier. Must be unique in the current API Management service instance. Must +// not have value 'managed' +// top - number of records to return. +// skip - number of records to skip. +func (client GatewayHostnameConfigurationClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, top *int32, skip *int32) (result GatewayHostnameConfigurationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationClient.ListByService") + defer func() { + sc := -1 + if result.ghcc.Response.Response != nil { + sc = result.ghcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: gatewayID, + Constraints: []validation.Constraint{{Target: "gatewayID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "gatewayID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.GatewayHostnameConfigurationClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, gatewayID, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.ghcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "ListByService", resp, "Failure sending request") + return + } + + result.ghcc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client GatewayHostnameConfigurationClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/gateways/{gatewayId}/hostnameConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client GatewayHostnameConfigurationClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client GatewayHostnameConfigurationClient) ListByServiceResponder(resp *http.Response) (result GatewayHostnameConfigurationCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client GatewayHostnameConfigurationClient) listByServiceNextResults(ctx context.Context, lastResults GatewayHostnameConfigurationCollection) (result GatewayHostnameConfigurationCollection, err error) { + req, err := lastResults.gatewayHostnameConfigurationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.GatewayHostnameConfigurationClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client GatewayHostnameConfigurationClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, top *int32, skip *int32) (result GatewayHostnameConfigurationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationClient.ListByService") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, gatewayID, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/group.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/group.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/group.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/group.go index 52e09301e764a..70daa0d041a91 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/group.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/group.go @@ -66,9 +66,8 @@ func (client GroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.GroupCreateParametersProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.GroupCreateParametersProperties.DisplayName", Name: validation.Null, Rule: true, @@ -109,7 +108,7 @@ func (client GroupClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -171,9 +170,8 @@ func (client GroupClient) Delete(ctx context.Context, resourceGroupName string, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "Delete", err.Error()) } @@ -207,7 +205,7 @@ func (client GroupClient) DeletePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -261,9 +259,8 @@ func (client GroupClient) Get(ctx context.Context, resourceGroupName string, ser {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "Get", err.Error()) } @@ -297,7 +294,7 @@ func (client GroupClient) GetPreparer(ctx context.Context, resourceGroupName str "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -351,9 +348,8 @@ func (client GroupClient) GetEntityTag(ctx context.Context, resourceGroupName st {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "GetEntityTag", err.Error()) } @@ -387,7 +383,7 @@ func (client GroupClient) GetEntityTagPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -422,12 +418,11 @@ func (client GroupClient) GetEntityTagResponder(resp *http.Response) (result aut // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | type | eq, ne | N/A | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| aadObjectId | filter | eq | |
// top - number of records to return. // skip - number of records to skip. func (client GroupClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result GroupCollectionPage, err error) { @@ -485,7 +480,7 @@ func (client GroupClient) ListByServicePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -588,9 +583,8 @@ func (client GroupClient) Update(ctx context.Context, resourceGroupName string, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupClient", "Update", err.Error()) } @@ -624,7 +618,7 @@ func (client GroupClient) UpdatePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/groupuser.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/groupuser.go similarity index 83% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/groupuser.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/groupuser.go index a1a3bc42fa323..89595eb920dad 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/groupuser.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/groupuser.go @@ -47,8 +47,8 @@ func NewGroupUserClientWithBaseURI(baseURI string, subscriptionID string) GroupU // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // groupID - group identifier. Must be unique in the current API Management service instance. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client GroupUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (result autorest.Response, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client GroupUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GroupUserClient.CheckEntityExists") defer func() { @@ -65,17 +65,15 @@ func (client GroupUserClient) CheckEntityExists(ctx context.Context, resourceGro {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupUserClient", "CheckEntityExists", err.Error()) } - req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, groupID, UID) + req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, groupID, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "CheckEntityExists", nil, "Failure preparing request") return @@ -97,16 +95,16 @@ func (client GroupUserClient) CheckEntityExists(ctx context.Context, resourceGro } // CheckEntityExistsPreparer prepares the CheckEntityExists request. -func (client GroupUserClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (*http.Request, error) { +func (client GroupUserClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "groupId": autorest.Encode("path", groupID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -114,7 +112,7 @@ func (client GroupUserClient) CheckEntityExistsPreparer(ctx context.Context, res preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -137,13 +135,13 @@ func (client GroupUserClient) CheckEntityExistsResponder(resp *http.Response) (r return } -// Create adds a user to the specified group. +// Create add existing user to existing group // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // groupID - group identifier. Must be unique in the current API Management service instance. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client GroupUserClient) Create(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (result UserContract, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client GroupUserClient) Create(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string) (result UserContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GroupUserClient.Create") defer func() { @@ -160,17 +158,15 @@ func (client GroupUserClient) Create(ctx context.Context, resourceGroupName stri {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupUserClient", "Create", err.Error()) } - req, err := client.CreatePreparer(ctx, resourceGroupName, serviceName, groupID, UID) + req, err := client.CreatePreparer(ctx, resourceGroupName, serviceName, groupID, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "Create", nil, "Failure preparing request") return @@ -192,16 +188,16 @@ func (client GroupUserClient) Create(ctx context.Context, resourceGroupName stri } // CreatePreparer prepares the Create request. -func (client GroupUserClient) CreatePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (*http.Request, error) { +func (client GroupUserClient) CreatePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "groupId": autorest.Encode("path", groupID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -209,7 +205,7 @@ func (client GroupUserClient) CreatePreparer(ctx context.Context, resourceGroupN preparer := autorest.CreatePreparer( autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -238,8 +234,8 @@ func (client GroupUserClient) CreateResponder(resp *http.Response) (result UserC // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // groupID - group identifier. Must be unique in the current API Management service instance. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client GroupUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (result autorest.Response, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client GroupUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GroupUserClient.Delete") defer func() { @@ -256,17 +252,15 @@ func (client GroupUserClient) Delete(ctx context.Context, resourceGroupName stri {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.GroupUserClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, groupID, UID) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, groupID, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.GroupUserClient", "Delete", nil, "Failure preparing request") return @@ -288,16 +282,16 @@ func (client GroupUserClient) Delete(ctx context.Context, resourceGroupName stri } // DeletePreparer prepares the Delete request. -func (client GroupUserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, UID string) (*http.Request, error) { +func (client GroupUserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "groupId": autorest.Encode("path", groupID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -305,7 +299,7 @@ func (client GroupUserClient) DeletePreparer(ctx context.Context, resourceGroupN preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -328,20 +322,18 @@ func (client GroupUserClient) DeleteResponder(resp *http.Response) (result autor return } -// List lists a collection of the members of the group, specified by its identifier. +// List lists a collection of user entities associated with the group. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // groupID - group identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |------------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | N/A | -// | registrationDate | ge, le, eq, ne, gt, lt | N/A | -// | note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| firstName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| registrationDate | filter | ge, le, eq, ne, gt, lt | |
| +// note | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client GroupUserClient) List(ctx context.Context, resourceGroupName string, serviceName string, groupID string, filter string, top *int32, skip *int32) (result UserCollectionPage, err error) { @@ -361,9 +353,8 @@ func (client GroupUserClient) List(ctx context.Context, resourceGroupName string {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -404,7 +395,7 @@ func (client GroupUserClient) ListPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/identityprovider.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/identityprovider.go similarity index 85% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/identityprovider.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/identityprovider.go index a0ce1761a349a..7ab7277941acf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/identityprovider.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/identityprovider.go @@ -50,7 +50,7 @@ func NewIdentityProviderClientWithBaseURI(baseURI string, subscriptionID string) // identityProviderName - identity Provider Type identifier. // parameters - create parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client IdentityProviderClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderContract, ifMatch string) (result IdentityProviderContract, err error) { +func (client IdentityProviderClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderCreateContract, ifMatch string) (result IdentityProviderContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderClient.CreateOrUpdate") defer func() { @@ -67,11 +67,11 @@ func (client IdentityProviderClient) CreateOrUpdate(ctx context.Context, resourc {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.IdentityProviderContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.IdentityProviderContractProperties.ClientID", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.IdentityProviderContractProperties.ClientID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {Target: "parameters.IdentityProviderContractProperties.ClientSecret", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.IdentityProviderContractProperties.ClientSecret", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "parameters.IdentityProviderCreateContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.IdentityProviderCreateContractProperties.ClientID", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.IdentityProviderCreateContractProperties.ClientID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {Target: "parameters.IdentityProviderCreateContractProperties.ClientSecret", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.IdentityProviderCreateContractProperties.ClientSecret", Name: validation.MinLength, Rule: 1, Chain: nil}}}, }}}}}); err != nil { return result, validation.NewError("apimanagement.IdentityProviderClient", "CreateOrUpdate", err.Error()) } @@ -98,7 +98,7 @@ func (client IdentityProviderClient) CreateOrUpdate(ctx context.Context, resourc } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client IdentityProviderClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderContract, ifMatch string) (*http.Request, error) { +func (client IdentityProviderClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderCreateContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "identityProviderName": autorest.Encode("path", identityProviderName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -106,7 +106,7 @@ func (client IdentityProviderClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -200,7 +200,7 @@ func (client IdentityProviderClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -286,7 +286,7 @@ func (client IdentityProviderClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -372,7 +372,7 @@ func (client IdentityProviderClient) GetEntityTagPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -456,7 +456,7 @@ func (client IdentityProviderClient) ListByServicePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -525,6 +525,92 @@ func (client IdentityProviderClient) ListByServiceComplete(ctx context.Context, return } +// ListSecrets gets the client secret details of the Identity Provider. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// identityProviderName - identity Provider Type identifier. +func (client IdentityProviderClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType) (result ClientSecretContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.IdentityProviderClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName, identityProviderName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IdentityProviderClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client IdentityProviderClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "identityProviderName": autorest.Encode("path", identityProviderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identityProviders/{identityProviderName}/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client IdentityProviderClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client IdentityProviderClient) ListSecretsResponder(resp *http.Response) (result ClientSecretContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Update updates an existing IdentityProvider configuration. // Parameters: // resourceGroupName - the name of the resource group. @@ -582,7 +668,7 @@ func (client IdentityProviderClient) UpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/issue.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/issue.go new file mode 100644 index 0000000000000..3409671f02f17 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/issue.go @@ -0,0 +1,279 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IssueClient is the apiManagement Client +type IssueClient struct { + BaseClient +} + +// NewIssueClient creates an instance of the IssueClient client. +func NewIssueClient(subscriptionID string) IssueClient { + return NewIssueClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIssueClientWithBaseURI creates an instance of the IssueClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewIssueClientWithBaseURI(baseURI string, subscriptionID string) IssueClient { + return IssueClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets API Management issue details +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// issueID - issue identifier. Must be unique in the current API Management service instance. +func (client IssueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, issueID string) (result IssueContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: issueID, + Constraints: []validation.Constraint{{Target: "issueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "issueID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "issueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.IssueClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, issueID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client IssueClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, issueID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "issueId": autorest.Encode("path", issueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues/{issueId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client IssueClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IssueClient) GetResponder(resp *http.Response) (result IssueContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByService lists a collection of issues in the specified service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| apiId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| title | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| authorName | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| state | filter | eq | |
+// top - number of records to return. +// skip - number of records to skip. +func (client IssueClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result IssueCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueClient.ListByService") + defer func() { + sc := -1 + if result.ic.Response.Response != nil { + sc = result.ic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.IssueClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.ic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "ListByService", resp, "Failure sending request") + return + } + + result.ic, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client IssueClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/issues", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client IssueClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client IssueClient) ListByServiceResponder(resp *http.Response) (result IssueCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client IssueClient) listByServiceNextResults(ctx context.Context, lastResults IssueCollection) (result IssueCollection, err error) { + req, err := lastResults.issueCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.IssueClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.IssueClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.IssueClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client IssueClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result IssueCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueClient.ListByService") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/logger.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/logger.go similarity index 86% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/logger.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/logger.go index 1ee32fda0fd7e..ac33606669d20 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/logger.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/logger.go @@ -46,10 +46,10 @@ func NewLoggerClientWithBaseURI(baseURI string, subscriptionID string) LoggerCli // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// loggerid - logger identifier. Must be unique in the API Management service instance. +// loggerID - logger identifier. Must be unique in the API Management service instance. // parameters - create parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerContract, ifMatch string) (result LoggerContract, err error) { +func (client LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, parameters LoggerContract, ifMatch string) (result LoggerContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LoggerClient.CreateOrUpdate") defer func() { @@ -65,9 +65,9 @@ func (client LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: loggerID, + Constraints: []validation.Constraint{{Target: "loggerID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "loggerID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.LoggerContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.LoggerContractProperties.Description", Name: validation.Null, Rule: false, @@ -77,7 +77,7 @@ func (client LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName return result, validation.NewError("apimanagement.LoggerClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, loggerid, parameters, ifMatch) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, loggerID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -99,15 +99,15 @@ func (client LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client LoggerClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerContract, ifMatch string) (*http.Request, error) { +func (client LoggerClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, parameters LoggerContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "loggerid": autorest.Encode("path", loggerid), + "loggerId": autorest.Encode("path", loggerID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -116,7 +116,7 @@ func (client LoggerClient) CreateOrUpdatePreparer(ctx context.Context, resourceG autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) if len(ifMatch) > 0 { @@ -149,10 +149,11 @@ func (client LoggerClient) CreateOrUpdateResponder(resp *http.Response) (result // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// loggerid - logger identifier. Must be unique in the API Management service instance. +// loggerID - logger identifier. Must be unique in the API Management service instance. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client LoggerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, ifMatch string) (result autorest.Response, err error) { +// force - force deletion even if diagnostic is attached. +func (client LoggerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, ifMatch string, force *bool) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LoggerClient.Delete") defer func() { @@ -168,13 +169,13 @@ func (client LoggerClient) Delete(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: loggerID, + Constraints: []validation.Constraint{{Target: "loggerID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "loggerID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.LoggerClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, loggerid, ifMatch) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, loggerID, ifMatch, force) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Delete", nil, "Failure preparing request") return @@ -196,23 +197,26 @@ func (client LoggerClient) Delete(ctx context.Context, resourceGroupName string, } // DeletePreparer prepares the Delete request. -func (client LoggerClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, ifMatch string) (*http.Request, error) { +func (client LoggerClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, ifMatch string, force *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ - "loggerid": autorest.Encode("path", loggerid), + "loggerId": autorest.Encode("path", loggerID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}", pathParameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -240,8 +244,8 @@ func (client LoggerClient) DeleteResponder(resp *http.Response) (result autorest // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client LoggerClient) Get(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (result LoggerContract, err error) { +// loggerID - logger identifier. Must be unique in the API Management service instance. +func (client LoggerClient) Get(ctx context.Context, resourceGroupName string, serviceName string, loggerID string) (result LoggerContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LoggerClient.Get") defer func() { @@ -257,13 +261,13 @@ func (client LoggerClient) Get(ctx context.Context, resourceGroupName string, se Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: loggerID, + Constraints: []validation.Constraint{{Target: "loggerID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "loggerID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.LoggerClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, loggerid) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, loggerID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Get", nil, "Failure preparing request") return @@ -285,15 +289,15 @@ func (client LoggerClient) Get(ctx context.Context, resourceGroupName string, se } // GetPreparer prepares the Get request. -func (client LoggerClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (*http.Request, error) { +func (client LoggerClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "loggerid": autorest.Encode("path", loggerid), + "loggerId": autorest.Encode("path", loggerID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -301,7 +305,7 @@ func (client LoggerClient) GetPreparer(ctx context.Context, resourceGroupName st preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -329,8 +333,8 @@ func (client LoggerClient) GetResponder(resp *http.Response) (result LoggerContr // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// loggerid - logger identifier. Must be unique in the API Management service instance. -func (client LoggerClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (result autorest.Response, err error) { +// loggerID - logger identifier. Must be unique in the API Management service instance. +func (client LoggerClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, loggerID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LoggerClient.GetEntityTag") defer func() { @@ -346,13 +350,13 @@ func (client LoggerClient) GetEntityTag(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: loggerID, + Constraints: []validation.Constraint{{Target: "loggerID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "loggerID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.LoggerClient", "GetEntityTag", err.Error()) } - req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, loggerid) + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, loggerID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "GetEntityTag", nil, "Failure preparing request") return @@ -374,15 +378,15 @@ func (client LoggerClient) GetEntityTag(ctx context.Context, resourceGroupName s } // GetEntityTagPreparer prepares the GetEntityTag request. -func (client LoggerClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string) (*http.Request, error) { +func (client LoggerClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerID string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "loggerid": autorest.Encode("path", loggerid), + "loggerId": autorest.Encode("path", loggerID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -390,7 +394,7 @@ func (client LoggerClient) GetEntityTagPreparer(ctx context.Context, resourceGro preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -417,10 +421,11 @@ func (client LoggerClient) GetEntityTagResponder(resp *http.Response) (result au // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | type | eq | | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| loggerType | filter | eq | |
| resourceId | +// filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client LoggerClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result LoggerCollectionPage, err error) { @@ -478,7 +483,7 @@ func (client LoggerClient) ListByServicePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -560,11 +565,11 @@ func (client LoggerClient) ListByServiceComplete(ctx context.Context, resourceGr // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// loggerid - logger identifier. Must be unique in the API Management service instance. +// loggerID - logger identifier. Must be unique in the API Management service instance. // parameters - update parameters. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client LoggerClient) Update(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerUpdateContract, ifMatch string) (result autorest.Response, err error) { +func (client LoggerClient) Update(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, parameters LoggerUpdateContract, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LoggerClient.Update") defer func() { @@ -580,13 +585,13 @@ func (client LoggerClient) Update(ctx context.Context, resourceGroupName string, Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: loggerid, - Constraints: []validation.Constraint{{Target: "loggerid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "loggerid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: loggerID, + Constraints: []validation.Constraint{{Target: "loggerID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "loggerID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.LoggerClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, loggerid, parameters, ifMatch) + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, loggerID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.LoggerClient", "Update", nil, "Failure preparing request") return @@ -608,15 +613,15 @@ func (client LoggerClient) Update(ctx context.Context, resourceGroupName string, } // UpdatePreparer prepares the Update request. -func (client LoggerClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerid string, parameters LoggerUpdateContract, ifMatch string) (*http.Request, error) { +func (client LoggerClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, parameters LoggerUpdateContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ - "loggerid": autorest.Encode("path", loggerid), + "loggerId": autorest.Encode("path", loggerID), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -625,7 +630,7 @@ func (client LoggerClient) UpdatePreparer(ctx context.Context, resourceGroupName autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/models.go similarity index 82% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/models.go index 66cc9d44cc66c..e72abf72834d4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/models.go @@ -30,7 +30,39 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement" + +// AlwaysLog enumerates the values for always log. +type AlwaysLog string + +const ( + // AllErrors Always log all erroneous request regardless of sampling settings. + AllErrors AlwaysLog = "allErrors" +) + +// PossibleAlwaysLogValues returns an array of possible values for the AlwaysLog const type. +func PossibleAlwaysLogValues() []AlwaysLog { + return []AlwaysLog{AllErrors} +} + +// ApimIdentityType enumerates the values for apim identity type. +type ApimIdentityType string + +const ( + // None ... + None ApimIdentityType = "None" + // SystemAssigned ... + SystemAssigned ApimIdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned ApimIdentityType = "SystemAssigned, UserAssigned" + // UserAssigned ... + UserAssigned ApimIdentityType = "UserAssigned" +) + +// PossibleApimIdentityTypeValues returns an array of possible values for the ApimIdentityType const type. +func PossibleApimIdentityTypeValues() []ApimIdentityType { + return []ApimIdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned} +} // APIType enumerates the values for api type. type APIType string @@ -47,6 +79,19 @@ func PossibleAPITypeValues() []APIType { return []APIType{HTTP, Soap} } +// AppType enumerates the values for app type. +type AppType string + +const ( + // DeveloperPortal User create request was sent by new developer portal. + DeveloperPortal AppType = "developerPortal" +) + +// PossibleAppTypeValues returns an array of possible values for the AppType const type. +func PossibleAppTypeValues() []AppType { + return []AppType{DeveloperPortal} +} + // AsyncOperationStatus enumerates the values for async operation status. type AsyncOperationStatus string @@ -190,6 +235,14 @@ func PossibleConnectivityStatusTypeValues() []ConnectivityStatusType { type ContentFormat string const ( + // Openapi The contents are inline and Content Type is a OpenApi 3.0 Document in YAML format. + Openapi ContentFormat = "openapi" + // Openapijson The contents are inline and Content Type is a OpenApi 3.0 Document in JSON format. + Openapijson ContentFormat = "openapi+json" + // OpenapijsonLink The Open Api 3.0 Json document is hosted on a publicly accessible internet address. + OpenapijsonLink ContentFormat = "openapi+json-link" + // OpenapiLink The Open Api 3.0 document is hosted on a publicly accessible internet address. + OpenapiLink ContentFormat = "openapi-link" // SwaggerJSON The contents are inline and Content Type is a OpenApi 2.0 Document. SwaggerJSON ContentFormat = "swagger-json" // SwaggerLinkJSON The Open Api 2.0 document is hosted on a publicly accessible internet address. @@ -206,13 +259,18 @@ const ( // PossibleContentFormatValues returns an array of possible values for the ContentFormat const type. func PossibleContentFormatValues() []ContentFormat { - return []ContentFormat{SwaggerJSON, SwaggerLinkJSON, WadlLinkJSON, WadlXML, Wsdl, WsdlLink} + return []ContentFormat{Openapi, Openapijson, OpenapijsonLink, OpenapiLink, SwaggerJSON, SwaggerLinkJSON, WadlLinkJSON, WadlXML, Wsdl, WsdlLink} } // ExportFormat enumerates the values for export format. type ExportFormat string const ( + // ExportFormatOpenapi Export the Api Definition in OpenApi Specification 3.0 to Storage Blob. + ExportFormatOpenapi ExportFormat = "openapi-link" + // ExportFormatOpenapiJSON Export the Api Definition in OpenApi Specification 3.0 as JSON document to + // Storage Blob. + ExportFormatOpenapiJSON ExportFormat = "openapi+json-link" // ExportFormatSwagger Export the Api Definition in OpenApi Specification 2.0 format to the Storage Blob. ExportFormatSwagger ExportFormat = "swagger-link" // ExportFormatWadl Export the Api Definition in WADL Schema to Storage Blob. @@ -224,7 +282,28 @@ const ( // PossibleExportFormatValues returns an array of possible values for the ExportFormat const type. func PossibleExportFormatValues() []ExportFormat { - return []ExportFormat{ExportFormatSwagger, ExportFormatWadl, ExportFormatWsdl} + return []ExportFormat{ExportFormatOpenapi, ExportFormatOpenapiJSON, ExportFormatSwagger, ExportFormatWadl, ExportFormatWsdl} +} + +// ExportResultFormat enumerates the values for export result format. +type ExportResultFormat string + +const ( + // ExportResultFormatOpenAPI Export the Api Definition in OpenApi Specification 3.0 to Storage Blob. + ExportResultFormatOpenAPI ExportResultFormat = "openapi-link" + // ExportResultFormatSwagger The Api Definition is exported in OpenApi Specification 2.0 format to the + // Storage Blob. + ExportResultFormatSwagger ExportResultFormat = "swagger-link-json" + // ExportResultFormatWadl Export the Api Definition in WADL Schema to Storage Blob. + ExportResultFormatWadl ExportResultFormat = "wadl-link-json" + // ExportResultFormatWsdl The Api Definition is exported in WSDL Schema to Storage Blob. This is only + // supported for APIs of Type `soap` + ExportResultFormatWsdl ExportResultFormat = "wsdl-link+xml" +) + +// PossibleExportResultFormatValues returns an array of possible values for the ExportResultFormat const type. +func PossibleExportResultFormatValues() []ExportResultFormat { + return []ExportResultFormat{ExportResultFormatOpenAPI, ExportResultFormatSwagger, ExportResultFormatWadl, ExportResultFormatWsdl} } // GrantType enumerates the values for grant type. @@ -270,19 +349,40 @@ func PossibleGroupTypeValues() []GroupType { type HostnameType string const ( - // Management ... - Management HostnameType = "Management" - // Portal ... - Portal HostnameType = "Portal" - // Proxy ... - Proxy HostnameType = "Proxy" - // Scm ... - Scm HostnameType = "Scm" + // HostnameTypeDeveloperPortal ... + HostnameTypeDeveloperPortal HostnameType = "DeveloperPortal" + // HostnameTypeManagement ... + HostnameTypeManagement HostnameType = "Management" + // HostnameTypePortal ... + HostnameTypePortal HostnameType = "Portal" + // HostnameTypeProxy ... + HostnameTypeProxy HostnameType = "Proxy" + // HostnameTypeScm ... + HostnameTypeScm HostnameType = "Scm" ) // PossibleHostnameTypeValues returns an array of possible values for the HostnameType const type. func PossibleHostnameTypeValues() []HostnameType { - return []HostnameType{Management, Portal, Proxy, Scm} + return []HostnameType{HostnameTypeDeveloperPortal, HostnameTypeManagement, HostnameTypePortal, HostnameTypeProxy, HostnameTypeScm} +} + +// HTTPCorrelationProtocol enumerates the values for http correlation protocol. +type HTTPCorrelationProtocol string + +const ( + // HTTPCorrelationProtocolLegacy Inject Request-Id and Request-Context headers with request correlation + // data. See + // https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/HttpCorrelationProtocol.md. + HTTPCorrelationProtocolLegacy HTTPCorrelationProtocol = "Legacy" + // HTTPCorrelationProtocolNone Do not read and inject correlation headers. + HTTPCorrelationProtocolNone HTTPCorrelationProtocol = "None" + // HTTPCorrelationProtocolW3C Inject Trace Context headers. See https://w3c.github.io/trace-context. + HTTPCorrelationProtocolW3C HTTPCorrelationProtocol = "W3C" +) + +// PossibleHTTPCorrelationProtocolValues returns an array of possible values for the HTTPCorrelationProtocol const type. +func PossibleHTTPCorrelationProtocolValues() []HTTPCorrelationProtocol { + return []HTTPCorrelationProtocol{HTTPCorrelationProtocolLegacy, HTTPCorrelationProtocolNone, HTTPCorrelationProtocolW3C} } // IdentityProviderType enumerates the values for identity provider type. @@ -406,6 +506,21 @@ func PossiblePolicyContentFormatValues() []PolicyContentFormat { return []PolicyContentFormat{Rawxml, RawxmlLink, XML, XMLLink} } +// PolicyExportFormat enumerates the values for policy export format. +type PolicyExportFormat string + +const ( + // PolicyExportFormatRawxml The contents are inline and Content type is a non XML encoded policy document. + PolicyExportFormatRawxml PolicyExportFormat = "rawxml" + // PolicyExportFormatXML The contents are inline and Content type is an XML document. + PolicyExportFormatXML PolicyExportFormat = "xml" +) + +// PossiblePolicyExportFormatValues returns an array of possible values for the PolicyExportFormat const type. +func PossiblePolicyExportFormatValues() []PolicyExportFormat { + return []PolicyExportFormat{PolicyExportFormatRawxml, PolicyExportFormatXML} +} + // PolicyScopeContract enumerates the values for policy scope contract. type PolicyScopeContract string @@ -457,21 +572,47 @@ func PossibleProtocolValues() []Protocol { return []Protocol{ProtocolHTTP, ProtocolHTTPS} } +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Created ... + Created ProvisioningState = "created" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Created} +} + // ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. type ResourceSkuCapacityScaleType string const ( - // Automatic ... - Automatic ResourceSkuCapacityScaleType = "automatic" - // Manual ... - Manual ResourceSkuCapacityScaleType = "manual" - // None ... - None ResourceSkuCapacityScaleType = "none" + // ResourceSkuCapacityScaleTypeAutomatic Supported scale type automatic. + ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "automatic" + // ResourceSkuCapacityScaleTypeManual Supported scale type manual. + ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "manual" + // ResourceSkuCapacityScaleTypeNone Scaling not supported. + ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "none" ) // PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type. func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType { - return []ResourceSkuCapacityScaleType{Automatic, Manual, None} + return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone} +} + +// SamplingType enumerates the values for sampling type. +type SamplingType string + +const ( + // Fixed Fixed-rate sampling. + Fixed SamplingType = "fixed" +) + +// PossibleSamplingTypeValues returns an array of possible values for the SamplingType const type. +func PossibleSamplingTypeValues() []SamplingType { + return []SamplingType{Fixed} } // SkuType enumerates the values for sku type. @@ -480,6 +621,8 @@ type SkuType string const ( // SkuTypeBasic Basic SKU of Api Management. SkuTypeBasic SkuType = "Basic" + // SkuTypeConsumption Consumption SKU of Api Management. + SkuTypeConsumption SkuType = "Consumption" // SkuTypeDeveloper Developer SKU of Api Management. SkuTypeDeveloper SkuType = "Developer" // SkuTypePremium Premium SKU of Api Management. @@ -490,7 +633,7 @@ const ( // PossibleSkuTypeValues returns an array of possible values for the SkuType const type. func PossibleSkuTypeValues() []SkuType { - return []SkuType{SkuTypeBasic, SkuTypeDeveloper, SkuTypePremium, SkuTypeStandard} + return []SkuType{SkuTypeBasic, SkuTypeConsumption, SkuTypeDeveloper, SkuTypePremium, SkuTypeStandard} } // SoapAPIType enumerates the values for soap api type. @@ -625,6 +768,26 @@ func PossibleUserStateValues() []UserState { return []UserState{UserStateActive, UserStateBlocked, UserStateDeleted, UserStatePending} } +// Verbosity enumerates the values for verbosity. +type Verbosity string + +const ( + // Error Only traces with 'severity' set to 'error' will be sent to the logger attached to this diagnostic + // instance. + Error Verbosity = "error" + // Information Traces with 'severity' set to 'information' and 'error' will be sent to the logger attached + // to this diagnostic instance. + Information Verbosity = "information" + // Verbose All the traces emitted by trace policies will be sent to the logger attached to this diagnostic + // instance. + Verbose Verbosity = "verbose" +) + +// PossibleVerbosityValues returns an array of possible values for the Verbosity const type. +func PossibleVerbosityValues() []Verbosity { + return []Verbosity{Error, Information, Verbose} +} + // VersioningScheme enumerates the values for versioning scheme. type VersioningScheme string @@ -682,21 +845,60 @@ type AccessInformationContract struct { autorest.Response `json:"-"` // ID - Identifier. ID *string `json:"id,omitempty"` - // PrimaryKey - Primary access key. + // PrimaryKey - Primary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. PrimaryKey *string `json:"primaryKey,omitempty"` - // SecondaryKey - Secondary access key. + // SecondaryKey - Secondary access key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. SecondaryKey *string `json:"secondaryKey,omitempty"` - // Enabled - Tenant access information of the API Management service. + // Enabled - Determines whether direct access is enabled. Enabled *bool `json:"enabled,omitempty"` } -// AccessInformationUpdateParameters tenant access information update parameters of the API Management -// service. -type AccessInformationUpdateParameters struct { - // Enabled - Tenant access information of the API Management service. +// AccessInformationUpdateParameterProperties tenant access information update parameters of the API +// Management service +type AccessInformationUpdateParameterProperties struct { + // Enabled - Determines whether direct access is enabled. Enabled *bool `json:"enabled,omitempty"` } +// AccessInformationUpdateParameters tenant access information update parameters. +type AccessInformationUpdateParameters struct { + // AccessInformationUpdateParameterProperties - Tenant access information update parameter properties. + *AccessInformationUpdateParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccessInformationUpdateParameters. +func (aiup AccessInformationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aiup.AccessInformationUpdateParameterProperties != nil { + objectMap["properties"] = aiup.AccessInformationUpdateParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccessInformationUpdateParameters struct. +func (aiup *AccessInformationUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var accessInformationUpdateParameterProperties AccessInformationUpdateParameterProperties + err = json.Unmarshal(*v, &accessInformationUpdateParameterProperties) + if err != nil { + return err + } + aiup.AccessInformationUpdateParameterProperties = &accessInformationUpdateParameterProperties + } + } + } + + return nil +} + // AdditionalLocation description of an additional API Management resource location. type AdditionalLocation struct { // Location - The location name of the additional region among Azure Data center regions. @@ -711,6 +913,8 @@ type AdditionalLocation struct { VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` // GatewayRegionalURL - READ-ONLY; Gateway URL of the API Management service in the Region. GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty"` + // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in this additional location. + DisableGateway *bool `json:"disableGateway,omitempty"` } // APICollection paged Api list representation. @@ -859,7 +1063,7 @@ func NewAPICollectionPage(getNextPage func(context.Context, APICollection) (APIC return APICollectionPage{fn: getNextPage} } -// APIContract API details. +// APIContract api details. type APIContract struct { autorest.Response `json:"-"` // APIContractProperties - Api entity contract properties. @@ -934,14 +1138,17 @@ func (ac *APIContract) UnmarshalJSON(body []byte) error { // APIContractProperties api Entity Properties type APIContractProperties struct { - // DisplayName - API name. + // SourceAPIID - API identifier of the source API. + SourceAPIID *string `json:"sourceApiId,omitempty"` + // DisplayName - API name. Must be 1 to 300 characters long. DisplayName *string `json:"displayName,omitempty"` - // ServiceURL - Absolute URL of the backend service implementing this API. + // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. ServiceURL *string `json:"serviceUrl,omitempty"` // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. Path *string `json:"path,omitempty"` // Protocols - Describes on which protocols the operations in this API can be invoked. - Protocols *[]Protocol `json:"protocols,omitempty"` + Protocols *[]Protocol `json:"protocols,omitempty"` + // APIVersionSet - Version set details APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` // Description - Description of the API. May include HTML formatting tags. Description *string `json:"description,omitempty"` @@ -955,7 +1162,7 @@ type APIContractProperties struct { APIRevision *string `json:"apiRevision,omitempty"` // APIVersion - Indicates the Version identifier of the API if the API is versioned APIVersion *string `json:"apiVersion,omitempty"` - // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. + // IsCurrent - Indicates if API revision is current api revision. IsCurrent *bool `json:"isCurrent,omitempty"` // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. IsOnline *bool `json:"isOnline,omitempty"` @@ -965,6 +1172,8 @@ type APIContractProperties struct { APIVersionDescription *string `json:"apiVersionDescription,omitempty"` // APIVersionSetID - A resource identifier for the related ApiVersionSet. APIVersionSetID *string `json:"apiVersionSetId,omitempty"` + // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` } // APIContractUpdateProperties API update contract properties. @@ -989,7 +1198,7 @@ type APIContractUpdateProperties struct { APIRevision *string `json:"apiRevision,omitempty"` // APIVersion - Indicates the Version identifier of the API if the API is versioned APIVersion *string `json:"apiVersion,omitempty"` - // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. + // IsCurrent - Indicates if API revision is current api revision. IsCurrent *bool `json:"isCurrent,omitempty"` // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. IsOnline *bool `json:"isOnline,omitempty"` @@ -999,6 +1208,37 @@ type APIContractUpdateProperties struct { APIVersionDescription *string `json:"apiVersionDescription,omitempty"` // APIVersionSetID - A resource identifier for the related ApiVersionSet. APIVersionSetID *string `json:"apiVersionSetId,omitempty"` + // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` +} + +// APICreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type APICreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *APICreateOrUpdateFuture) Result(client APIClient) (ac APIContract, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.APICreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ac.Response.Response, err = future.GetResult(sender); err == nil && ac.Response.Response.StatusCode != http.StatusNoContent { + ac, err = client.CreateOrUpdateResponder(ac.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APICreateOrUpdateFuture", "Result", ac.Response.Response, "Failure responding to request") + } + } + return } // APICreateOrUpdateParameter API Create or Update Parameters. @@ -1042,24 +1282,27 @@ func (acoup *APICreateOrUpdateParameter) UnmarshalJSON(body []byte) error { // APICreateOrUpdateProperties api Create or Update Properties. type APICreateOrUpdateProperties struct { - // ContentValue - Content value when Importing an API. - ContentValue *string `json:"contentValue,omitempty"` - // ContentFormat - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink' - ContentFormat ContentFormat `json:"contentFormat,omitempty"` + // Value - Content value when Importing an API. + Value *string `json:"value,omitempty"` + // Format - Format of the Content in which the API is getting imported. Possible values include: 'WadlXML', 'WadlLinkJSON', 'SwaggerJSON', 'SwaggerLinkJSON', 'Wsdl', 'WsdlLink', 'Openapi', 'Openapijson', 'OpenapiLink', 'OpenapijsonLink' + Format ContentFormat `json:"format,omitempty"` // WsdlSelector - Criteria to limit import of WSDL to a subset of the document. WsdlSelector *APICreateOrUpdatePropertiesWsdlSelector `json:"wsdlSelector,omitempty"` // SoapAPIType - Type of Api to create. // * `http` creates a SOAP to REST API // * `soap` creates a SOAP pass-through API. Possible values include: 'SoapToRest', 'SoapPassThrough' SoapAPIType SoapAPIType `json:"apiType,omitempty"` - // DisplayName - API name. + // SourceAPIID - API identifier of the source API. + SourceAPIID *string `json:"sourceApiId,omitempty"` + // DisplayName - API name. Must be 1 to 300 characters long. DisplayName *string `json:"displayName,omitempty"` - // ServiceURL - Absolute URL of the backend service implementing this API. + // ServiceURL - Absolute URL of the backend service implementing this API. Cannot be more than 2000 characters long. ServiceURL *string `json:"serviceUrl,omitempty"` // Path - Relative URL uniquely identifying this API and all of its resource paths within the API Management service instance. It is appended to the API endpoint base URL specified during the service instance creation to form a public URL for this API. Path *string `json:"path,omitempty"` // Protocols - Describes on which protocols the operations in this API can be invoked. - Protocols *[]Protocol `json:"protocols,omitempty"` + Protocols *[]Protocol `json:"protocols,omitempty"` + // APIVersionSet - Version set details APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` // Description - Description of the API. May include HTML formatting tags. Description *string `json:"description,omitempty"` @@ -1073,7 +1316,7 @@ type APICreateOrUpdateProperties struct { APIRevision *string `json:"apiRevision,omitempty"` // APIVersion - Indicates the Version identifier of the API if the API is versioned APIVersion *string `json:"apiVersion,omitempty"` - // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. + // IsCurrent - Indicates if API revision is current api revision. IsCurrent *bool `json:"isCurrent,omitempty"` // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. IsOnline *bool `json:"isOnline,omitempty"` @@ -1083,6 +1326,8 @@ type APICreateOrUpdateProperties struct { APIVersionDescription *string `json:"apiVersionDescription,omitempty"` // APIVersionSetID - A resource identifier for the related ApiVersionSet. APIVersionSetID *string `json:"apiVersionSetId,omitempty"` + // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` } // APICreateOrUpdatePropertiesWsdlSelector criteria to limit import of WSDL to a subset of the document. @@ -1107,7 +1352,7 @@ type APIEntityBaseContract struct { APIRevision *string `json:"apiRevision,omitempty"` // APIVersion - Indicates the Version identifier of the API if the API is versioned APIVersion *string `json:"apiVersion,omitempty"` - // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. + // IsCurrent - Indicates if API revision is current api revision. IsCurrent *bool `json:"isCurrent,omitempty"` // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. IsOnline *bool `json:"isOnline,omitempty"` @@ -1117,11 +1362,23 @@ type APIEntityBaseContract struct { APIVersionDescription *string `json:"apiVersionDescription,omitempty"` // APIVersionSetID - A resource identifier for the related ApiVersionSet. APIVersionSetID *string `json:"apiVersionSetId,omitempty"` + // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` } -// APIExportResult API Export result Blob Uri. +// APIExportResult API Export result. type APIExportResult struct { autorest.Response `json:"-"` + // ID - ResourceId of the API which was exported. + ID *string `json:"id,omitempty"` + // ExportResultFormat - Format in which the Api Details are exported to the Storage Blob with Sas Key valid for 5 minutes. Possible values include: 'ExportResultFormatSwagger', 'ExportResultFormatWsdl', 'ExportResultFormatWadl', 'ExportResultFormatOpenAPI' + ExportResultFormat ExportResultFormat `json:"format,omitempty"` + // Value - The object defining the schema of the exported Api Detail + Value *APIExportResultValue `json:"value,omitempty"` +} + +// APIExportResultValue the object defining the schema of the exported Api Detail +type APIExportResultValue struct { // Link - Link to the Storage Blob containing the result of the export operation. The Blob Uri is only valid for 5 minutes. Link *string `json:"link,omitempty"` } @@ -1147,7 +1404,7 @@ func (ar ApimResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// APIReleaseCollection paged Api Revision list representation. +// APIReleaseCollection paged ApiRelease list representation. type APIReleaseCollection struct { autorest.Response `json:"-"` // Value - READ-ONLY; Page values. @@ -1293,10 +1550,10 @@ func NewAPIReleaseCollectionPage(getNextPage func(context.Context, APIReleaseCol return APIReleaseCollectionPage{fn: getNextPage} } -// APIReleaseContract api Release details. +// APIReleaseContract apiRelease details. type APIReleaseContract struct { autorest.Response `json:"-"` - // APIReleaseContractProperties - Properties of the Api Release Contract. + // APIReleaseContractProperties - ApiRelease entity contract properties. *APIReleaseContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` @@ -1557,6 +1814,35 @@ type APIRevisionInfoContract struct { APIVersionSet *APIVersionSetContractDetails `json:"apiVersionSet,omitempty"` } +// APISchemaCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type APISchemaCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *APISchemaCreateOrUpdateFuture) Result(client APISchemaClient) (sc SchemaContract, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.APISchemaCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sc.Response.Response, err = future.GetResult(sender); err == nil && sc.Response.Response.StatusCode != http.StatusNoContent { + sc, err = client.CreateOrUpdateResponder(sc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.APISchemaCreateOrUpdateFuture", "Result", sc.Response.Response, "Failure responding to request") + } + } + return +} + // APITagResourceContractProperties API contract properties for the Tag Resources. type APITagResourceContractProperties struct { // ID - API identifier in the form /apis/{apiId}. @@ -1581,7 +1867,7 @@ type APITagResourceContractProperties struct { APIRevision *string `json:"apiRevision,omitempty"` // APIVersion - Indicates the Version identifier of the API if the API is versioned APIVersion *string `json:"apiVersion,omitempty"` - // IsCurrent - READ-ONLY; Indicates if API revision is current api revision. + // IsCurrent - Indicates if API revision is current api revision. IsCurrent *bool `json:"isCurrent,omitempty"` // IsOnline - READ-ONLY; Indicates if API revision is accessible via the gateway. IsOnline *bool `json:"isOnline,omitempty"` @@ -1591,6 +1877,8 @@ type APITagResourceContractProperties struct { APIVersionDescription *string `json:"apiVersionDescription,omitempty"` // APIVersionSetID - A resource identifier for the related ApiVersionSet. APIVersionSetID *string `json:"apiVersionSetId,omitempty"` + // SubscriptionRequired - Specifies whether an API or Product subscription is required for accessing the API. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` } // APIUpdateContract API update contract details. @@ -1632,6 +1920,12 @@ func (auc *APIUpdateContract) UnmarshalJSON(body []byte) error { return nil } +// APIVersionConstraint control Plane Apis version constraint for the API Management service. +type APIVersionConstraint struct { + // MinAPIVersion - Limit control plane API calls to API Management service with version equal to or newer than this value. + MinAPIVersion *string `json:"minApiVersion,omitempty"` +} + // APIVersionSetCollection paged Api Version Set list representation. type APIVersionSetCollection struct { autorest.Response `json:"-"` @@ -1856,6 +2150,8 @@ func (avsc *APIVersionSetContract) UnmarshalJSON(body []byte) error { type APIVersionSetContractDetails struct { // ID - Identifier for existing API Version Set. Omit this value to create a new Version Set. ID *string `json:"id,omitempty"` + // Name - The display Name of the API Version Set. + Name *string `json:"name,omitempty"` // Description - Description of API Version Set. Description *string `json:"description,omitempty"` // VersioningScheme - An value that determines where the API Version identifer will be located in a HTTP request. Possible values include: 'VersioningScheme1Segment', 'VersioningScheme1Query', 'VersioningScheme1Header' @@ -1943,14 +2239,90 @@ type APIVersionSetUpdateParametersProperties struct { VersionHeaderName *string `json:"versionHeaderName,omitempty"` } +// AssociationContract association entity details. +type AssociationContract struct { + // AssociationContractProperties - Association entity contract properties. + *AssociationContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AssociationContract. +func (ac AssociationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ac.AssociationContractProperties != nil { + objectMap["properties"] = ac.AssociationContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AssociationContract struct. +func (ac *AssociationContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var associationContractProperties AssociationContractProperties + err = json.Unmarshal(*v, &associationContractProperties) + if err != nil { + return err + } + ac.AssociationContractProperties = &associationContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ac.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ac.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ac.Type = &typeVar + } + } + } + + return nil +} + +// AssociationContractProperties association entity contract properties. +type AssociationContractProperties struct { + // ProvisioningState - Provisioning state. Possible values include: 'Created' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + // AuthenticationSettingsContract API Authentication Settings. type AuthenticationSettingsContract struct { // OAuth2 - OAuth2 Authentication settings OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` // Openid - OpenID Connect Authentication Settings Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"` - // SubscriptionKeyRequired - Specifies whether subscription key is required during call to this API, true - API is included into closed products only, false - API is included into open products alone, null - there is a mix of products. - SubscriptionKeyRequired *bool `json:"subscriptionKeyRequired,omitempty"` } // AuthorizationServerCollection paged OAuth2 Authorization Servers list representation. @@ -2193,8 +2565,6 @@ type AuthorizationServerContractBaseProperties struct { DefaultScope *string `json:"defaultScope,omitempty"` // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` - // ClientSecret - Client or app secret registered with this authorization server. - ClientSecret *string `json:"clientSecret,omitempty"` // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. @@ -2213,6 +2583,8 @@ type AuthorizationServerContractProperties struct { GrantTypes *[]GrantType `json:"grantTypes,omitempty"` // ClientID - Client or app id registered with this authorization server. ClientID *string `json:"clientId,omitempty"` + // ClientSecret - Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + ClientSecret *string `json:"clientSecret,omitempty"` // Description - Description of the authorization server. Can contain HTML formatting tags. Description *string `json:"description,omitempty"` // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. @@ -2229,8 +2601,6 @@ type AuthorizationServerContractProperties struct { DefaultScope *string `json:"defaultScope,omitempty"` // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` - // ClientSecret - Client or app secret registered with this authorization server. - ClientSecret *string `json:"clientSecret,omitempty"` // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. @@ -2322,6 +2692,8 @@ type AuthorizationServerUpdateContractProperties struct { GrantTypes *[]GrantType `json:"grantTypes,omitempty"` // ClientID - Client or app id registered with this authorization server. ClientID *string `json:"clientId,omitempty"` + // ClientSecret - Client or app secret registered with this authorization server. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + ClientSecret *string `json:"clientSecret,omitempty"` // Description - Description of the authorization server. Can contain HTML formatting tags. Description *string `json:"description,omitempty"` // AuthorizationMethods - HTTP verbs supported by the authorization endpoint. GET must be always present. POST is optional. @@ -2338,8 +2710,6 @@ type AuthorizationServerUpdateContractProperties struct { DefaultScope *string `json:"defaultScope,omitempty"` // BearerTokenSendingMethods - Specifies the mechanism by which access token is passed to the API. BearerTokenSendingMethods *[]BearerTokenSendingMethod `json:"bearerTokenSendingMethods,omitempty"` - // ClientSecret - Client or app secret registered with this authorization server. - ClientSecret *string `json:"clientSecret,omitempty"` // ResourceOwnerUsername - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner username. ResourceOwnerUsername *string `json:"resourceOwnerUsername,omitempty"` // ResourceOwnerPassword - Can be optionally specified when resource owner password grant type is supported by this authorization server. Default resource owner password. @@ -2820,26 +3190,32 @@ func (bup *BackendUpdateParameters) UnmarshalJSON(body []byte) error { return nil } -// CertificateCollection paged Certificates list representation. -type CertificateCollection struct { +// BodyDiagnosticSettings body logging settings. +type BodyDiagnosticSettings struct { + // Bytes - Number of request body bytes to log. + Bytes *int32 `json:"bytes,omitempty"` +} + +// CacheCollection paged Caches list representation. +type CacheCollection struct { autorest.Response `json:"-"` // Value - Page values. - Value *[]CertificateContract `json:"value,omitempty"` + Value *[]CacheContract `json:"value,omitempty"` // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. -type CertificateCollectionIterator struct { +// CacheCollectionIterator provides access to a complete listing of CacheContract values. +type CacheCollectionIterator struct { i int - page CertificateCollectionPage + page CacheCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *CacheCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -2864,42 +3240,42 @@ func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *CertificateCollectionIterator) Next() error { +func (iter *CacheCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter CertificateCollectionIterator) NotDone() bool { +func (iter CacheCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter CertificateCollectionIterator) Response() CertificateCollection { +func (iter CacheCollectionIterator) Response() CacheCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter CertificateCollectionIterator) Value() CertificateContract { +func (iter CacheCollectionIterator) Value() CacheContract { if !iter.page.NotDone() { - return CertificateContract{} + return CacheContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the CertificateCollectionIterator type. -func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { - return CertificateCollectionIterator{page: page} +// Creates a new instance of the CacheCollectionIterator type. +func NewCacheCollectionIterator(page CacheCollectionPage) CacheCollectionIterator { + return CacheCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (cc CertificateCollection) IsEmpty() bool { +func (cc CacheCollection) IsEmpty() bool { return cc.Value == nil || len(*cc.Value) == 0 } -// certificateCollectionPreparer prepares a request to retrieve the next set of results. +// cacheCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { +func (cc CacheCollection) cacheCollectionPreparer(ctx context.Context) (*http.Request, error) { if cc.NextLink == nil || len(to.String(cc.NextLink)) < 1 { return nil, nil } @@ -2909,17 +3285,17 @@ func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Contex autorest.WithBaseURL(to.String(cc.NextLink))) } -// CertificateCollectionPage contains a page of CertificateContract values. -type CertificateCollectionPage struct { - fn func(context.Context, CertificateCollection) (CertificateCollection, error) - cc CertificateCollection +// CacheCollectionPage contains a page of CacheContract values. +type CacheCollectionPage struct { + fn func(context.Context, CacheCollection) (CacheCollection, error) + cc CacheCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *CacheCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CacheCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -2939,51 +3315,38 @@ func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *CertificateCollectionPage) Next() error { +func (page *CacheCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page CertificateCollectionPage) NotDone() bool { +func (page CacheCollectionPage) NotDone() bool { return !page.cc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page CertificateCollectionPage) Response() CertificateCollection { +func (page CacheCollectionPage) Response() CacheCollection { return page.cc } // Values returns the slice of values for the current page or nil if there are no values. -func (page CertificateCollectionPage) Values() []CertificateContract { +func (page CacheCollectionPage) Values() []CacheContract { if page.cc.IsEmpty() { return nil } return *page.cc.Value } -// Creates a new instance of the CertificateCollectionPage type. -func NewCertificateCollectionPage(getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { - return CertificateCollectionPage{fn: getNextPage} +// Creates a new instance of the CacheCollectionPage type. +func NewCacheCollectionPage(getNextPage func(context.Context, CacheCollection) (CacheCollection, error)) CacheCollectionPage { + return CacheCollectionPage{fn: getNextPage} } -// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root -// certificates. -type CertificateConfiguration struct { - // EncodedCertificate - Base64 Encoded certificate. - EncodedCertificate *string `json:"encodedCertificate,omitempty"` - // CertificatePassword - Certificate Password. - CertificatePassword *string `json:"certificatePassword,omitempty"` - // StoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root' - StoreName StoreName `json:"storeName,omitempty"` - // Certificate - Certificate information. - Certificate *CertificateInformation `json:"certificate,omitempty"` -} - -// CertificateContract certificate details. -type CertificateContract struct { +// CacheContract cache details. +type CacheContract struct { autorest.Response `json:"-"` - // CertificateContractProperties - Certificate properties details. - *CertificateContractProperties `json:"properties,omitempty"` + // CacheContractProperties - Cache properties details. + *CacheContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -2992,17 +3355,17 @@ type CertificateContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for CertificateContract. -func (cc CertificateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CacheContract. +func (cc CacheContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if cc.CertificateContractProperties != nil { - objectMap["properties"] = cc.CertificateContractProperties + if cc.CacheContractProperties != nil { + objectMap["properties"] = cc.CacheContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for CertificateContract struct. -func (cc *CertificateContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for CacheContract struct. +func (cc *CacheContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3012,12 +3375,12 @@ func (cc *CertificateContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var certificateContractProperties CertificateContractProperties - err = json.Unmarshal(*v, &certificateContractProperties) + var cacheContractProperties CacheContractProperties + err = json.Unmarshal(*v, &cacheContractProperties) if err != nil { return err } - cc.CertificateContractProperties = &certificateContractProperties + cc.CacheContractProperties = &cacheContractProperties } case "id": if v != nil { @@ -3052,33 +3415,33 @@ func (cc *CertificateContract) UnmarshalJSON(body []byte) error { return nil } -// CertificateContractProperties properties of the Certificate contract. -type CertificateContractProperties struct { - // Subject - Subject attribute of the certificate. - Subject *string `json:"subject,omitempty"` - // Thumbprint - Thumbprint of the certificate. - Thumbprint *string `json:"thumbprint,omitempty"` - // ExpirationDate - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. - ExpirationDate *date.Time `json:"expirationDate,omitempty"` +// CacheContractProperties properties of the Cache contract. +type CacheContractProperties struct { + // Description - Cache description + Description *string `json:"description,omitempty"` + // ConnectionString - Runtime connection string to cache + ConnectionString *string `json:"connectionString,omitempty"` + // ResourceID - Original uri of entity in external system cache points to + ResourceID *string `json:"resourceId,omitempty"` } -// CertificateCreateOrUpdateParameters certificate create or update details. -type CertificateCreateOrUpdateParameters struct { - // CertificateCreateOrUpdateProperties - Certificate create or update properties details. - *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` +// CacheUpdateParameters cache update details. +type CacheUpdateParameters struct { + // CacheUpdateProperties - Cache update properties details. + *CacheUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. -func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CacheUpdateParameters. +func (cup CacheUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ccoup.CertificateCreateOrUpdateProperties != nil { - objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties + if cup.CacheUpdateProperties != nil { + objectMap["properties"] = cup.CacheUpdateProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. -func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for CacheUpdateParameters struct. +func (cup *CacheUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3088,12 +3451,12 @@ func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) err switch k { case "properties": if v != nil { - var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties - err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) + var cacheUpdateProperties CacheUpdateProperties + err = json.Unmarshal(*v, &cacheUpdateProperties) if err != nil { return err } - ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties + cup.CacheUpdateProperties = &cacheUpdateProperties } } } @@ -3101,74 +3464,36 @@ func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) err return nil } -// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation. -type CertificateCreateOrUpdateProperties struct { - // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. - Data *string `json:"data,omitempty"` - // Password - Password for the Certificate - Password *string `json:"password,omitempty"` -} - -// CertificateInformation SSL certificate information. -type CertificateInformation struct { - autorest.Response `json:"-"` - // Expiry - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. - Expiry *date.Time `json:"expiry,omitempty"` - // Thumbprint - Thumbprint of the certificate. - Thumbprint *string `json:"thumbprint,omitempty"` - // Subject - Subject of the certificate. - Subject *string `json:"subject,omitempty"` -} - -// ConnectivityStatusContract details about connectivity to a resource. -type ConnectivityStatusContract struct { - // Name - The hostname of the resource which the service depends on. This can be the database, storage or any other azure resource on which the service depends upon. - Name *string `json:"name,omitempty"` - // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' - Status ConnectivityStatusType `json:"status,omitempty"` - // Error - Error details of the connectivity to the resource. - Error *string `json:"error,omitempty"` - // LastUpdated - The date when the resource connectivity status was last updated. This status should be updated every 15 minutes. If this status has not been updated, then it means that the service has lost network connectivity to the resource, from inside the Virtual Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. - LastUpdated *date.Time `json:"lastUpdated,omitempty"` - // LastStatusChange - The date when the resource connectivity status last Changed from success to failure or vice-versa. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. - LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` -} - -// CurrentUserIdentity ... -type CurrentUserIdentity struct { - autorest.Response `json:"-"` - // ID - API Management service user id. - ID *string `json:"id,omitempty"` -} - -// DeployConfigurationParameters parameters supplied to the Deploy Configuration operation. -type DeployConfigurationParameters struct { - // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. - Branch *string `json:"branch,omitempty"` - // Force - The value enforcing deleting subscriptions to products that are deleted in this update. - Force *bool `json:"force,omitempty"` +// CacheUpdateProperties parameters supplied to the Update Cache operation. +type CacheUpdateProperties struct { + // Description - Cache description + Description *string `json:"description,omitempty"` + // ConnectionString - Runtime connection string to cache + ConnectionString *string `json:"connectionString,omitempty"` + // ResourceID - Original uri of entity in external system cache points to + ResourceID *string `json:"resourceId,omitempty"` } -// DiagnosticCollection paged Diagnostic list representation. -type DiagnosticCollection struct { +// CertificateCollection paged Certificates list representation. +type CertificateCollection struct { autorest.Response `json:"-"` // Value - Page values. - Value *[]DiagnosticContract `json:"value,omitempty"` + Value *[]CertificateContract `json:"value,omitempty"` // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values. -type DiagnosticCollectionIterator struct { +// CertificateCollectionIterator provides access to a complete listing of CertificateContract values. +type CertificateCollectionIterator struct { i int - page DiagnosticCollectionPage + page CertificateCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -3193,62 +3518,62 @@ func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) ( // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *DiagnosticCollectionIterator) Next() error { +func (iter *CertificateCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter DiagnosticCollectionIterator) NotDone() bool { +func (iter CertificateCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection { +func (iter CertificateCollectionIterator) Response() CertificateCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter DiagnosticCollectionIterator) Value() DiagnosticContract { +func (iter CertificateCollectionIterator) Value() CertificateContract { if !iter.page.NotDone() { - return DiagnosticContract{} + return CertificateContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the DiagnosticCollectionIterator type. -func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator { - return DiagnosticCollectionIterator{page: page} +// Creates a new instance of the CertificateCollectionIterator type. +func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { + return CertificateCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (dc DiagnosticCollection) IsEmpty() bool { - return dc.Value == nil || len(*dc.Value) == 0 +func (cc CertificateCollection) IsEmpty() bool { + return cc.Value == nil || len(*cc.Value) == 0 } -// diagnosticCollectionPreparer prepares a request to retrieve the next set of results. +// certificateCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) { - if dc.NextLink == nil || len(to.String(dc.NextLink)) < 1 { +func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { + if cc.NextLink == nil || len(to.String(cc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(dc.NextLink))) + autorest.WithBaseURL(to.String(cc.NextLink))) } -// DiagnosticCollectionPage contains a page of DiagnosticContract values. -type DiagnosticCollectionPage struct { - fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error) - dc DiagnosticCollection +// CertificateCollectionPage contains a page of CertificateContract values. +type CertificateCollectionPage struct { + fn func(context.Context, CertificateCollection) (CertificateCollection, error) + cc CertificateCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -3257,49 +3582,62 @@ func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.dc) + next, err := page.fn(ctx, page.cc) if err != nil { return err } - page.dc = next + page.cc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *DiagnosticCollectionPage) Next() error { +func (page *CertificateCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page DiagnosticCollectionPage) NotDone() bool { - return !page.dc.IsEmpty() +func (page CertificateCollectionPage) NotDone() bool { + return !page.cc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page DiagnosticCollectionPage) Response() DiagnosticCollection { - return page.dc +func (page CertificateCollectionPage) Response() CertificateCollection { + return page.cc } // Values returns the slice of values for the current page or nil if there are no values. -func (page DiagnosticCollectionPage) Values() []DiagnosticContract { - if page.dc.IsEmpty() { +func (page CertificateCollectionPage) Values() []CertificateContract { + if page.cc.IsEmpty() { return nil } - return *page.dc.Value + return *page.cc.Value } -// Creates a new instance of the DiagnosticCollectionPage type. -func NewDiagnosticCollectionPage(getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage { - return DiagnosticCollectionPage{fn: getNextPage} +// Creates a new instance of the CertificateCollectionPage type. +func NewCertificateCollectionPage(getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { + return CertificateCollectionPage{fn: getNextPage} } -// DiagnosticContract diagnostic details. -type DiagnosticContract struct { +// CertificateConfiguration certificate configuration which consist of non-trusted intermediates and root +// certificates. +type CertificateConfiguration struct { + // EncodedCertificate - Base64 Encoded certificate. + EncodedCertificate *string `json:"encodedCertificate,omitempty"` + // CertificatePassword - Certificate Password. + CertificatePassword *string `json:"certificatePassword,omitempty"` + // StoreName - The System.Security.Cryptography.x509certificates.StoreName certificate store location. Only Root and CertificateAuthority are valid locations. Possible values include: 'CertificateAuthority', 'Root' + StoreName StoreName `json:"storeName,omitempty"` + // Certificate - Certificate information. + Certificate *CertificateInformation `json:"certificate,omitempty"` +} + +// CertificateContract certificate details. +type CertificateContract struct { autorest.Response `json:"-"` - // DiagnosticContractProperties - Diagnostic entity contract properties. - *DiagnosticContractProperties `json:"properties,omitempty"` + // CertificateContractProperties - Certificate properties details. + *CertificateContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -3308,17 +3646,17 @@ type DiagnosticContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for DiagnosticContract. -func (dc DiagnosticContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CertificateContract. +func (cc CertificateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if dc.DiagnosticContractProperties != nil { - objectMap["properties"] = dc.DiagnosticContractProperties + if cc.CertificateContractProperties != nil { + objectMap["properties"] = cc.CertificateContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct. -func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for CertificateContract struct. +func (cc *CertificateContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3328,12 +3666,12 @@ func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var diagnosticContractProperties DiagnosticContractProperties - err = json.Unmarshal(*v, &diagnosticContractProperties) + var certificateContractProperties CertificateContractProperties + err = json.Unmarshal(*v, &certificateContractProperties) if err != nil { return err } - dc.DiagnosticContractProperties = &diagnosticContractProperties + cc.CertificateContractProperties = &certificateContractProperties } case "id": if v != nil { @@ -3342,7 +3680,7 @@ func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - dc.ID = &ID + cc.ID = &ID } case "name": if v != nil { @@ -3351,7 +3689,7 @@ func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - dc.Name = &name + cc.Name = &name } case "type": if v != nil { @@ -3360,7 +3698,7 @@ func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - dc.Type = &typeVar + cc.Type = &typeVar } } } @@ -3368,38 +3706,167 @@ func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { return nil } -// DiagnosticContractProperties diagnostic Entity Properties -type DiagnosticContractProperties struct { - // Enabled - Indicates whether a diagnostic should receive data or not. - Enabled *bool `json:"enabled,omitempty"` +// CertificateContractProperties properties of the Certificate contract. +type CertificateContractProperties struct { + // Subject - Subject attribute of the certificate. + Subject *string `json:"subject,omitempty"` + // Thumbprint - Thumbprint of the certificate. + Thumbprint *string `json:"thumbprint,omitempty"` + // ExpirationDate - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + ExpirationDate *date.Time `json:"expirationDate,omitempty"` } -// EmailTemplateCollection paged email template list representation. -type EmailTemplateCollection struct { - autorest.Response `json:"-"` - // Value - Page values. - Value *[]EmailTemplateContract `json:"value,omitempty"` - // NextLink - Next page link if any. - NextLink *string `json:"nextLink,omitempty"` +// CertificateCreateOrUpdateParameters certificate create or update details. +type CertificateCreateOrUpdateParameters struct { + // CertificateCreateOrUpdateProperties - Certificate create or update properties details. + *CertificateCreateOrUpdateProperties `json:"properties,omitempty"` } -// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. -type EmailTemplateCollectionIterator struct { - i int - page EmailTemplateCollectionPage +// MarshalJSON is the custom marshaler for CertificateCreateOrUpdateParameters. +func (ccoup CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ccoup.CertificateCreateOrUpdateProperties != nil { + objectMap["properties"] = ccoup.CertificateCreateOrUpdateProperties + } + return json.Marshal(objectMap) } -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) +// UnmarshalJSON is the custom unmarshaler for CertificateCreateOrUpdateParameters struct. +func (ccoup *CertificateCreateOrUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificateCreateOrUpdateProperties CertificateCreateOrUpdateProperties + err = json.Unmarshal(*v, &certificateCreateOrUpdateProperties) + if err != nil { + return err + } + ccoup.CertificateCreateOrUpdateProperties = &certificateCreateOrUpdateProperties + } + } + } + + return nil +} + +// CertificateCreateOrUpdateProperties parameters supplied to the CreateOrUpdate certificate operation. +type CertificateCreateOrUpdateProperties struct { + // Data - Base 64 encoded certificate using the application/x-pkcs12 representation. + Data *string `json:"data,omitempty"` + // Password - Password for the Certificate + Password *string `json:"password,omitempty"` +} + +// CertificateInformation SSL certificate information. +type CertificateInformation struct { + // Expiry - Expiration date of the certificate. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + Expiry *date.Time `json:"expiry,omitempty"` + // Thumbprint - Thumbprint of the certificate. + Thumbprint *string `json:"thumbprint,omitempty"` + // Subject - Subject of the certificate. + Subject *string `json:"subject,omitempty"` +} + +// ClientSecretContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. +type ClientSecretContract struct { + autorest.Response `json:"-"` + // ClientSecret - Client or app secret used in IdentityProviders, Aad, OpenID or OAuth. + ClientSecret *string `json:"clientSecret,omitempty"` +} + +// ConnectivityStatusContract details about connectivity to a resource. +type ConnectivityStatusContract struct { + // Name - The hostname of the resource which the service depends on. This can be the database, storage or any other azure resource on which the service depends upon. + Name *string `json:"name,omitempty"` + // Status - Resource Connectivity Status Type identifier. Possible values include: 'Initializing', 'Success', 'Failure' + Status ConnectivityStatusType `json:"status,omitempty"` + // Error - Error details of the connectivity to the resource. + Error *string `json:"error,omitempty"` + // LastUpdated - The date when the resource connectivity status was last updated. This status should be updated every 15 minutes. If this status has not been updated, then it means that the service has lost network connectivity to the resource, from inside the Virtual Network.The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + LastUpdated *date.Time `json:"lastUpdated,omitempty"` + // LastStatusChange - The date when the resource connectivity status last Changed from success to failure or vice-versa. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + LastStatusChange *date.Time `json:"lastStatusChange,omitempty"` +} + +// DeployConfigurationParameterProperties parameters supplied to the Deploy Configuration operation. +type DeployConfigurationParameterProperties struct { + // Branch - The name of the Git branch from which the configuration is to be deployed to the configuration database. + Branch *string `json:"branch,omitempty"` + // Force - The value enforcing deleting subscriptions to products that are deleted in this update. + Force *bool `json:"force,omitempty"` +} + +// DeployConfigurationParameters deploy Tenant Configuration Contract. +type DeployConfigurationParameters struct { + // DeployConfigurationParameterProperties - Deploy Configuration Parameter contract properties. + *DeployConfigurationParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeployConfigurationParameters. +func (dcp DeployConfigurationParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcp.DeployConfigurationParameterProperties != nil { + objectMap["properties"] = dcp.DeployConfigurationParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DeployConfigurationParameters struct. +func (dcp *DeployConfigurationParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var deployConfigurationParameterProperties DeployConfigurationParameterProperties + err = json.Unmarshal(*v, &deployConfigurationParameterProperties) + if err != nil { + return err + } + dcp.DeployConfigurationParameterProperties = &deployConfigurationParameterProperties + } + } + } + + return nil +} + +// DiagnosticCollection paged Diagnostic list representation. +type DiagnosticCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]DiagnosticContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// DiagnosticCollectionIterator provides access to a complete listing of DiagnosticContract values. +type DiagnosticCollectionIterator struct { + i int + page DiagnosticCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DiagnosticCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) }() } iter.i++ @@ -3418,62 +3885,62 @@ func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *EmailTemplateCollectionIterator) Next() error { +func (iter *DiagnosticCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter EmailTemplateCollectionIterator) NotDone() bool { +func (iter DiagnosticCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { +func (iter DiagnosticCollectionIterator) Response() DiagnosticCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { +func (iter DiagnosticCollectionIterator) Value() DiagnosticContract { if !iter.page.NotDone() { - return EmailTemplateContract{} + return DiagnosticContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the EmailTemplateCollectionIterator type. -func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator { - return EmailTemplateCollectionIterator{page: page} +// Creates a new instance of the DiagnosticCollectionIterator type. +func NewDiagnosticCollectionIterator(page DiagnosticCollectionPage) DiagnosticCollectionIterator { + return DiagnosticCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (etc EmailTemplateCollection) IsEmpty() bool { - return etc.Value == nil || len(*etc.Value) == 0 +func (dc DiagnosticCollection) IsEmpty() bool { + return dc.Value == nil || len(*dc.Value) == 0 } -// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. +// diagnosticCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) { - if etc.NextLink == nil || len(to.String(etc.NextLink)) < 1 { +func (dc DiagnosticCollection) diagnosticCollectionPreparer(ctx context.Context) (*http.Request, error) { + if dc.NextLink == nil || len(to.String(dc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(etc.NextLink))) + autorest.WithBaseURL(to.String(dc.NextLink))) } -// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. -type EmailTemplateCollectionPage struct { - fn func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error) - etc EmailTemplateCollection +// DiagnosticCollectionPage contains a page of DiagnosticContract values. +type DiagnosticCollectionPage struct { + fn func(context.Context, DiagnosticCollection) (DiagnosticCollection, error) + dc DiagnosticCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *DiagnosticCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -3482,49 +3949,49 @@ func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (e tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.etc) + next, err := page.fn(ctx, page.dc) if err != nil { return err } - page.etc = next + page.dc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *EmailTemplateCollectionPage) Next() error { +func (page *DiagnosticCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page EmailTemplateCollectionPage) NotDone() bool { - return !page.etc.IsEmpty() +func (page DiagnosticCollectionPage) NotDone() bool { + return !page.dc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { - return page.etc +func (page DiagnosticCollectionPage) Response() DiagnosticCollection { + return page.dc } // Values returns the slice of values for the current page or nil if there are no values. -func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { - if page.etc.IsEmpty() { +func (page DiagnosticCollectionPage) Values() []DiagnosticContract { + if page.dc.IsEmpty() { return nil } - return *page.etc.Value + return *page.dc.Value } -// Creates a new instance of the EmailTemplateCollectionPage type. -func NewEmailTemplateCollectionPage(getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage { - return EmailTemplateCollectionPage{fn: getNextPage} +// Creates a new instance of the DiagnosticCollectionPage type. +func NewDiagnosticCollectionPage(getNextPage func(context.Context, DiagnosticCollection) (DiagnosticCollection, error)) DiagnosticCollectionPage { + return DiagnosticCollectionPage{fn: getNextPage} } -// EmailTemplateContract email Template details. -type EmailTemplateContract struct { +// DiagnosticContract diagnostic details. +type DiagnosticContract struct { autorest.Response `json:"-"` - // EmailTemplateContractProperties - Email Template entity contract properties. - *EmailTemplateContractProperties `json:"properties,omitempty"` + // DiagnosticContractProperties - Diagnostic entity contract properties. + *DiagnosticContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -3533,17 +4000,17 @@ type EmailTemplateContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for EmailTemplateContract. -func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DiagnosticContract. +func (dc DiagnosticContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if etc.EmailTemplateContractProperties != nil { - objectMap["properties"] = etc.EmailTemplateContractProperties + if dc.DiagnosticContractProperties != nil { + objectMap["properties"] = dc.DiagnosticContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct. -func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for DiagnosticContract struct. +func (dc *DiagnosticContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3553,12 +4020,12 @@ func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var emailTemplateContractProperties EmailTemplateContractProperties - err = json.Unmarshal(*v, &emailTemplateContractProperties) + var diagnosticContractProperties DiagnosticContractProperties + err = json.Unmarshal(*v, &diagnosticContractProperties) if err != nil { return err } - etc.EmailTemplateContractProperties = &emailTemplateContractProperties + dc.DiagnosticContractProperties = &diagnosticContractProperties } case "id": if v != nil { @@ -3567,7 +4034,7 @@ func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - etc.ID = &ID + dc.ID = &ID } case "name": if v != nil { @@ -3576,7 +4043,7 @@ func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - etc.Name = &name + dc.Name = &name } case "type": if v != nil { @@ -3585,7 +4052,7 @@ func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - etc.Type = &typeVar + dc.Type = &typeVar } } } @@ -3593,171 +4060,46 @@ func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { return nil } -// EmailTemplateContractProperties email Template Contract properties. -type EmailTemplateContractProperties struct { - // Subject - Subject of the Template. - Subject *string `json:"subject,omitempty"` - // Body - Email Template Body. This should be a valid XDocument - Body *string `json:"body,omitempty"` - // Title - Title of the Template. - Title *string `json:"title,omitempty"` - // Description - Description of the Email Template. - Description *string `json:"description,omitempty"` - // IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited. - IsDefault *bool `json:"isDefault,omitempty"` - // Parameters - Email Template Parameter values. - Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` +// DiagnosticContractProperties diagnostic Entity Properties +type DiagnosticContractProperties struct { + // AlwaysLog - Specifies for what type of messages sampling settings should not apply. Possible values include: 'AllErrors' + AlwaysLog AlwaysLog `json:"alwaysLog,omitempty"` + // LoggerID - Resource Id of a target logger. + LoggerID *string `json:"loggerId,omitempty"` + // Sampling - Sampling settings for Diagnostic. + Sampling *SamplingSettings `json:"sampling,omitempty"` + // Frontend - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. + Frontend *PipelineDiagnosticSettings `json:"frontend,omitempty"` + // Backend - Diagnostic settings for incoming/outgoing HTTP messages to the Backend + Backend *PipelineDiagnosticSettings `json:"backend,omitempty"` + // LogClientIP - Log the ClientIP. Default is false. + LogClientIP *bool `json:"logClientIp,omitempty"` + // HTTPCorrelationProtocol - Sets correlation protocol to use for Application Insights diagnostics. Possible values include: 'HTTPCorrelationProtocolNone', 'HTTPCorrelationProtocolLegacy', 'HTTPCorrelationProtocolW3C' + HTTPCorrelationProtocol HTTPCorrelationProtocol `json:"httpCorrelationProtocol,omitempty"` + // Verbosity - The verbosity level applied to traces emitted by trace policies. Possible values include: 'Verbose', 'Information', 'Error' + Verbosity Verbosity `json:"verbosity,omitempty"` } -// EmailTemplateParametersContractProperties email Template Parameter contract. -type EmailTemplateParametersContractProperties struct { - // Name - Template parameter name. - Name *string `json:"name,omitempty"` - // Title - Template parameter title. - Title *string `json:"title,omitempty"` - // Description - Template parameter description. - Description *string `json:"description,omitempty"` +// EmailTemplateCollection paged email template list representation. +type EmailTemplateCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]EmailTemplateContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` } -// EmailTemplateUpdateParameterProperties email Template Update Contract properties. -type EmailTemplateUpdateParameterProperties struct { - // Subject - Subject of the Template. - Subject *string `json:"subject,omitempty"` - // Title - Title of the Template. - Title *string `json:"title,omitempty"` - // Description - Description of the Email Template. - Description *string `json:"description,omitempty"` - // Body - Email Template Body. This should be a valid XDocument - Body *string `json:"body,omitempty"` - // Parameters - Email Template Parameter values. - Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` -} - -// EmailTemplateUpdateParameters email Template update Parameters. -type EmailTemplateUpdateParameters struct { - // EmailTemplateUpdateParameterProperties - Email Template Update contract properties. - *EmailTemplateUpdateParameterProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters. -func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if etup.EmailTemplateUpdateParameterProperties != nil { - objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct. -func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties - err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties) - if err != nil { - return err - } - etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties - } - } - } - - return nil -} - -// ErrorFieldContract error Field contract. -type ErrorFieldContract struct { - // Code - Property level error code. - Code *string `json:"code,omitempty"` - // Message - Human-readable representation of property-level error. - Message *string `json:"message,omitempty"` - // Target - Property name. - Target *string `json:"target,omitempty"` -} - -// ErrorResponse error Response. -type ErrorResponse struct { - // ErrorResponseBody - Properties of the Error Response. - *ErrorResponseBody `json:"error,omitempty"` -} - -// MarshalJSON is the custom marshaler for ErrorResponse. -func (er ErrorResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if er.ErrorResponseBody != nil { - objectMap["error"] = er.ErrorResponseBody - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. -func (er *ErrorResponse) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "error": - if v != nil { - var errorResponseBody ErrorResponseBody - err = json.Unmarshal(*v, &errorResponseBody) - if err != nil { - return err - } - er.ErrorResponseBody = &errorResponseBody - } - } - } - - return nil -} - -// ErrorResponseBody error Body contract. -type ErrorResponseBody struct { - // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. - Code *string `json:"code,omitempty"` - // Message - Human-readable representation of the error. - Message *string `json:"message,omitempty"` - // Details - The list of invalid fields send in request, in case of validation error. - Details *[]ErrorFieldContract `json:"details,omitempty"` -} - -// GenerateSsoURLResult generate SSO Url operations response details. -type GenerateSsoURLResult struct { - autorest.Response `json:"-"` - // Value - Redirect Url containing the SSO URL value. - Value *string `json:"value,omitempty"` -} - -// GroupCollection paged Group list representation. -type GroupCollection struct { - autorest.Response `json:"-"` - // Value - Page values. - Value *[]GroupContract `json:"value,omitempty"` - // NextLink - Next page link if any. - NextLink *string `json:"nextLink,omitempty"` -} - -// GroupCollectionIterator provides access to a complete listing of GroupContract values. -type GroupCollectionIterator struct { +// EmailTemplateCollectionIterator provides access to a complete listing of EmailTemplateContract values. +type EmailTemplateCollectionIterator struct { i int - page GroupCollectionPage + page EmailTemplateCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *EmailTemplateCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -3782,62 +4124,62 @@ func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err e // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *GroupCollectionIterator) Next() error { +func (iter *EmailTemplateCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter GroupCollectionIterator) NotDone() bool { +func (iter EmailTemplateCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter GroupCollectionIterator) Response() GroupCollection { +func (iter EmailTemplateCollectionIterator) Response() EmailTemplateCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter GroupCollectionIterator) Value() GroupContract { +func (iter EmailTemplateCollectionIterator) Value() EmailTemplateContract { if !iter.page.NotDone() { - return GroupContract{} + return EmailTemplateContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the GroupCollectionIterator type. -func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { - return GroupCollectionIterator{page: page} +// Creates a new instance of the EmailTemplateCollectionIterator type. +func NewEmailTemplateCollectionIterator(page EmailTemplateCollectionPage) EmailTemplateCollectionIterator { + return EmailTemplateCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (gc GroupCollection) IsEmpty() bool { - return gc.Value == nil || len(*gc.Value) == 0 +func (etc EmailTemplateCollection) IsEmpty() bool { + return etc.Value == nil || len(*etc.Value) == 0 } -// groupCollectionPreparer prepares a request to retrieve the next set of results. +// emailTemplateCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { - if gc.NextLink == nil || len(to.String(gc.NextLink)) < 1 { +func (etc EmailTemplateCollection) emailTemplateCollectionPreparer(ctx context.Context) (*http.Request, error) { + if etc.NextLink == nil || len(to.String(etc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(gc.NextLink))) + autorest.WithBaseURL(to.String(etc.NextLink))) } -// GroupCollectionPage contains a page of GroupContract values. -type GroupCollectionPage struct { - fn func(context.Context, GroupCollection) (GroupCollection, error) - gc GroupCollection +// EmailTemplateCollectionPage contains a page of EmailTemplateContract values. +type EmailTemplateCollectionPage struct { + fn func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error) + etc EmailTemplateCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *EmailTemplateCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/EmailTemplateCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -3846,49 +4188,49 @@ func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.gc) + next, err := page.fn(ctx, page.etc) if err != nil { return err } - page.gc = next + page.etc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *GroupCollectionPage) Next() error { +func (page *EmailTemplateCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page GroupCollectionPage) NotDone() bool { - return !page.gc.IsEmpty() +func (page EmailTemplateCollectionPage) NotDone() bool { + return !page.etc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page GroupCollectionPage) Response() GroupCollection { - return page.gc +func (page EmailTemplateCollectionPage) Response() EmailTemplateCollection { + return page.etc } // Values returns the slice of values for the current page or nil if there are no values. -func (page GroupCollectionPage) Values() []GroupContract { - if page.gc.IsEmpty() { +func (page EmailTemplateCollectionPage) Values() []EmailTemplateContract { + if page.etc.IsEmpty() { return nil } - return *page.gc.Value + return *page.etc.Value } -// Creates a new instance of the GroupCollectionPage type. -func NewGroupCollectionPage(getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { - return GroupCollectionPage{fn: getNextPage} +// Creates a new instance of the EmailTemplateCollectionPage type. +func NewEmailTemplateCollectionPage(getNextPage func(context.Context, EmailTemplateCollection) (EmailTemplateCollection, error)) EmailTemplateCollectionPage { + return EmailTemplateCollectionPage{fn: getNextPage} } -// GroupContract contract details. -type GroupContract struct { +// EmailTemplateContract email Template details. +type EmailTemplateContract struct { autorest.Response `json:"-"` - // GroupContractProperties - Group entity contract properties. - *GroupContractProperties `json:"properties,omitempty"` + // EmailTemplateContractProperties - Email Template entity contract properties. + *EmailTemplateContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -3897,17 +4239,17 @@ type GroupContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for GroupContract. -func (gc GroupContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for EmailTemplateContract. +func (etc EmailTemplateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if gc.GroupContractProperties != nil { - objectMap["properties"] = gc.GroupContractProperties + if etc.EmailTemplateContractProperties != nil { + objectMap["properties"] = etc.EmailTemplateContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for GroupContract struct. -func (gc *GroupContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for EmailTemplateContract struct. +func (etc *EmailTemplateContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3917,12 +4259,12 @@ func (gc *GroupContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var groupContractProperties GroupContractProperties - err = json.Unmarshal(*v, &groupContractProperties) + var emailTemplateContractProperties EmailTemplateContractProperties + err = json.Unmarshal(*v, &emailTemplateContractProperties) if err != nil { return err } - gc.GroupContractProperties = &groupContractProperties + etc.EmailTemplateContractProperties = &emailTemplateContractProperties } case "id": if v != nil { @@ -3931,7 +4273,7 @@ func (gc *GroupContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - gc.ID = &ID + etc.ID = &ID } case "name": if v != nil { @@ -3940,7 +4282,7 @@ func (gc *GroupContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - gc.Name = &name + etc.Name = &name } case "type": if v != nil { @@ -3949,7 +4291,7 @@ func (gc *GroupContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - gc.Type = &typeVar + etc.Type = &typeVar } } } @@ -3957,88 +4299,63 @@ func (gc *GroupContract) UnmarshalJSON(body []byte) error { return nil } -// GroupContractProperties group contract Properties. -type GroupContractProperties struct { - // DisplayName - Group name. - DisplayName *string `json:"displayName,omitempty"` - // Description - Group description. Can contain HTML formatting tags. +// EmailTemplateContractProperties email Template Contract properties. +type EmailTemplateContractProperties struct { + // Subject - Subject of the Template. + Subject *string `json:"subject,omitempty"` + // Body - Email Template Body. This should be a valid XDocument + Body *string `json:"body,omitempty"` + // Title - Title of the Template. + Title *string `json:"title,omitempty"` + // Description - Description of the Email Template. Description *string `json:"description,omitempty"` - // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. - BuiltIn *bool `json:"builtIn,omitempty"` - // Type - Group type. Possible values include: 'Custom', 'System', 'External' - Type GroupType `json:"type,omitempty"` - // ExternalID - For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://.onmicrosoft.com/groups/; otherwise the value is null. - ExternalID *string `json:"externalId,omitempty"` + // IsDefault - READ-ONLY; Whether the template is the default template provided by Api Management or has been edited. + IsDefault *bool `json:"isDefault,omitempty"` + // Parameters - Email Template Parameter values. + Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` } -// GroupCreateParameters parameters supplied to the Create Group operation. -type GroupCreateParameters struct { - // GroupCreateParametersProperties - Properties supplied to Create Group operation. - *GroupCreateParametersProperties `json:"properties,omitempty"` -} - -// MarshalJSON is the custom marshaler for GroupCreateParameters. -func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gcp.GroupCreateParametersProperties != nil { - objectMap["properties"] = gcp.GroupCreateParametersProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. -func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var groupCreateParametersProperties GroupCreateParametersProperties - err = json.Unmarshal(*v, &groupCreateParametersProperties) - if err != nil { - return err - } - gcp.GroupCreateParametersProperties = &groupCreateParametersProperties - } - } - } - - return nil +// EmailTemplateParametersContractProperties email Template Parameter contract. +type EmailTemplateParametersContractProperties struct { + // Name - Template parameter name. + Name *string `json:"name,omitempty"` + // Title - Template parameter title. + Title *string `json:"title,omitempty"` + // Description - Template parameter description. + Description *string `json:"description,omitempty"` } -// GroupCreateParametersProperties parameters supplied to the Create Group operation. -type GroupCreateParametersProperties struct { - // DisplayName - Group name. - DisplayName *string `json:"displayName,omitempty"` - // Description - Group description. +// EmailTemplateUpdateParameterProperties email Template Update Contract properties. +type EmailTemplateUpdateParameterProperties struct { + // Subject - Subject of the Template. + Subject *string `json:"subject,omitempty"` + // Title - Title of the Template. + Title *string `json:"title,omitempty"` + // Description - Description of the Email Template. Description *string `json:"description,omitempty"` - // Type - Group type. Possible values include: 'Custom', 'System', 'External' - Type GroupType `json:"type,omitempty"` - // ExternalID - Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://.onmicrosoft.com/groups/; otherwise the value is null. - ExternalID *string `json:"externalId,omitempty"` + // Body - Email Template Body. This should be a valid XDocument + Body *string `json:"body,omitempty"` + // Parameters - Email Template Parameter values. + Parameters *[]EmailTemplateParametersContractProperties `json:"parameters,omitempty"` } -// GroupUpdateParameters parameters supplied to the Update Group operation. -type GroupUpdateParameters struct { - // GroupUpdateParametersProperties - Group entity update contract properties. - *GroupUpdateParametersProperties `json:"properties,omitempty"` +// EmailTemplateUpdateParameters email Template update Parameters. +type EmailTemplateUpdateParameters struct { + // EmailTemplateUpdateParameterProperties - Email Template Update contract properties. + *EmailTemplateUpdateParameterProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for GroupUpdateParameters. -func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for EmailTemplateUpdateParameters. +func (etup EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if gup.GroupUpdateParametersProperties != nil { - objectMap["properties"] = gup.GroupUpdateParametersProperties + if etup.EmailTemplateUpdateParameterProperties != nil { + objectMap["properties"] = etup.EmailTemplateUpdateParameterProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct. -func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for EmailTemplateUpdateParameters struct. +func (etup *EmailTemplateUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4048,12 +4365,12 @@ func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var groupUpdateParametersProperties GroupUpdateParametersProperties - err = json.Unmarshal(*v, &groupUpdateParametersProperties) + var emailTemplateUpdateParameterProperties EmailTemplateUpdateParameterProperties + err = json.Unmarshal(*v, &emailTemplateUpdateParameterProperties) if err != nil { return err } - gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties + etup.EmailTemplateUpdateParameterProperties = &emailTemplateUpdateParameterProperties } } } @@ -4061,88 +4378,33 @@ func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { return nil } -// GroupUpdateParametersProperties parameters supplied to the Update Group operation. -type GroupUpdateParametersProperties struct { - // DisplayName - Group name. - DisplayName *string `json:"displayName,omitempty"` - // Description - Group description. - Description *string `json:"description,omitempty"` - // Type - Group type. Possible values include: 'Custom', 'System', 'External' - Type GroupType `json:"type,omitempty"` - // ExternalID - Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory aad://.onmicrosoft.com/groups/; otherwise the value is null. - ExternalID *string `json:"externalId,omitempty"` -} - -// HostnameConfiguration custom hostname configuration. -type HostnameConfiguration struct { - // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' - Type HostnameType `json:"type,omitempty"` - // HostName - Hostname to configure on the Api Management service. - HostName *string `json:"hostName,omitempty"` - // KeyVaultID - Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update of ssl certificate will not work. This requires Api Management service to be configured with MSI. The secret should be of type *application/x-pkcs12* - KeyVaultID *string `json:"keyVaultId,omitempty"` - // EncodedCertificate - Base64 Encoded certificate. - EncodedCertificate *string `json:"encodedCertificate,omitempty"` - // CertificatePassword - Certificate Password. - CertificatePassword *string `json:"certificatePassword,omitempty"` - // DefaultSslBinding - Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to Proxy Hostname Type. - DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"` - // NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false. - NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` - // Certificate - Certificate information. - Certificate *CertificateInformation `json:"certificate,omitempty"` -} - -// HostnameConfigurationOld custom hostname configuration. -type HostnameConfigurationOld struct { - // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' - Type HostnameType `json:"type,omitempty"` - // Hostname - Hostname to configure. - Hostname *string `json:"hostname,omitempty"` - // Certificate - Certificate information. - Certificate *CertificateInformation `json:"certificate,omitempty"` -} - -// IdentityProviderBaseParameters identity Provider Base Parameter Properties. -type IdentityProviderBaseParameters struct { - // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' - Type IdentityProviderType `json:"type,omitempty"` - // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. - AllowedTenants *[]string `json:"allowedTenants,omitempty"` - // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. - SignupPolicyName *string `json:"signupPolicyName,omitempty"` - // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. - SigninPolicyName *string `json:"signinPolicyName,omitempty"` - // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. - ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` - // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. - PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +// ErrorFieldContract error Field contract. +type ErrorFieldContract struct { + // Code - Property level error code. + Code *string `json:"code,omitempty"` + // Message - Human-readable representation of property-level error. + Message *string `json:"message,omitempty"` + // Target - Property name. + Target *string `json:"target,omitempty"` } -// IdentityProviderContract identity Provider details. -type IdentityProviderContract struct { - autorest.Response `json:"-"` - // IdentityProviderContractProperties - Identity Provider contract properties. - *IdentityProviderContractProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type for API Management resource. - Type *string `json:"type,omitempty"` +// ErrorResponse error Response. +type ErrorResponse struct { + // ErrorResponseBody - Properties of the Error Response. + *ErrorResponseBody `json:"error,omitempty"` } -// MarshalJSON is the custom marshaler for IdentityProviderContract. -func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ErrorResponse. +func (er ErrorResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ipc.IdentityProviderContractProperties != nil { - objectMap["properties"] = ipc.IdentityProviderContractProperties + if er.ErrorResponseBody != nil { + objectMap["error"] = er.ErrorResponseBody } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct. -func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ErrorResponse struct. +func (er *ErrorResponse) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4150,41 +4412,14 @@ func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { } for k, v := range m { switch k { - case "properties": - if v != nil { - var identityProviderContractProperties IdentityProviderContractProperties - err = json.Unmarshal(*v, &identityProviderContractProperties) - if err != nil { - return err - } - ipc.IdentityProviderContractProperties = &identityProviderContractProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ipc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ipc.Name = &name - } - case "type": + case "error": if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var errorResponseBody ErrorResponseBody + err = json.Unmarshal(*v, &errorResponseBody) if err != nil { return err } - ipc.Type = &typeVar + er.ErrorResponseBody = &errorResponseBody } } } @@ -4192,48 +4427,36 @@ func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { return nil } -// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, -// Twitter or Azure Active Directory which can be used to enable access to the API Management service -// developer portal for all users. -type IdentityProviderContractProperties struct { - // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. - ClientID *string `json:"clientId,omitempty"` - // ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. - ClientSecret *string `json:"clientSecret,omitempty"` - // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' - Type IdentityProviderType `json:"type,omitempty"` - // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. - AllowedTenants *[]string `json:"allowedTenants,omitempty"` - // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. - SignupPolicyName *string `json:"signupPolicyName,omitempty"` - // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. - SigninPolicyName *string `json:"signinPolicyName,omitempty"` - // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. - ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` - // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. - PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +// ErrorResponseBody error Body contract. +type ErrorResponseBody struct { + // Code - Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response. + Code *string `json:"code,omitempty"` + // Message - Human-readable representation of the error. + Message *string `json:"message,omitempty"` + // Details - The list of invalid fields send in request, in case of validation error. + Details *[]ErrorFieldContract `json:"details,omitempty"` } -// IdentityProviderList list of all the Identity Providers configured on the service instance. -type IdentityProviderList struct { +// GatewayCollection paged Gateway list representation. +type GatewayCollection struct { autorest.Response `json:"-"` - // Value - Identity Provider configuration values. - Value *[]IdentityProviderContract `json:"value,omitempty"` - // NextLink - Next page link if any. + // Value - READ-ONLY; Page values. + Value *[]GatewayContract `json:"value,omitempty"` + // NextLink - READ-ONLY; Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values. -type IdentityProviderListIterator struct { +// GatewayCollectionIterator provides access to a complete listing of GatewayContract values. +type GatewayCollectionIterator struct { i int - page IdentityProviderListPage + page GatewayCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *GatewayCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -4258,62 +4481,62 @@ func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) ( // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *IdentityProviderListIterator) Next() error { +func (iter *GatewayCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IdentityProviderListIterator) NotDone() bool { +func (iter GatewayCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter IdentityProviderListIterator) Response() IdentityProviderList { +func (iter GatewayCollectionIterator) Response() GatewayCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter IdentityProviderListIterator) Value() IdentityProviderContract { +func (iter GatewayCollectionIterator) Value() GatewayContract { if !iter.page.NotDone() { - return IdentityProviderContract{} + return GatewayContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the IdentityProviderListIterator type. -func NewIdentityProviderListIterator(page IdentityProviderListPage) IdentityProviderListIterator { - return IdentityProviderListIterator{page: page} +// Creates a new instance of the GatewayCollectionIterator type. +func NewGatewayCollectionIterator(page GatewayCollectionPage) GatewayCollectionIterator { + return GatewayCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (ipl IdentityProviderList) IsEmpty() bool { - return ipl.Value == nil || len(*ipl.Value) == 0 +func (gc GatewayCollection) IsEmpty() bool { + return gc.Value == nil || len(*gc.Value) == 0 } -// identityProviderListPreparer prepares a request to retrieve the next set of results. +// gatewayCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (ipl IdentityProviderList) identityProviderListPreparer(ctx context.Context) (*http.Request, error) { - if ipl.NextLink == nil || len(to.String(ipl.NextLink)) < 1 { +func (gc GatewayCollection) gatewayCollectionPreparer(ctx context.Context) (*http.Request, error) { + if gc.NextLink == nil || len(to.String(gc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(ipl.NextLink))) + autorest.WithBaseURL(to.String(gc.NextLink))) } -// IdentityProviderListPage contains a page of IdentityProviderContract values. -type IdentityProviderListPage struct { - fn func(context.Context, IdentityProviderList) (IdentityProviderList, error) - ipl IdentityProviderList +// GatewayCollectionPage contains a page of GatewayContract values. +type GatewayCollectionPage struct { + fn func(context.Context, GatewayCollection) (GatewayCollection, error) + gc GatewayCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err error) { +func (page *GatewayCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -4322,61 +4545,68 @@ func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ipl) + next, err := page.fn(ctx, page.gc) if err != nil { return err } - page.ipl = next + page.gc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *IdentityProviderListPage) Next() error { +func (page *GatewayCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IdentityProviderListPage) NotDone() bool { - return !page.ipl.IsEmpty() +func (page GatewayCollectionPage) NotDone() bool { + return !page.gc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page IdentityProviderListPage) Response() IdentityProviderList { - return page.ipl +func (page GatewayCollectionPage) Response() GatewayCollection { + return page.gc } // Values returns the slice of values for the current page or nil if there are no values. -func (page IdentityProviderListPage) Values() []IdentityProviderContract { - if page.ipl.IsEmpty() { +func (page GatewayCollectionPage) Values() []GatewayContract { + if page.gc.IsEmpty() { return nil } - return *page.ipl.Value + return *page.gc.Value } -// Creates a new instance of the IdentityProviderListPage type. -func NewIdentityProviderListPage(getNextPage func(context.Context, IdentityProviderList) (IdentityProviderList, error)) IdentityProviderListPage { - return IdentityProviderListPage{fn: getNextPage} +// Creates a new instance of the GatewayCollectionPage type. +func NewGatewayCollectionPage(getNextPage func(context.Context, GatewayCollection) (GatewayCollection, error)) GatewayCollectionPage { + return GatewayCollectionPage{fn: getNextPage} } -// IdentityProviderUpdateParameters parameters supplied to update Identity Provider -type IdentityProviderUpdateParameters struct { - // IdentityProviderUpdateProperties - Identity Provider update properties. - *IdentityProviderUpdateProperties `json:"properties,omitempty"` +// GatewayContract gateway details. +type GatewayContract struct { + autorest.Response `json:"-"` + // GatewayContractProperties - Gateway details. + *GatewayContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters. -func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for GatewayContract. +func (gc GatewayContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ipup.IdentityProviderUpdateProperties != nil { - objectMap["properties"] = ipup.IdentityProviderUpdateProperties + if gc.GatewayContractProperties != nil { + objectMap["properties"] = gc.GatewayContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct. -func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for GatewayContract struct. +func (gc *GatewayContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4386,12 +4616,39 @@ func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var identityProviderUpdateProperties IdentityProviderUpdateProperties - err = json.Unmarshal(*v, &identityProviderUpdateProperties) + var gatewayContractProperties GatewayContractProperties + err = json.Unmarshal(*v, &gatewayContractProperties) if err != nil { return err } - ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties + gc.GatewayContractProperties = &gatewayContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gc.Type = &typeVar } } } @@ -4399,47 +4656,35 @@ func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { return nil } -// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation. -type IdentityProviderUpdateProperties struct { - // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. - ClientID *string `json:"clientId,omitempty"` - // ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. - ClientSecret *string `json:"clientSecret,omitempty"` - // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' - Type IdentityProviderType `json:"type,omitempty"` - // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. - AllowedTenants *[]string `json:"allowedTenants,omitempty"` - // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. - SignupPolicyName *string `json:"signupPolicyName,omitempty"` - // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. - SigninPolicyName *string `json:"signinPolicyName,omitempty"` - // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. - ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` - // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. - PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +// GatewayContractProperties properties of the Gateway contract. +type GatewayContractProperties struct { + // LocationData - Gateway location. + LocationData *ResourceLocationDataContract `json:"locationData,omitempty"` + // Description - Gateway description + Description *string `json:"description,omitempty"` } -// IssueAttachmentCollection paged Issue Attachment list representation. -type IssueAttachmentCollection struct { +// GatewayHostnameConfigurationCollection paged Gateway hostname configuration list representation. +type GatewayHostnameConfigurationCollection struct { autorest.Response `json:"-"` - // Value - READ-ONLY; Issue Attachment values. - Value *[]IssueAttachmentContract `json:"value,omitempty"` + // Value - READ-ONLY; Page values. + Value *[]GatewayHostnameConfigurationContract `json:"value,omitempty"` // NextLink - READ-ONLY; Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract -// values. -type IssueAttachmentCollectionIterator struct { +// GatewayHostnameConfigurationCollectionIterator provides access to a complete listing of +// GatewayHostnameConfigurationContract values. +type GatewayHostnameConfigurationCollectionIterator struct { i int - page IssueAttachmentCollectionPage + page GatewayHostnameConfigurationCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *GatewayHostnameConfigurationCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -4464,62 +4709,63 @@ func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Conte // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *IssueAttachmentCollectionIterator) Next() error { +func (iter *GatewayHostnameConfigurationCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IssueAttachmentCollectionIterator) NotDone() bool { +func (iter GatewayHostnameConfigurationCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection { +func (iter GatewayHostnameConfigurationCollectionIterator) Response() GatewayHostnameConfigurationCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract { +func (iter GatewayHostnameConfigurationCollectionIterator) Value() GatewayHostnameConfigurationContract { if !iter.page.NotDone() { - return IssueAttachmentContract{} + return GatewayHostnameConfigurationContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the IssueAttachmentCollectionIterator type. -func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator { - return IssueAttachmentCollectionIterator{page: page} +// Creates a new instance of the GatewayHostnameConfigurationCollectionIterator type. +func NewGatewayHostnameConfigurationCollectionIterator(page GatewayHostnameConfigurationCollectionPage) GatewayHostnameConfigurationCollectionIterator { + return GatewayHostnameConfigurationCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (iac IssueAttachmentCollection) IsEmpty() bool { - return iac.Value == nil || len(*iac.Value) == 0 +func (ghcc GatewayHostnameConfigurationCollection) IsEmpty() bool { + return ghcc.Value == nil || len(*ghcc.Value) == 0 } -// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results. +// gatewayHostnameConfigurationCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) { - if iac.NextLink == nil || len(to.String(iac.NextLink)) < 1 { +func (ghcc GatewayHostnameConfigurationCollection) gatewayHostnameConfigurationCollectionPreparer(ctx context.Context) (*http.Request, error) { + if ghcc.NextLink == nil || len(to.String(ghcc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(iac.NextLink))) + autorest.WithBaseURL(to.String(ghcc.NextLink))) } -// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values. -type IssueAttachmentCollectionPage struct { - fn func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error) - iac IssueAttachmentCollection +// GatewayHostnameConfigurationCollectionPage contains a page of GatewayHostnameConfigurationContract +// values. +type GatewayHostnameConfigurationCollectionPage struct { + fn func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error) + ghcc GatewayHostnameConfigurationCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *GatewayHostnameConfigurationCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/GatewayHostnameConfigurationCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -4528,49 +4774,49 @@ func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.iac) + next, err := page.fn(ctx, page.ghcc) if err != nil { return err } - page.iac = next + page.ghcc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *IssueAttachmentCollectionPage) Next() error { +func (page *GatewayHostnameConfigurationCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IssueAttachmentCollectionPage) NotDone() bool { - return !page.iac.IsEmpty() +func (page GatewayHostnameConfigurationCollectionPage) NotDone() bool { + return !page.ghcc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection { - return page.iac +func (page GatewayHostnameConfigurationCollectionPage) Response() GatewayHostnameConfigurationCollection { + return page.ghcc } // Values returns the slice of values for the current page or nil if there are no values. -func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract { - if page.iac.IsEmpty() { +func (page GatewayHostnameConfigurationCollectionPage) Values() []GatewayHostnameConfigurationContract { + if page.ghcc.IsEmpty() { return nil } - return *page.iac.Value + return *page.ghcc.Value } -// Creates a new instance of the IssueAttachmentCollectionPage type. -func NewIssueAttachmentCollectionPage(getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage { - return IssueAttachmentCollectionPage{fn: getNextPage} +// Creates a new instance of the GatewayHostnameConfigurationCollectionPage type. +func NewGatewayHostnameConfigurationCollectionPage(getNextPage func(context.Context, GatewayHostnameConfigurationCollection) (GatewayHostnameConfigurationCollection, error)) GatewayHostnameConfigurationCollectionPage { + return GatewayHostnameConfigurationCollectionPage{fn: getNextPage} } -// IssueAttachmentContract issue Attachment Contract details. -type IssueAttachmentContract struct { +// GatewayHostnameConfigurationContract gateway hostname configuration details. +type GatewayHostnameConfigurationContract struct { autorest.Response `json:"-"` - // IssueAttachmentContractProperties - Properties of the Issue Attachment. - *IssueAttachmentContractProperties `json:"properties,omitempty"` + // GatewayHostnameConfigurationContractProperties - Gateway hostname configuration details. + *GatewayHostnameConfigurationContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -4579,17 +4825,17 @@ type IssueAttachmentContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for IssueAttachmentContract. -func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for GatewayHostnameConfigurationContract. +func (ghcc GatewayHostnameConfigurationContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if iac.IssueAttachmentContractProperties != nil { - objectMap["properties"] = iac.IssueAttachmentContractProperties + if ghcc.GatewayHostnameConfigurationContractProperties != nil { + objectMap["properties"] = ghcc.GatewayHostnameConfigurationContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct. -func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for GatewayHostnameConfigurationContract struct. +func (ghcc *GatewayHostnameConfigurationContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -4599,12 +4845,12 @@ func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var issueAttachmentContractProperties IssueAttachmentContractProperties - err = json.Unmarshal(*v, &issueAttachmentContractProperties) + var gatewayHostnameConfigurationContractProperties GatewayHostnameConfigurationContractProperties + err = json.Unmarshal(*v, &gatewayHostnameConfigurationContractProperties) if err != nil { return err } - iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties + ghcc.GatewayHostnameConfigurationContractProperties = &gatewayHostnameConfigurationContractProperties } case "id": if v != nil { @@ -4613,7 +4859,7 @@ func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - iac.ID = &ID + ghcc.ID = &ID } case "name": if v != nil { @@ -4622,7 +4868,7 @@ func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - iac.Name = &name + ghcc.Name = &name } case "type": if v != nil { @@ -4631,7 +4877,7 @@ func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - iac.Type = &typeVar + ghcc.Type = &typeVar } } } @@ -4639,36 +4885,73 @@ func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { return nil } -// IssueAttachmentContractProperties issue Attachment contract Properties. -type IssueAttachmentContractProperties struct { - // Title - Filename by which the binary data will be saved. - Title *string `json:"title,omitempty"` - // ContentFormat - Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the 'content' property. - ContentFormat *string `json:"contentFormat,omitempty"` - // Content - An HTTP link or Base64-encoded binary data. - Content *string `json:"content,omitempty"` +// GatewayHostnameConfigurationContractProperties gateway hostname configuration details. +type GatewayHostnameConfigurationContractProperties struct { + // Hostname - Hostname value. Supports valid domain name, partial or full wildcard + Hostname *string `json:"hostname,omitempty"` + // CertificateID - Identifier of Certificate entity that will be used for TLS connection establishment + CertificateID *string `json:"certificateId,omitempty"` + // NegotiateClientCertificate - Determines whether gateway requests client certificate + NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` } -// IssueCollection paged Issue list representation. -type IssueCollection struct { +// GatewayKeyRegenerationRequestContract gateway key regeneration request contract properties. +type GatewayKeyRegenerationRequestContract struct { + // KeyType - The Key being regenerated. Possible values include: 'Primary', 'Secondary' + KeyType KeyType `json:"keyType,omitempty"` +} + +// GatewayKeysContract gateway authentication keys. +type GatewayKeysContract struct { autorest.Response `json:"-"` - // Value - READ-ONLY; Issue values. - Value *[]IssueContract `json:"value,omitempty"` - // NextLink - READ-ONLY; Next page link if any. + // Primary - Primary gateway key. + Primary *string `json:"primary,omitempty"` + // Secondary - Secondary gateway key. + Secondary *string `json:"secondary,omitempty"` +} + +// GatewayTokenContract gateway access token. +type GatewayTokenContract struct { + autorest.Response `json:"-"` + // Value - Shared Access Authentication token value for the Gateway. + Value *string `json:"value,omitempty"` +} + +// GatewayTokenRequestContract gateway token request contract properties. +type GatewayTokenRequestContract struct { + // KeyType - The Key to be used to generate gateway token. Possible values include: 'Primary', 'Secondary' + KeyType KeyType `json:"keyType,omitempty"` + // Expiry - The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. + Expiry *date.Time `json:"expiry,omitempty"` +} + +// GenerateSsoURLResult generate SSO Url operations response details. +type GenerateSsoURLResult struct { + autorest.Response `json:"-"` + // Value - Redirect Url containing the SSO URL value. + Value *string `json:"value,omitempty"` +} + +// GroupCollection paged Group list representation. +type GroupCollection struct { + autorest.Response `json:"-"` + // Value - Page values. + Value *[]GroupContract `json:"value,omitempty"` + // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// IssueCollectionIterator provides access to a complete listing of IssueContract values. -type IssueCollectionIterator struct { +// GroupCollectionIterator provides access to a complete listing of GroupContract values. +type GroupCollectionIterator struct { i int - page IssueCollectionPage + page GroupCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *GroupCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -4693,62 +4976,62 @@ func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err e // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *IssueCollectionIterator) Next() error { +func (iter *GroupCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IssueCollectionIterator) NotDone() bool { +func (iter GroupCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter IssueCollectionIterator) Response() IssueCollection { +func (iter GroupCollectionIterator) Response() GroupCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter IssueCollectionIterator) Value() IssueContract { +func (iter GroupCollectionIterator) Value() GroupContract { if !iter.page.NotDone() { - return IssueContract{} + return GroupContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the IssueCollectionIterator type. -func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator { - return IssueCollectionIterator{page: page} +// Creates a new instance of the GroupCollectionIterator type. +func NewGroupCollectionIterator(page GroupCollectionPage) GroupCollectionIterator { + return GroupCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (ic IssueCollection) IsEmpty() bool { - return ic.Value == nil || len(*ic.Value) == 0 +func (gc GroupCollection) IsEmpty() bool { + return gc.Value == nil || len(*gc.Value) == 0 } -// issueCollectionPreparer prepares a request to retrieve the next set of results. +// groupCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) { - if ic.NextLink == nil || len(to.String(ic.NextLink)) < 1 { +func (gc GroupCollection) groupCollectionPreparer(ctx context.Context) (*http.Request, error) { + if gc.NextLink == nil || len(to.String(gc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(ic.NextLink))) + autorest.WithBaseURL(to.String(gc.NextLink))) } -// IssueCollectionPage contains a page of IssueContract values. -type IssueCollectionPage struct { - fn func(context.Context, IssueCollection) (IssueCollection, error) - ic IssueCollection +// GroupCollectionPage contains a page of GroupContract values. +type GroupCollectionPage struct { + fn func(context.Context, GroupCollection) (GroupCollection, error) + gc GroupCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *GroupCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/GroupCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -4757,18 +5040,1037 @@ func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.ic) + next, err := page.fn(ctx, page.gc) if err != nil { return err } - page.ic = next + page.gc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *IssueCollectionPage) Next() error { +func (page *GroupCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page GroupCollectionPage) NotDone() bool { + return !page.gc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page GroupCollectionPage) Response() GroupCollection { + return page.gc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page GroupCollectionPage) Values() []GroupContract { + if page.gc.IsEmpty() { + return nil + } + return *page.gc.Value +} + +// Creates a new instance of the GroupCollectionPage type. +func NewGroupCollectionPage(getNextPage func(context.Context, GroupCollection) (GroupCollection, error)) GroupCollectionPage { + return GroupCollectionPage{fn: getNextPage} +} + +// GroupContract contract details. +type GroupContract struct { + autorest.Response `json:"-"` + // GroupContractProperties - Group entity contract properties. + *GroupContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupContract. +func (gc GroupContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gc.GroupContractProperties != nil { + objectMap["properties"] = gc.GroupContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GroupContract struct. +func (gc *GroupContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var groupContractProperties GroupContractProperties + err = json.Unmarshal(*v, &groupContractProperties) + if err != nil { + return err + } + gc.GroupContractProperties = &groupContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gc.Type = &typeVar + } + } + } + + return nil +} + +// GroupContractProperties group contract Properties. +type GroupContractProperties struct { + // DisplayName - Group name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Group description. Can contain HTML formatting tags. + Description *string `json:"description,omitempty"` + // BuiltIn - READ-ONLY; true if the group is one of the three system groups (Administrators, Developers, or Guests); otherwise false. + BuiltIn *bool `json:"builtIn,omitempty"` + // Type - Group type. Possible values include: 'Custom', 'System', 'External' + Type GroupType `json:"type,omitempty"` + // ExternalID - For external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + ExternalID *string `json:"externalId,omitempty"` +} + +// GroupCreateParameters parameters supplied to the Create Group operation. +type GroupCreateParameters struct { + // GroupCreateParametersProperties - Properties supplied to Create Group operation. + *GroupCreateParametersProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupCreateParameters. +func (gcp GroupCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gcp.GroupCreateParametersProperties != nil { + objectMap["properties"] = gcp.GroupCreateParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GroupCreateParameters struct. +func (gcp *GroupCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var groupCreateParametersProperties GroupCreateParametersProperties + err = json.Unmarshal(*v, &groupCreateParametersProperties) + if err != nil { + return err + } + gcp.GroupCreateParametersProperties = &groupCreateParametersProperties + } + } + } + + return nil +} + +// GroupCreateParametersProperties parameters supplied to the Create Group operation. +type GroupCreateParametersProperties struct { + // DisplayName - Group name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Group description. + Description *string `json:"description,omitempty"` + // Type - Group type. Possible values include: 'Custom', 'System', 'External' + Type GroupType `json:"type,omitempty"` + // ExternalID - Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + ExternalID *string `json:"externalId,omitempty"` +} + +// GroupUpdateParameters parameters supplied to the Update Group operation. +type GroupUpdateParameters struct { + // GroupUpdateParametersProperties - Group entity update contract properties. + *GroupUpdateParametersProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupUpdateParameters. +func (gup GroupUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gup.GroupUpdateParametersProperties != nil { + objectMap["properties"] = gup.GroupUpdateParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GroupUpdateParameters struct. +func (gup *GroupUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var groupUpdateParametersProperties GroupUpdateParametersProperties + err = json.Unmarshal(*v, &groupUpdateParametersProperties) + if err != nil { + return err + } + gup.GroupUpdateParametersProperties = &groupUpdateParametersProperties + } + } + } + + return nil +} + +// GroupUpdateParametersProperties parameters supplied to the Update Group operation. +type GroupUpdateParametersProperties struct { + // DisplayName - Group name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Group description. + Description *string `json:"description,omitempty"` + // Type - Group type. Possible values include: 'Custom', 'System', 'External' + Type GroupType `json:"type,omitempty"` + // ExternalID - Identifier of the external groups, this property contains the id of the group from the external identity provider, e.g. for Azure Active Directory `aad://.onmicrosoft.com/groups/`; otherwise the value is null. + ExternalID *string `json:"externalId,omitempty"` +} + +// HostnameConfiguration custom hostname configuration. +type HostnameConfiguration struct { + // Type - Hostname type. Possible values include: 'HostnameTypeProxy', 'HostnameTypePortal', 'HostnameTypeManagement', 'HostnameTypeScm', 'HostnameTypeDeveloperPortal' + Type HostnameType `json:"type,omitempty"` + // HostName - Hostname to configure on the Api Management service. + HostName *string `json:"hostName,omitempty"` + // KeyVaultID - Url to the KeyVault Secret containing the Ssl Certificate. If absolute Url containing version is provided, auto-update of ssl certificate will not work. This requires Api Management service to be configured with MSI. The secret should be of type *application/x-pkcs12* + KeyVaultID *string `json:"keyVaultId,omitempty"` + // EncodedCertificate - Base64 Encoded certificate. + EncodedCertificate *string `json:"encodedCertificate,omitempty"` + // CertificatePassword - Certificate Password. + CertificatePassword *string `json:"certificatePassword,omitempty"` + // DefaultSslBinding - Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not send the SNI header, then this will be the certificate that will be challenged. The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. The setting only applied to Proxy Hostname Type. + DefaultSslBinding *bool `json:"defaultSslBinding,omitempty"` + // NegotiateClientCertificate - Specify true to always negotiate client certificate on the hostname. Default Value is false. + NegotiateClientCertificate *bool `json:"negotiateClientCertificate,omitempty"` + // Certificate - Certificate information. + Certificate *CertificateInformation `json:"certificate,omitempty"` +} + +// HTTPMessageDiagnostic http message diagnostic settings. +type HTTPMessageDiagnostic struct { + // Headers - Array of HTTP Headers to log. + Headers *[]string `json:"headers,omitempty"` + // Body - Body logging settings. + Body *BodyDiagnosticSettings `json:"body,omitempty"` +} + +// IdentityProviderBaseParameters identity Provider Base Parameter Properties. +type IdentityProviderBaseParameters struct { + // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' + Type IdentityProviderType `json:"type,omitempty"` + // SigninTenant - The TenantId to use instead of Common when logging into Active Directory + SigninTenant *string `json:"signinTenant,omitempty"` + // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. + AllowedTenants *[]string `json:"allowedTenants,omitempty"` + // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + Authority *string `json:"authority,omitempty"` + // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. + SignupPolicyName *string `json:"signupPolicyName,omitempty"` + // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. + SigninPolicyName *string `json:"signinPolicyName,omitempty"` + // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` + // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +} + +// IdentityProviderContract identity Provider details. +type IdentityProviderContract struct { + autorest.Response `json:"-"` + // IdentityProviderContractProperties - Identity Provider contract properties. + *IdentityProviderContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IdentityProviderContract. +func (ipc IdentityProviderContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ipc.IdentityProviderContractProperties != nil { + objectMap["properties"] = ipc.IdentityProviderContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IdentityProviderContract struct. +func (ipc *IdentityProviderContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var identityProviderContractProperties IdentityProviderContractProperties + err = json.Unmarshal(*v, &identityProviderContractProperties) + if err != nil { + return err + } + ipc.IdentityProviderContractProperties = &identityProviderContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ipc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ipc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ipc.Type = &typeVar + } + } + } + + return nil +} + +// IdentityProviderContractProperties the external Identity Providers like Facebook, Google, Microsoft, +// Twitter or Azure Active Directory which can be used to enable access to the API Management service +// developer portal for all users. +type IdentityProviderContractProperties struct { + // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. + ClientID *string `json:"clientId,omitempty"` + // ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + ClientSecret *string `json:"clientSecret,omitempty"` + // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' + Type IdentityProviderType `json:"type,omitempty"` + // SigninTenant - The TenantId to use instead of Common when logging into Active Directory + SigninTenant *string `json:"signinTenant,omitempty"` + // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. + AllowedTenants *[]string `json:"allowedTenants,omitempty"` + // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + Authority *string `json:"authority,omitempty"` + // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. + SignupPolicyName *string `json:"signupPolicyName,omitempty"` + // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. + SigninPolicyName *string `json:"signinPolicyName,omitempty"` + // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` + // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +} + +// IdentityProviderCreateContract identity Provider details. +type IdentityProviderCreateContract struct { + // IdentityProviderCreateContractProperties - Identity Provider contract properties. + *IdentityProviderCreateContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IdentityProviderCreateContract. +func (ipcc IdentityProviderCreateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ipcc.IdentityProviderCreateContractProperties != nil { + objectMap["properties"] = ipcc.IdentityProviderCreateContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IdentityProviderCreateContract struct. +func (ipcc *IdentityProviderCreateContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var identityProviderCreateContractProperties IdentityProviderCreateContractProperties + err = json.Unmarshal(*v, &identityProviderCreateContractProperties) + if err != nil { + return err + } + ipcc.IdentityProviderCreateContractProperties = &identityProviderCreateContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ipcc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ipcc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ipcc.Type = &typeVar + } + } + } + + return nil +} + +// IdentityProviderCreateContractProperties the external Identity Providers like Facebook, Google, +// Microsoft, Twitter or Azure Active Directory which can be used to enable access to the API Management +// service developer portal for all users. +type IdentityProviderCreateContractProperties struct { + // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. + ClientID *string `json:"clientId,omitempty"` + // ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + ClientSecret *string `json:"clientSecret,omitempty"` + // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' + Type IdentityProviderType `json:"type,omitempty"` + // SigninTenant - The TenantId to use instead of Common when logging into Active Directory + SigninTenant *string `json:"signinTenant,omitempty"` + // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. + AllowedTenants *[]string `json:"allowedTenants,omitempty"` + // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + Authority *string `json:"authority,omitempty"` + // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. + SignupPolicyName *string `json:"signupPolicyName,omitempty"` + // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. + SigninPolicyName *string `json:"signinPolicyName,omitempty"` + // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` + // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +} + +// IdentityProviderList list of all the Identity Providers configured on the service instance. +type IdentityProviderList struct { + autorest.Response `json:"-"` + // Value - Identity Provider configuration values. + Value *[]IdentityProviderContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// IdentityProviderListIterator provides access to a complete listing of IdentityProviderContract values. +type IdentityProviderListIterator struct { + i int + page IdentityProviderListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IdentityProviderListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IdentityProviderListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IdentityProviderListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IdentityProviderListIterator) Response() IdentityProviderList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IdentityProviderListIterator) Value() IdentityProviderContract { + if !iter.page.NotDone() { + return IdentityProviderContract{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IdentityProviderListIterator type. +func NewIdentityProviderListIterator(page IdentityProviderListPage) IdentityProviderListIterator { + return IdentityProviderListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ipl IdentityProviderList) IsEmpty() bool { + return ipl.Value == nil || len(*ipl.Value) == 0 +} + +// identityProviderListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ipl IdentityProviderList) identityProviderListPreparer(ctx context.Context) (*http.Request, error) { + if ipl.NextLink == nil || len(to.String(ipl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ipl.NextLink))) +} + +// IdentityProviderListPage contains a page of IdentityProviderContract values. +type IdentityProviderListPage struct { + fn func(context.Context, IdentityProviderList) (IdentityProviderList, error) + ipl IdentityProviderList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IdentityProviderListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IdentityProviderListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ipl) + if err != nil { + return err + } + page.ipl = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IdentityProviderListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IdentityProviderListPage) NotDone() bool { + return !page.ipl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IdentityProviderListPage) Response() IdentityProviderList { + return page.ipl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IdentityProviderListPage) Values() []IdentityProviderContract { + if page.ipl.IsEmpty() { + return nil + } + return *page.ipl.Value +} + +// Creates a new instance of the IdentityProviderListPage type. +func NewIdentityProviderListPage(getNextPage func(context.Context, IdentityProviderList) (IdentityProviderList, error)) IdentityProviderListPage { + return IdentityProviderListPage{fn: getNextPage} +} + +// IdentityProviderUpdateParameters parameters supplied to update Identity Provider +type IdentityProviderUpdateParameters struct { + // IdentityProviderUpdateProperties - Identity Provider update properties. + *IdentityProviderUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for IdentityProviderUpdateParameters. +func (ipup IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ipup.IdentityProviderUpdateProperties != nil { + objectMap["properties"] = ipup.IdentityProviderUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IdentityProviderUpdateParameters struct. +func (ipup *IdentityProviderUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var identityProviderUpdateProperties IdentityProviderUpdateProperties + err = json.Unmarshal(*v, &identityProviderUpdateProperties) + if err != nil { + return err + } + ipup.IdentityProviderUpdateProperties = &identityProviderUpdateProperties + } + } + } + + return nil +} + +// IdentityProviderUpdateProperties parameters supplied to the Update Identity Provider operation. +type IdentityProviderUpdateProperties struct { + // ClientID - Client Id of the Application in the external Identity Provider. It is App ID for Facebook login, Client ID for Google login, App ID for Microsoft. + ClientID *string `json:"clientId,omitempty"` + // ClientSecret - Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is App Secret for Facebook login, API Key for Google login, Public Key for Microsoft. + ClientSecret *string `json:"clientSecret,omitempty"` + // Type - Identity Provider Type identifier. Possible values include: 'Facebook', 'Google', 'Microsoft', 'Twitter', 'Aad', 'AadB2C' + Type IdentityProviderType `json:"type,omitempty"` + // SigninTenant - The TenantId to use instead of Common when logging into Active Directory + SigninTenant *string `json:"signinTenant,omitempty"` + // AllowedTenants - List of Allowed Tenants when configuring Azure Active Directory login. + AllowedTenants *[]string `json:"allowedTenants,omitempty"` + // Authority - OpenID Connect discovery endpoint hostname for AAD or AAD B2C. + Authority *string `json:"authority,omitempty"` + // SignupPolicyName - Signup Policy Name. Only applies to AAD B2C Identity Provider. + SignupPolicyName *string `json:"signupPolicyName,omitempty"` + // SigninPolicyName - Signin Policy Name. Only applies to AAD B2C Identity Provider. + SigninPolicyName *string `json:"signinPolicyName,omitempty"` + // ProfileEditingPolicyName - Profile Editing Policy Name. Only applies to AAD B2C Identity Provider. + ProfileEditingPolicyName *string `json:"profileEditingPolicyName,omitempty"` + // PasswordResetPolicyName - Password Reset Policy Name. Only applies to AAD B2C Identity Provider. + PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` +} + +// IssueAttachmentCollection paged Issue Attachment list representation. +type IssueAttachmentCollection struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Issue Attachment values. + Value *[]IssueAttachmentContract `json:"value,omitempty"` + // NextLink - READ-ONLY; Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// IssueAttachmentCollectionIterator provides access to a complete listing of IssueAttachmentContract +// values. +type IssueAttachmentCollectionIterator struct { + i int + page IssueAttachmentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IssueAttachmentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IssueAttachmentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IssueAttachmentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IssueAttachmentCollectionIterator) Response() IssueAttachmentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IssueAttachmentCollectionIterator) Value() IssueAttachmentContract { + if !iter.page.NotDone() { + return IssueAttachmentContract{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IssueAttachmentCollectionIterator type. +func NewIssueAttachmentCollectionIterator(page IssueAttachmentCollectionPage) IssueAttachmentCollectionIterator { + return IssueAttachmentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (iac IssueAttachmentCollection) IsEmpty() bool { + return iac.Value == nil || len(*iac.Value) == 0 +} + +// issueAttachmentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (iac IssueAttachmentCollection) issueAttachmentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if iac.NextLink == nil || len(to.String(iac.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(iac.NextLink))) +} + +// IssueAttachmentCollectionPage contains a page of IssueAttachmentContract values. +type IssueAttachmentCollectionPage struct { + fn func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error) + iac IssueAttachmentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IssueAttachmentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueAttachmentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.iac) + if err != nil { + return err + } + page.iac = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IssueAttachmentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IssueAttachmentCollectionPage) NotDone() bool { + return !page.iac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IssueAttachmentCollectionPage) Response() IssueAttachmentCollection { + return page.iac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IssueAttachmentCollectionPage) Values() []IssueAttachmentContract { + if page.iac.IsEmpty() { + return nil + } + return *page.iac.Value +} + +// Creates a new instance of the IssueAttachmentCollectionPage type. +func NewIssueAttachmentCollectionPage(getNextPage func(context.Context, IssueAttachmentCollection) (IssueAttachmentCollection, error)) IssueAttachmentCollectionPage { + return IssueAttachmentCollectionPage{fn: getNextPage} +} + +// IssueAttachmentContract issue Attachment Contract details. +type IssueAttachmentContract struct { + autorest.Response `json:"-"` + // IssueAttachmentContractProperties - Properties of the Issue Attachment. + *IssueAttachmentContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IssueAttachmentContract. +func (iac IssueAttachmentContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iac.IssueAttachmentContractProperties != nil { + objectMap["properties"] = iac.IssueAttachmentContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IssueAttachmentContract struct. +func (iac *IssueAttachmentContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var issueAttachmentContractProperties IssueAttachmentContractProperties + err = json.Unmarshal(*v, &issueAttachmentContractProperties) + if err != nil { + return err + } + iac.IssueAttachmentContractProperties = &issueAttachmentContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + iac.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + iac.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + iac.Type = &typeVar + } + } + } + + return nil +} + +// IssueAttachmentContractProperties issue Attachment contract Properties. +type IssueAttachmentContractProperties struct { + // Title - Filename by which the binary data will be saved. + Title *string `json:"title,omitempty"` + // ContentFormat - Either 'link' if content is provided via an HTTP link or the MIME type of the Base64-encoded binary data provided in the 'content' property. + ContentFormat *string `json:"contentFormat,omitempty"` + // Content - An HTTP link or Base64-encoded binary data. + Content *string `json:"content,omitempty"` +} + +// IssueCollection paged Issue list representation. +type IssueCollection struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Issue values. + Value *[]IssueContract `json:"value,omitempty"` + // NextLink - READ-ONLY; Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// IssueCollectionIterator provides access to a complete listing of IssueContract values. +type IssueCollectionIterator struct { + i int + page IssueCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IssueCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IssueCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IssueCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IssueCollectionIterator) Response() IssueCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IssueCollectionIterator) Value() IssueContract { + if !iter.page.NotDone() { + return IssueContract{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IssueCollectionIterator type. +func NewIssueCollectionIterator(page IssueCollectionPage) IssueCollectionIterator { + return IssueCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ic IssueCollection) IsEmpty() bool { + return ic.Value == nil || len(*ic.Value) == 0 +} + +// issueCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ic IssueCollection) issueCollectionPreparer(ctx context.Context) (*http.Request, error) { + if ic.NextLink == nil || len(to.String(ic.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ic.NextLink))) +} + +// IssueCollectionPage contains a page of IssueContract values. +type IssueCollectionPage struct { + fn func(context.Context, IssueCollection) (IssueCollection, error) + ic IssueCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IssueCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ic) + if err != nil { + return err + } + page.ic = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IssueCollectionPage) Next() error { return page.NextWithContext(context.Background()) } @@ -4777,44 +6079,435 @@ func (page IssueCollectionPage) NotDone() bool { return !page.ic.IsEmpty() } -// Response returns the raw server response from the last page request. -func (page IssueCollectionPage) Response() IssueCollection { - return page.ic +// Response returns the raw server response from the last page request. +func (page IssueCollectionPage) Response() IssueCollection { + return page.ic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IssueCollectionPage) Values() []IssueContract { + if page.ic.IsEmpty() { + return nil + } + return *page.ic.Value +} + +// Creates a new instance of the IssueCollectionPage type. +func NewIssueCollectionPage(getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage { + return IssueCollectionPage{fn: getNextPage} +} + +// IssueCommentCollection paged Issue Comment list representation. +type IssueCommentCollection struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Issue Comment values. + Value *[]IssueCommentContract `json:"value,omitempty"` + // NextLink - READ-ONLY; Next page link if any. + NextLink *string `json:"nextLink,omitempty"` +} + +// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values. +type IssueCommentCollectionIterator struct { + i int + page IssueCommentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IssueCommentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IssueCommentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IssueCommentCollectionIterator) Value() IssueCommentContract { + if !iter.page.NotDone() { + return IssueCommentContract{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IssueCommentCollectionIterator type. +func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator { + return IssueCommentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (icc IssueCommentCollection) IsEmpty() bool { + return icc.Value == nil || len(*icc.Value) == 0 +} + +// issueCommentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if icc.NextLink == nil || len(to.String(icc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(icc.NextLink))) +} + +// IssueCommentCollectionPage contains a page of IssueCommentContract values. +type IssueCommentCollectionPage struct { + fn func(context.Context, IssueCommentCollection) (IssueCommentCollection, error) + icc IssueCommentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.icc) + if err != nil { + return err + } + page.icc = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IssueCommentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IssueCommentCollectionPage) NotDone() bool { + return !page.icc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IssueCommentCollectionPage) Response() IssueCommentCollection { + return page.icc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IssueCommentCollectionPage) Values() []IssueCommentContract { + if page.icc.IsEmpty() { + return nil + } + return *page.icc.Value +} + +// Creates a new instance of the IssueCommentCollectionPage type. +func NewIssueCommentCollectionPage(getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage { + return IssueCommentCollectionPage{fn: getNextPage} +} + +// IssueCommentContract issue Comment Contract details. +type IssueCommentContract struct { + autorest.Response `json:"-"` + // IssueCommentContractProperties - Properties of the Issue Comment. + *IssueCommentContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IssueCommentContract. +func (icc IssueCommentContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if icc.IssueCommentContractProperties != nil { + objectMap["properties"] = icc.IssueCommentContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct. +func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var issueCommentContractProperties IssueCommentContractProperties + err = json.Unmarshal(*v, &issueCommentContractProperties) + if err != nil { + return err + } + icc.IssueCommentContractProperties = &issueCommentContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + icc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + icc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + icc.Type = &typeVar + } + } + } + + return nil +} + +// IssueCommentContractProperties issue Comment contract Properties. +type IssueCommentContractProperties struct { + // Text - Comment text. + Text *string `json:"text,omitempty"` + // CreatedDate - Date and time when the comment was created. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // UserID - A resource identifier for the user who left the comment. + UserID *string `json:"userId,omitempty"` +} + +// IssueContract issue Contract details. +type IssueContract struct { + autorest.Response `json:"-"` + // IssueContractProperties - Properties of the Issue. + *IssueContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for IssueContract. +func (ic IssueContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ic.IssueContractProperties != nil { + objectMap["properties"] = ic.IssueContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for IssueContract struct. +func (ic *IssueContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var issueContractProperties IssueContractProperties + err = json.Unmarshal(*v, &issueContractProperties) + if err != nil { + return err + } + ic.IssueContractProperties = &issueContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ic.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ic.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ic.Type = &typeVar + } + } + } + + return nil +} + +// IssueContractBaseProperties issue contract Base Properties. +type IssueContractBaseProperties struct { + // CreatedDate - Date and time when the issue was created. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' + State State `json:"state,omitempty"` + // APIID - A resource identifier for the API the issue was created for. + APIID *string `json:"apiId,omitempty"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page IssueCollectionPage) Values() []IssueContract { - if page.ic.IsEmpty() { - return nil +// IssueContractProperties issue contract Properties. +type IssueContractProperties struct { + // Title - The issue title. + Title *string `json:"title,omitempty"` + // Description - Text describing the issue. + Description *string `json:"description,omitempty"` + // UserID - A resource identifier for the user created the issue. + UserID *string `json:"userId,omitempty"` + // CreatedDate - Date and time when the issue was created. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' + State State `json:"state,omitempty"` + // APIID - A resource identifier for the API the issue was created for. + APIID *string `json:"apiId,omitempty"` +} + +// IssueUpdateContract issue update Parameters. +type IssueUpdateContract struct { + // IssueUpdateContractProperties - Issue entity Update contract properties. + *IssueUpdateContractProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for IssueUpdateContract. +func (iuc IssueUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iuc.IssueUpdateContractProperties != nil { + objectMap["properties"] = iuc.IssueUpdateContractProperties } - return *page.ic.Value + return json.Marshal(objectMap) } -// Creates a new instance of the IssueCollectionPage type. -func NewIssueCollectionPage(getNextPage func(context.Context, IssueCollection) (IssueCollection, error)) IssueCollectionPage { - return IssueCollectionPage{fn: getNextPage} +// UnmarshalJSON is the custom unmarshaler for IssueUpdateContract struct. +func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var issueUpdateContractProperties IssueUpdateContractProperties + err = json.Unmarshal(*v, &issueUpdateContractProperties) + if err != nil { + return err + } + iuc.IssueUpdateContractProperties = &issueUpdateContractProperties + } + } + } + + return nil } -// IssueCommentCollection paged Issue Comment list representation. -type IssueCommentCollection struct { +// IssueUpdateContractProperties issue contract Update Properties. +type IssueUpdateContractProperties struct { + // Title - The issue title. + Title *string `json:"title,omitempty"` + // Description - Text describing the issue. + Description *string `json:"description,omitempty"` + // UserID - A resource identifier for the user created the issue. + UserID *string `json:"userId,omitempty"` + // CreatedDate - Date and time when the issue was created. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' + State State `json:"state,omitempty"` + // APIID - A resource identifier for the API the issue was created for. + APIID *string `json:"apiId,omitempty"` +} + +// ListNetworkStatusContractByLocation ... +type ListNetworkStatusContractByLocation struct { autorest.Response `json:"-"` - // Value - READ-ONLY; Issue Comment values. - Value *[]IssueCommentContract `json:"value,omitempty"` - // NextLink - READ-ONLY; Next page link if any. + Value *[]NetworkStatusContractByLocation `json:"value,omitempty"` +} + +// LoggerCollection paged Logger list representation. +type LoggerCollection struct { + autorest.Response `json:"-"` + // Value - Logger values. + Value *[]LoggerContract `json:"value,omitempty"` + // Count - Total record count number across all pages. + Count *int64 `json:"count,omitempty"` + // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// IssueCommentCollectionIterator provides access to a complete listing of IssueCommentContract values. -type IssueCommentCollectionIterator struct { +// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. +type LoggerCollectionIterator struct { i int - page IssueCommentCollectionPage + page LoggerCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -4839,62 +6532,62 @@ func (iter *IssueCommentCollectionIterator) NextWithContext(ctx context.Context) // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *IssueCommentCollectionIterator) Next() error { +func (iter *LoggerCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IssueCommentCollectionIterator) NotDone() bool { +func (iter LoggerCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter IssueCommentCollectionIterator) Response() IssueCommentCollection { +func (iter LoggerCollectionIterator) Response() LoggerCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter IssueCommentCollectionIterator) Value() IssueCommentContract { +func (iter LoggerCollectionIterator) Value() LoggerContract { if !iter.page.NotDone() { - return IssueCommentContract{} + return LoggerContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the IssueCommentCollectionIterator type. -func NewIssueCommentCollectionIterator(page IssueCommentCollectionPage) IssueCommentCollectionIterator { - return IssueCommentCollectionIterator{page: page} +// Creates a new instance of the LoggerCollectionIterator type. +func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { + return LoggerCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (icc IssueCommentCollection) IsEmpty() bool { - return icc.Value == nil || len(*icc.Value) == 0 +func (lc LoggerCollection) IsEmpty() bool { + return lc.Value == nil || len(*lc.Value) == 0 } -// issueCommentCollectionPreparer prepares a request to retrieve the next set of results. +// loggerCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (icc IssueCommentCollection) issueCommentCollectionPreparer(ctx context.Context) (*http.Request, error) { - if icc.NextLink == nil || len(to.String(icc.NextLink)) < 1 { +func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { + if lc.NextLink == nil || len(to.String(lc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(icc.NextLink))) + autorest.WithBaseURL(to.String(lc.NextLink))) } -// IssueCommentCollectionPage contains a page of IssueCommentContract values. -type IssueCommentCollectionPage struct { - fn func(context.Context, IssueCommentCollection) (IssueCommentCollection, error) - icc IssueCommentCollection +// LoggerCollectionPage contains a page of LoggerContract values. +type LoggerCollectionPage struct { + fn func(context.Context, LoggerCollection) (LoggerCollection, error) + lc LoggerCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IssueCommentCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -4903,132 +6596,49 @@ func (page *IssueCommentCollectionPage) NextWithContext(ctx context.Context) (er tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.icc) + next, err := page.fn(ctx, page.lc) if err != nil { return err } - page.icc = next + page.lc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *IssueCommentCollectionPage) Next() error { +func (page *LoggerCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IssueCommentCollectionPage) NotDone() bool { - return !page.icc.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page IssueCommentCollectionPage) Response() IssueCommentCollection { - return page.icc -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page IssueCommentCollectionPage) Values() []IssueCommentContract { - if page.icc.IsEmpty() { - return nil - } - return *page.icc.Value -} - -// Creates a new instance of the IssueCommentCollectionPage type. -func NewIssueCommentCollectionPage(getNextPage func(context.Context, IssueCommentCollection) (IssueCommentCollection, error)) IssueCommentCollectionPage { - return IssueCommentCollectionPage{fn: getNextPage} -} - -// IssueCommentContract issue Comment Contract details. -type IssueCommentContract struct { - autorest.Response `json:"-"` - // IssueCommentContractProperties - Properties of the Issue Comment. - *IssueCommentContractProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type for API Management resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for IssueCommentContract. -func (icc IssueCommentContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if icc.IssueCommentContractProperties != nil { - objectMap["properties"] = icc.IssueCommentContractProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IssueCommentContract struct. -func (icc *IssueCommentContract) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var issueCommentContractProperties IssueCommentContractProperties - err = json.Unmarshal(*v, &issueCommentContractProperties) - if err != nil { - return err - } - icc.IssueCommentContractProperties = &issueCommentContractProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - icc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - icc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - icc.Type = &typeVar - } - } - } +func (page LoggerCollectionPage) NotDone() bool { + return !page.lc.IsEmpty() +} - return nil +// Response returns the raw server response from the last page request. +func (page LoggerCollectionPage) Response() LoggerCollection { + return page.lc } -// IssueCommentContractProperties issue Comment contract Properties. -type IssueCommentContractProperties struct { - // Text - Comment text. - Text *string `json:"text,omitempty"` - // CreatedDate - Date and time when the comment was created. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // UserID - A resource identifier for the user who left the comment. - UserID *string `json:"userId,omitempty"` +// Values returns the slice of values for the current page or nil if there are no values. +func (page LoggerCollectionPage) Values() []LoggerContract { + if page.lc.IsEmpty() { + return nil + } + return *page.lc.Value } -// IssueContract issue Contract details. -type IssueContract struct { +// Creates a new instance of the LoggerCollectionPage type. +func NewLoggerCollectionPage(getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { + return LoggerCollectionPage{fn: getNextPage} +} + +// LoggerContract logger details. +type LoggerContract struct { autorest.Response `json:"-"` - // IssueContractProperties - Properties of the Issue. - *IssueContractProperties `json:"properties,omitempty"` + // LoggerContractProperties - Logger entity contract properties. + *LoggerContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -5037,17 +6647,17 @@ type IssueContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for IssueContract. -func (ic IssueContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for LoggerContract. +func (lc LoggerContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ic.IssueContractProperties != nil { - objectMap["properties"] = ic.IssueContractProperties + if lc.LoggerContractProperties != nil { + objectMap["properties"] = lc.LoggerContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IssueContract struct. -func (ic *IssueContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for LoggerContract struct. +func (lc *LoggerContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5057,12 +6667,12 @@ func (ic *IssueContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var issueContractProperties IssueContractProperties - err = json.Unmarshal(*v, &issueContractProperties) + var loggerContractProperties LoggerContractProperties + err = json.Unmarshal(*v, &loggerContractProperties) if err != nil { return err } - ic.IssueContractProperties = &issueContractProperties + lc.LoggerContractProperties = &loggerContractProperties } case "id": if v != nil { @@ -5071,7 +6681,7 @@ func (ic *IssueContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - ic.ID = &ID + lc.ID = &ID } case "name": if v != nil { @@ -5080,7 +6690,7 @@ func (ic *IssueContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - ic.Name = &name + lc.Name = &name } case "type": if v != nil { @@ -5089,7 +6699,7 @@ func (ic *IssueContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - ic.Type = &typeVar + lc.Type = &typeVar } } } @@ -5097,49 +6707,61 @@ func (ic *IssueContract) UnmarshalJSON(body []byte) error { return nil } -// IssueContractBaseProperties issue contract Base Properties. -type IssueContractBaseProperties struct { - // CreatedDate - Date and time when the issue was created. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' - State State `json:"state,omitempty"` - // APIID - A resource identifier for the API the issue was created for. - APIID *string `json:"apiId,omitempty"` +// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use +// to log API Management events. Currently the Logger entity supports logging API Management events to +// Azure Event Hubs. +type LoggerContractProperties struct { + // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' + LoggerType LoggerType `json:"loggerType,omitempty"` + // Description - Logger description. + Description *string `json:"description,omitempty"` + // Credentials - The name and SendRule connection string of the event hub for azureEventHub logger. + // Instrumentation key for applicationInsights logger. + Credentials map[string]*string `json:"credentials"` + // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. + IsBuffered *bool `json:"isBuffered,omitempty"` + // ResourceID - Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource). + ResourceID *string `json:"resourceId,omitempty"` } -// IssueContractProperties issue contract Properties. -type IssueContractProperties struct { - // Title - The issue title. - Title *string `json:"title,omitempty"` - // Description - Text describing the issue. - Description *string `json:"description,omitempty"` - // UserID - A resource identifier for the user created the issue. - UserID *string `json:"userId,omitempty"` - // CreatedDate - Date and time when the issue was created. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' - State State `json:"state,omitempty"` - // APIID - A resource identifier for the API the issue was created for. - APIID *string `json:"apiId,omitempty"` +// MarshalJSON is the custom marshaler for LoggerContractProperties. +func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lcp.LoggerType != "" { + objectMap["loggerType"] = lcp.LoggerType + } + if lcp.Description != nil { + objectMap["description"] = lcp.Description + } + if lcp.Credentials != nil { + objectMap["credentials"] = lcp.Credentials + } + if lcp.IsBuffered != nil { + objectMap["isBuffered"] = lcp.IsBuffered + } + if lcp.ResourceID != nil { + objectMap["resourceId"] = lcp.ResourceID + } + return json.Marshal(objectMap) } -// IssueUpdateContract issue update Parameters. -type IssueUpdateContract struct { - // IssueUpdateContractProperties - Issue entity Update contract properties. - *IssueUpdateContractProperties `json:"properties,omitempty"` +// LoggerUpdateContract logger update contract. +type LoggerUpdateContract struct { + // LoggerUpdateParameters - Logger entity update contract properties. + *LoggerUpdateParameters `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for IssueUpdateContract. -func (iuc IssueUpdateContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for LoggerUpdateContract. +func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if iuc.IssueUpdateContractProperties != nil { - objectMap["properties"] = iuc.IssueUpdateContractProperties + if luc.LoggerUpdateParameters != nil { + objectMap["properties"] = luc.LoggerUpdateParameters } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for IssueUpdateContract struct. -func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct. +func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5149,12 +6771,12 @@ func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var issueUpdateContractProperties IssueUpdateContractProperties - err = json.Unmarshal(*v, &issueUpdateContractProperties) + var loggerUpdateParameters LoggerUpdateParameters + err = json.Unmarshal(*v, &loggerUpdateParameters) if err != nil { return err } - iuc.IssueUpdateContractProperties = &issueUpdateContractProperties + luc.LoggerUpdateParameters = &loggerUpdateParameters } } } @@ -5162,50 +6784,56 @@ func (iuc *IssueUpdateContract) UnmarshalJSON(body []byte) error { return nil } -// IssueUpdateContractProperties issue contract Update Properties. -type IssueUpdateContractProperties struct { - // Title - The issue title. - Title *string `json:"title,omitempty"` - // Description - Text describing the issue. +// LoggerUpdateParameters parameters supplied to the Update Logger operation. +type LoggerUpdateParameters struct { + // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' + LoggerType LoggerType `json:"loggerType,omitempty"` + // Description - Logger description. Description *string `json:"description,omitempty"` - // UserID - A resource identifier for the user created the issue. - UserID *string `json:"userId,omitempty"` - // CreatedDate - Date and time when the issue was created. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // State - Status of the issue. Possible values include: 'Proposed', 'Open', 'Removed', 'Resolved', 'Closed' - State State `json:"state,omitempty"` - // APIID - A resource identifier for the API the issue was created for. - APIID *string `json:"apiId,omitempty"` + // Credentials - Logger credentials. + Credentials map[string]*string `json:"credentials"` + // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. + IsBuffered *bool `json:"isBuffered,omitempty"` } -// ListNetworkStatusContractByLocation ... -type ListNetworkStatusContractByLocation struct { - autorest.Response `json:"-"` - Value *[]NetworkStatusContractByLocation `json:"value,omitempty"` +// MarshalJSON is the custom marshaler for LoggerUpdateParameters. +func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lup.LoggerType != "" { + objectMap["loggerType"] = lup.LoggerType + } + if lup.Description != nil { + objectMap["description"] = lup.Description + } + if lup.Credentials != nil { + objectMap["credentials"] = lup.Credentials + } + if lup.IsBuffered != nil { + objectMap["isBuffered"] = lup.IsBuffered + } + return json.Marshal(objectMap) } -// LoggerCollection paged Logger list representation. -type LoggerCollection struct { +// NamedValueCollection paged NamedValue list representation. +type NamedValueCollection struct { autorest.Response `json:"-"` - // Value - Logger values. - Value *[]LoggerContract `json:"value,omitempty"` - // Count - Total record count number across all pages. - Count *int64 `json:"count,omitempty"` + // Value - Page values. + Value *[]NamedValueContract `json:"value,omitempty"` // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// LoggerCollectionIterator provides access to a complete listing of LoggerContract values. -type LoggerCollectionIterator struct { +// NamedValueCollectionIterator provides access to a complete listing of NamedValueContract values. +type NamedValueCollectionIterator struct { i int - page LoggerCollectionPage + page NamedValueCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *NamedValueCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -5230,62 +6858,62 @@ func (iter *LoggerCollectionIterator) NextWithContext(ctx context.Context) (err // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *LoggerCollectionIterator) Next() error { +func (iter *NamedValueCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter LoggerCollectionIterator) NotDone() bool { +func (iter NamedValueCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter LoggerCollectionIterator) Response() LoggerCollection { +func (iter NamedValueCollectionIterator) Response() NamedValueCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter LoggerCollectionIterator) Value() LoggerContract { +func (iter NamedValueCollectionIterator) Value() NamedValueContract { if !iter.page.NotDone() { - return LoggerContract{} + return NamedValueContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the LoggerCollectionIterator type. -func NewLoggerCollectionIterator(page LoggerCollectionPage) LoggerCollectionIterator { - return LoggerCollectionIterator{page: page} +// Creates a new instance of the NamedValueCollectionIterator type. +func NewNamedValueCollectionIterator(page NamedValueCollectionPage) NamedValueCollectionIterator { + return NamedValueCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (lc LoggerCollection) IsEmpty() bool { - return lc.Value == nil || len(*lc.Value) == 0 +func (nvc NamedValueCollection) IsEmpty() bool { + return nvc.Value == nil || len(*nvc.Value) == 0 } -// loggerCollectionPreparer prepares a request to retrieve the next set of results. +// namedValueCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (lc LoggerCollection) loggerCollectionPreparer(ctx context.Context) (*http.Request, error) { - if lc.NextLink == nil || len(to.String(lc.NextLink)) < 1 { +func (nvc NamedValueCollection) namedValueCollectionPreparer(ctx context.Context) (*http.Request, error) { + if nvc.NextLink == nil || len(to.String(nvc.NextLink)) < 1 { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(lc.NextLink))) + autorest.WithBaseURL(to.String(nvc.NextLink))) } -// LoggerCollectionPage contains a page of LoggerContract values. -type LoggerCollectionPage struct { - fn func(context.Context, LoggerCollection) (LoggerCollection, error) - lc LoggerCollection +// NamedValueCollectionPage contains a page of NamedValueContract values. +type NamedValueCollectionPage struct { + fn func(context.Context, NamedValueCollection) (NamedValueCollection, error) + nvc NamedValueCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *NamedValueCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/LoggerCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -5294,49 +6922,133 @@ func (page *LoggerCollectionPage) NextWithContext(ctx context.Context) (err erro tracing.EndSpan(ctx, sc, err) }() } - next, err := page.fn(ctx, page.lc) + next, err := page.fn(ctx, page.nvc) if err != nil { return err } - page.lc = next + page.nvc = next return nil } // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *LoggerCollectionPage) Next() error { +func (page *NamedValueCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page LoggerCollectionPage) NotDone() bool { - return !page.lc.IsEmpty() +func (page NamedValueCollectionPage) NotDone() bool { + return !page.nvc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page LoggerCollectionPage) Response() LoggerCollection { - return page.lc +func (page NamedValueCollectionPage) Response() NamedValueCollection { + return page.nvc } // Values returns the slice of values for the current page or nil if there are no values. -func (page LoggerCollectionPage) Values() []LoggerContract { - if page.lc.IsEmpty() { +func (page NamedValueCollectionPage) Values() []NamedValueContract { + if page.nvc.IsEmpty() { return nil } - return *page.lc.Value + return *page.nvc.Value +} + +// Creates a new instance of the NamedValueCollectionPage type. +func NewNamedValueCollectionPage(getNextPage func(context.Context, NamedValueCollection) (NamedValueCollection, error)) NamedValueCollectionPage { + return NamedValueCollectionPage{fn: getNextPage} +} + +// NamedValueContract namedValue details. +type NamedValueContract struct { + autorest.Response `json:"-"` + // NamedValueContractProperties - NamedValue entity contract properties. + *NamedValueContractProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NamedValueContract. +func (nvc NamedValueContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nvc.NamedValueContractProperties != nil { + objectMap["properties"] = nvc.NamedValueContractProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for NamedValueContract struct. +func (nvc *NamedValueContract) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var namedValueContractProperties NamedValueContractProperties + err = json.Unmarshal(*v, &namedValueContractProperties) + if err != nil { + return err + } + nvc.NamedValueContractProperties = &namedValueContractProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + nvc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + nvc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + nvc.Type = &typeVar + } + } + } + + return nil } -// Creates a new instance of the LoggerCollectionPage type. -func NewLoggerCollectionPage(getNextPage func(context.Context, LoggerCollection) (LoggerCollection, error)) LoggerCollectionPage { - return LoggerCollectionPage{fn: getNextPage} +// NamedValueContractProperties namedValue Contract properties. +type NamedValueContractProperties struct { + // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + DisplayName *string `json:"displayName,omitempty"` + // Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + Value *string `json:"value,omitempty"` + // Tags - Optional tags that when provided can be used to filter the NamedValue list. + Tags *[]string `json:"tags,omitempty"` + // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. + Secret *bool `json:"secret,omitempty"` } -// LoggerContract logger details. -type LoggerContract struct { - autorest.Response `json:"-"` - // LoggerContractProperties - Logger entity contract properties. - *LoggerContractProperties `json:"properties,omitempty"` +// NamedValueCreateContract namedValue details. +type NamedValueCreateContract struct { + // NamedValueCreateContractProperties - NamedValue entity contract properties for PUT operation. + *NamedValueCreateContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -5345,17 +7057,17 @@ type LoggerContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for LoggerContract. -func (lc LoggerContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for NamedValueCreateContract. +func (nvcc NamedValueCreateContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if lc.LoggerContractProperties != nil { - objectMap["properties"] = lc.LoggerContractProperties + if nvcc.NamedValueCreateContractProperties != nil { + objectMap["properties"] = nvcc.NamedValueCreateContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for LoggerContract struct. -func (lc *LoggerContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for NamedValueCreateContract struct. +func (nvcc *NamedValueCreateContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5365,12 +7077,12 @@ func (lc *LoggerContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var loggerContractProperties LoggerContractProperties - err = json.Unmarshal(*v, &loggerContractProperties) + var namedValueCreateContractProperties NamedValueCreateContractProperties + err = json.Unmarshal(*v, &namedValueCreateContractProperties) if err != nil { return err } - lc.LoggerContractProperties = &loggerContractProperties + nvcc.NamedValueCreateContractProperties = &namedValueCreateContractProperties } case "id": if v != nil { @@ -5379,7 +7091,7 @@ func (lc *LoggerContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - lc.ID = &ID + nvcc.ID = &ID } case "name": if v != nil { @@ -5388,7 +7100,7 @@ func (lc *LoggerContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - lc.Name = &name + nvcc.Name = &name } case "type": if v != nil { @@ -5397,7 +7109,7 @@ func (lc *LoggerContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - lc.Type = &typeVar + nvcc.Type = &typeVar } } } @@ -5405,56 +7117,113 @@ func (lc *LoggerContract) UnmarshalJSON(body []byte) error { return nil } -// LoggerContractProperties the Logger entity in API Management represents an event sink that you can use -// to log API Management events. Currently the Logger entity supports logging API Management events to -// Azure Event Hubs. -type LoggerContractProperties struct { - // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' - LoggerType LoggerType `json:"loggerType,omitempty"` - // Description - Logger description. - Description *string `json:"description,omitempty"` - // Credentials - The name and SendRule connection string of the event hub for azureEventHub logger. - // Instrumentation key for applicationInsights logger. - Credentials map[string]*string `json:"credentials"` - // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. - IsBuffered *bool `json:"isBuffered,omitempty"` +// NamedValueCreateContractProperties namedValue Contract properties. +type NamedValueCreateContractProperties struct { + // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + DisplayName *string `json:"displayName,omitempty"` + // Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. + Value *string `json:"value,omitempty"` + // Tags - Optional tags that when provided can be used to filter the NamedValue list. + Tags *[]string `json:"tags,omitempty"` + // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. + Secret *bool `json:"secret,omitempty"` } -// MarshalJSON is the custom marshaler for LoggerContractProperties. -func (lcp LoggerContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lcp.LoggerType != "" { - objectMap["loggerType"] = lcp.LoggerType +// NamedValueCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type NamedValueCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NamedValueCreateOrUpdateFuture) Result(client NamedValueClient) (nvc NamedValueContract, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return } - if lcp.Description != nil { - objectMap["description"] = lcp.Description + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueCreateOrUpdateFuture") + return } - if lcp.Credentials != nil { - objectMap["credentials"] = lcp.Credentials + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent { + nvc, err = client.CreateOrUpdateResponder(nvc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueCreateOrUpdateFuture", "Result", nvc.Response.Response, "Failure responding to request") + } } - if lcp.IsBuffered != nil { - objectMap["isBuffered"] = lcp.IsBuffered + return +} + +// NamedValueEntityBaseParameters namedValue Entity Base Parameters set. +type NamedValueEntityBaseParameters struct { + // Tags - Optional tags that when provided can be used to filter the NamedValue list. + Tags *[]string `json:"tags,omitempty"` + // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. + Secret *bool `json:"secret,omitempty"` +} + +// NamedValueUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type NamedValueUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NamedValueUpdateFuture) Result(client NamedValueClient) (nvc NamedValueContract, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueUpdateFuture", "Result", future.Response(), "Polling failure") + return } - return json.Marshal(objectMap) + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.NamedValueUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nvc.Response.Response, err = future.GetResult(sender); err == nil && nvc.Response.Response.StatusCode != http.StatusNoContent { + nvc, err = client.UpdateResponder(nvc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueUpdateFuture", "Result", nvc.Response.Response, "Failure responding to request") + } + } + return } -// LoggerUpdateContract logger update contract. -type LoggerUpdateContract struct { - // LoggerUpdateParameters - Logger entity update contract properties. - *LoggerUpdateParameters `json:"properties,omitempty"` +// NamedValueUpdateParameterProperties namedValue Contract properties. +type NamedValueUpdateParameterProperties struct { + // DisplayName - Unique name of NamedValue. It may contain only letters, digits, period, dash, and underscore characters. + DisplayName *string `json:"displayName,omitempty"` + // Value - Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. + Value *string `json:"value,omitempty"` + // Tags - Optional tags that when provided can be used to filter the NamedValue list. + Tags *[]string `json:"tags,omitempty"` + // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. + Secret *bool `json:"secret,omitempty"` } -// MarshalJSON is the custom marshaler for LoggerUpdateContract. -func (luc LoggerUpdateContract) MarshalJSON() ([]byte, error) { +// NamedValueUpdateParameters namedValue update Parameters. +type NamedValueUpdateParameters struct { + // NamedValueUpdateParameterProperties - NamedValue entity Update contract properties. + *NamedValueUpdateParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for NamedValueUpdateParameters. +func (nvup NamedValueUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if luc.LoggerUpdateParameters != nil { - objectMap["properties"] = luc.LoggerUpdateParameters + if nvup.NamedValueUpdateParameterProperties != nil { + objectMap["properties"] = nvup.NamedValueUpdateParameterProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for LoggerUpdateContract struct. -func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for NamedValueUpdateParameters struct. +func (nvup *NamedValueUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -5464,12 +7233,12 @@ func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var loggerUpdateParameters LoggerUpdateParameters - err = json.Unmarshal(*v, &loggerUpdateParameters) + var namedValueUpdateParameterProperties NamedValueUpdateParameterProperties + err = json.Unmarshal(*v, &namedValueUpdateParameterProperties) if err != nil { return err } - luc.LoggerUpdateParameters = &loggerUpdateParameters + nvup.NamedValueUpdateParameterProperties = &namedValueUpdateParameterProperties } } } @@ -5477,36 +7246,6 @@ func (luc *LoggerUpdateContract) UnmarshalJSON(body []byte) error { return nil } -// LoggerUpdateParameters parameters supplied to the Update Logger operation. -type LoggerUpdateParameters struct { - // LoggerType - Logger type. Possible values include: 'AzureEventHub', 'ApplicationInsights' - LoggerType LoggerType `json:"loggerType,omitempty"` - // Description - Logger description. - Description *string `json:"description,omitempty"` - // Credentials - Logger credentials. - Credentials map[string]*string `json:"credentials"` - // IsBuffered - Whether records are buffered in the logger before publishing. Default is assumed to be true. - IsBuffered *bool `json:"isBuffered,omitempty"` -} - -// MarshalJSON is the custom marshaler for LoggerUpdateParameters. -func (lup LoggerUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lup.LoggerType != "" { - objectMap["loggerType"] = lup.LoggerType - } - if lup.Description != nil { - objectMap["description"] = lup.Description - } - if lup.Credentials != nil { - objectMap["credentials"] = lup.Credentials - } - if lup.IsBuffered != nil { - objectMap["isBuffered"] = lup.IsBuffered - } - return json.Marshal(objectMap) -} - // NetworkStatusContract network Status details. type NetworkStatusContract struct { autorest.Response `json:"-"` @@ -6599,126 +8338,34 @@ type ParameterContract struct { Type *string `json:"type,omitempty"` // DefaultValue - Default parameter value. DefaultValue *string `json:"defaultValue,omitempty"` - // Required - whether parameter is required or not. + // Required - Specifies whether parameter is required or not. Required *bool `json:"required,omitempty"` // Values - Parameter values. - Values *[]string `json:"values,omitempty"` -} - -// PolicyCollection the response of the list policy operation. -type PolicyCollection struct { - autorest.Response `json:"-"` - // Value - Policy Contract value. - Value *[]PolicyContract `json:"value,omitempty"` - // NextLink - Next page link if any. - NextLink *string `json:"nextLink,omitempty"` -} - -// PolicyContract policy Contract details. -type PolicyContract struct { - autorest.Response `json:"-"` - // PolicyContractProperties - Properties of the Policy. - *PolicyContractProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type for API Management resource. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for PolicyContract. -func (pc PolicyContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pc.PolicyContractProperties != nil { - objectMap["properties"] = pc.PolicyContractProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PolicyContract struct. -func (pc *PolicyContract) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return err - } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var policyContractProperties PolicyContractProperties - err = json.Unmarshal(*v, &policyContractProperties) - if err != nil { - return err - } - pc.PolicyContractProperties = &policyContractProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pc.Type = &typeVar - } - } - } - - return nil -} - -// PolicyContractProperties policy contract Properties. -type PolicyContractProperties struct { - // PolicyContent - Json escaped Xml Encoded contents of the Policy. - PolicyContent *string `json:"policyContent,omitempty"` - // ContentFormat - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink' - ContentFormat PolicyContentFormat `json:"contentFormat,omitempty"` + Values *[]string `json:"values,omitempty"` } -// PolicySnippetContract policy snippet. -type PolicySnippetContract struct { - // Name - READ-ONLY; Snippet name. - Name *string `json:"name,omitempty"` - // Content - READ-ONLY; Snippet content. - Content *string `json:"content,omitempty"` - // ToolTip - READ-ONLY; Snippet toolTip. - ToolTip *string `json:"toolTip,omitempty"` - // Scope - READ-ONLY; Binary OR value of the Snippet scope. - Scope *int32 `json:"scope,omitempty"` +// PipelineDiagnosticSettings diagnostic settings for incoming/outgoing HTTP messages to the Gateway. +type PipelineDiagnosticSettings struct { + // Request - Diagnostic settings for request. + Request *HTTPMessageDiagnostic `json:"request,omitempty"` + // Response - Diagnostic settings for response. + Response *HTTPMessageDiagnostic `json:"response,omitempty"` } -// PolicySnippetsCollection the response of the list policy snippets operation. -type PolicySnippetsCollection struct { +// PolicyCollection the response of the list policy operation. +type PolicyCollection struct { autorest.Response `json:"-"` - // Value - Policy snippet value. - Value *[]PolicySnippetContract `json:"value,omitempty"` + // Value - Policy Contract value. + Value *[]PolicyContract `json:"value,omitempty"` + // NextLink - Next page link if any. + NextLink *string `json:"nextLink,omitempty"` } -// PortalDelegationSettings delegation settings for a developer portal. -type PortalDelegationSettings struct { +// PolicyContract policy Contract details. +type PolicyContract struct { autorest.Response `json:"-"` - // PortalDelegationSettingsProperties - Delegation settings contract properties. - *PortalDelegationSettingsProperties `json:"properties,omitempty"` + // PolicyContractProperties - Properties of the Policy. + *PolicyContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -6727,17 +8374,17 @@ type PortalDelegationSettings struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for PortalDelegationSettings. -func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for PolicyContract. +func (pc PolicyContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pds.PortalDelegationSettingsProperties != nil { - objectMap["properties"] = pds.PortalDelegationSettingsProperties + if pc.PolicyContractProperties != nil { + objectMap["properties"] = pc.PolicyContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct. -func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for PolicyContract struct. +func (pc *PolicyContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -6747,12 +8394,12 @@ func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var portalDelegationSettingsProperties PortalDelegationSettingsProperties - err = json.Unmarshal(*v, &portalDelegationSettingsProperties) + var policyContractProperties PolicyContractProperties + err = json.Unmarshal(*v, &policyContractProperties) if err != nil { return err } - pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties + pc.PolicyContractProperties = &policyContractProperties } case "id": if v != nil { @@ -6761,7 +8408,7 @@ func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - pds.ID = &ID + pc.ID = &ID } case "name": if v != nil { @@ -6770,7 +8417,7 @@ func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - pds.Name = &name + pc.Name = &name } case "type": if v != nil { @@ -6779,7 +8426,7 @@ func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - pds.Type = &typeVar + pc.Type = &typeVar } } } @@ -6787,29 +8434,27 @@ func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { return nil } -// PortalDelegationSettingsProperties delegation settings contract properties. -type PortalDelegationSettingsProperties struct { - // URL - A delegation Url. - URL *string `json:"url,omitempty"` - // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. - ValidationKey *string `json:"validationKey,omitempty"` - // Subscriptions - Subscriptions delegation settings. - Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` - // UserRegistration - User registration delegation settings. - UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` +// PolicyContractProperties policy contract Properties. +type PolicyContractProperties struct { + // Value - Contents of the Policy as defined by the format. + Value *string `json:"value,omitempty"` + // Format - Format of the policyContent. Possible values include: 'XML', 'XMLLink', 'Rawxml', 'RawxmlLink' + Format PolicyContentFormat `json:"format,omitempty"` } -// PortalSigninSettingProperties sign-in settings contract properties. -type PortalSigninSettingProperties struct { - // Enabled - Redirect Anonymous users to the Sign-In page. - Enabled *bool `json:"enabled,omitempty"` +// PolicyDescriptionCollection descriptions of APIM policies. +type PolicyDescriptionCollection struct { + autorest.Response `json:"-"` + // Value - Descriptions of APIM policies. + Value *[]PolicyDescriptionContract `json:"value,omitempty"` + // Count - Total record count number. + Count *int64 `json:"count,omitempty"` } -// PortalSigninSettings sign-In settings for the Developer Portal. -type PortalSigninSettings struct { - autorest.Response `json:"-"` - // PortalSigninSettingProperties - Sign-in settings contract properties. - *PortalSigninSettingProperties `json:"properties,omitempty"` +// PolicyDescriptionContract policy description details. +type PolicyDescriptionContract struct { + // PolicyDescriptionContractProperties - Policy description contract properties. + *PolicyDescriptionContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -6818,17 +8463,17 @@ type PortalSigninSettings struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for PortalSigninSettings. -func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for PolicyDescriptionContract. +func (pdc PolicyDescriptionContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pss.PortalSigninSettingProperties != nil { - objectMap["properties"] = pss.PortalSigninSettingProperties + if pdc.PolicyDescriptionContractProperties != nil { + objectMap["properties"] = pdc.PolicyDescriptionContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct. -func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for PolicyDescriptionContract struct. +func (pdc *PolicyDescriptionContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -6838,12 +8483,12 @@ func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var portalSigninSettingProperties PortalSigninSettingProperties - err = json.Unmarshal(*v, &portalSigninSettingProperties) + var policyDescriptionContractProperties PolicyDescriptionContractProperties + err = json.Unmarshal(*v, &policyDescriptionContractProperties) if err != nil { return err } - pss.PortalSigninSettingProperties = &portalSigninSettingProperties + pdc.PolicyDescriptionContractProperties = &policyDescriptionContractProperties } case "id": if v != nil { @@ -6852,7 +8497,7 @@ func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - pss.ID = &ID + pdc.ID = &ID } case "name": if v != nil { @@ -6861,7 +8506,7 @@ func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - pss.Name = &name + pdc.Name = &name } case "type": if v != nil { @@ -6870,7 +8515,7 @@ func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { if err != nil { return err } - pss.Type = &typeVar + pdc.Type = &typeVar } } } @@ -6878,11 +8523,19 @@ func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { return nil } -// PortalSignupSettings sign-Up settings for a developer portal. -type PortalSignupSettings struct { +// PolicyDescriptionContractProperties policy description properties. +type PolicyDescriptionContractProperties struct { + // Description - READ-ONLY; Policy description. + Description *string `json:"description,omitempty"` + // Scope - READ-ONLY; Binary OR value of the Snippet scope. + Scope *int32 `json:"scope,omitempty"` +} + +// PortalDelegationSettings delegation settings for a developer portal. +type PortalDelegationSettings struct { autorest.Response `json:"-"` - // PortalSignupSettingsProperties - Sign-up settings contract properties. - *PortalSignupSettingsProperties `json:"properties,omitempty"` + // PortalDelegationSettingsProperties - Delegation settings contract properties. + *PortalDelegationSettingsProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -6891,17 +8544,17 @@ type PortalSignupSettings struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for PortalSignupSettings. -func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for PortalDelegationSettings. +func (pds PortalDelegationSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pss.PortalSignupSettingsProperties != nil { - objectMap["properties"] = pss.PortalSignupSettingsProperties + if pds.PortalDelegationSettingsProperties != nil { + objectMap["properties"] = pds.PortalDelegationSettingsProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct. -func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for PortalDelegationSettings struct. +func (pds *PortalDelegationSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -6911,205 +8564,76 @@ func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var portalSignupSettingsProperties PortalSignupSettingsProperties - err = json.Unmarshal(*v, &portalSignupSettingsProperties) - if err != nil { - return err - } - pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pss.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pss.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) + var portalDelegationSettingsProperties PortalDelegationSettingsProperties + err = json.Unmarshal(*v, &portalDelegationSettingsProperties) if err != nil { return err - } - pss.Type = &typeVar - } - } - } - - return nil -} - -// PortalSignupSettingsProperties sign-up settings contract properties. -type PortalSignupSettingsProperties struct { - // Enabled - Allow users to sign up on a developer portal. - Enabled *bool `json:"enabled,omitempty"` - // TermsOfService - Terms of service contract properties. - TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` -} - -// ProductCollection paged Products list representation. -type ProductCollection struct { - autorest.Response `json:"-"` - // Value - Page values. - Value *[]ProductContract `json:"value,omitempty"` - // NextLink - Next page link if any. - NextLink *string `json:"nextLink,omitempty"` -} - -// ProductCollectionIterator provides access to a complete listing of ProductContract values. -type ProductCollectionIterator struct { - i int - page ProductCollectionPage -} - -// NextWithContext advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil - } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err - } - iter.i = 0 - return nil -} - -// Next advances to the next value. If there was an error making -// the request the iterator does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (iter *ProductCollectionIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProductCollectionIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) -} - -// Response returns the raw server response from the last page request. -func (iter ProductCollectionIterator) Response() ProductCollection { - return iter.page.Response() -} - -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ProductCollectionIterator) Value() ProductContract { - if !iter.page.NotDone() { - return ProductContract{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProductCollectionIterator type. -func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { - return ProductCollectionIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (pc ProductCollection) IsEmpty() bool { - return pc.Value == nil || len(*pc.Value) == 0 -} - -// productCollectionPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { - if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(pc.NextLink))) -} - -// ProductCollectionPage contains a page of ProductContract values. -type ProductCollectionPage struct { - fn func(context.Context, ProductCollection) (ProductCollection, error) - pc ProductCollection -} - -// NextWithContext advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode + } + pds.PortalDelegationSettingsProperties = &portalDelegationSettingsProperties } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.pc) - if err != nil { - return err + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pds.Type = &typeVar + } + } } - page.pc = next - return nil -} - -// Next advances to the next page of values. If there was an error making -// the request the page does not advance and the error is returned. -// Deprecated: Use NextWithContext() instead. -func (page *ProductCollectionPage) Next() error { - return page.NextWithContext(context.Background()) -} -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProductCollectionPage) NotDone() bool { - return !page.pc.IsEmpty() + return nil } -// Response returns the raw server response from the last page request. -func (page ProductCollectionPage) Response() ProductCollection { - return page.pc +// PortalDelegationSettingsProperties delegation settings contract properties. +type PortalDelegationSettingsProperties struct { + // URL - A delegation Url. + URL *string `json:"url,omitempty"` + // ValidationKey - A base64-encoded validation key to validate, that a request is coming from Azure API Management. + ValidationKey *string `json:"validationKey,omitempty"` + // Subscriptions - Subscriptions delegation settings. + Subscriptions *SubscriptionsDelegationSettingsProperties `json:"subscriptions,omitempty"` + // UserRegistration - User registration delegation settings. + UserRegistration *RegistrationDelegationSettingsProperties `json:"userRegistration,omitempty"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProductCollectionPage) Values() []ProductContract { - if page.pc.IsEmpty() { - return nil - } - return *page.pc.Value +// PortalSettingValidationKeyContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. +type PortalSettingValidationKeyContract struct { + autorest.Response `json:"-"` + // ValidationKey - This is secret value of the validation key in portal settings. + ValidationKey *string `json:"validationKey,omitempty"` } -// Creates a new instance of the ProductCollectionPage type. -func NewProductCollectionPage(getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { - return ProductCollectionPage{fn: getNextPage} +// PortalSigninSettingProperties sign-in settings contract properties. +type PortalSigninSettingProperties struct { + // Enabled - Redirect Anonymous users to the Sign-In page. + Enabled *bool `json:"enabled,omitempty"` } -// ProductContract product details. -type ProductContract struct { +// PortalSigninSettings sign-In settings for the Developer Portal. +type PortalSigninSettings struct { autorest.Response `json:"-"` - // ProductContractProperties - Product entity contract properties. - *ProductContractProperties `json:"properties,omitempty"` + // PortalSigninSettingProperties - Sign-in settings contract properties. + *PortalSigninSettingProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -7118,17 +8642,17 @@ type ProductContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ProductContract. -func (pc ProductContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for PortalSigninSettings. +func (pss PortalSigninSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pc.ProductContractProperties != nil { - objectMap["properties"] = pc.ProductContractProperties + if pss.PortalSigninSettingProperties != nil { + objectMap["properties"] = pss.PortalSigninSettingProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ProductContract struct. -func (pc *ProductContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for PortalSigninSettings struct. +func (pss *PortalSigninSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -7138,12 +8662,12 @@ func (pc *ProductContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var productContractProperties ProductContractProperties - err = json.Unmarshal(*v, &productContractProperties) + var portalSigninSettingProperties PortalSigninSettingProperties + err = json.Unmarshal(*v, &portalSigninSettingProperties) if err != nil { return err } - pc.ProductContractProperties = &productContractProperties + pss.PortalSigninSettingProperties = &portalSigninSettingProperties } case "id": if v != nil { @@ -7152,7 +8676,7 @@ func (pc *ProductContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - pc.ID = &ID + pss.ID = &ID } case "name": if v != nil { @@ -7161,7 +8685,7 @@ func (pc *ProductContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - pc.Name = &name + pss.Name = &name } case "type": if v != nil { @@ -7170,7 +8694,7 @@ func (pc *ProductContract) UnmarshalJSON(body []byte) error { if err != nil { return err } - pc.Type = &typeVar + pss.Type = &typeVar } } } @@ -7178,77 +8702,30 @@ func (pc *ProductContract) UnmarshalJSON(body []byte) error { return nil } -// ProductContractProperties product profile. -type ProductContractProperties struct { - // DisplayName - Product name. - DisplayName *string `json:"displayName,omitempty"` - // Description - Product description. May include HTML formatting tags. - Description *string `json:"description,omitempty"` - // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. - Terms *string `json:"terms,omitempty"` - // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. - SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. - ApprovalRequired *bool `json:"approvalRequired,omitempty"` - // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. - SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` - // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' - State ProductState `json:"state,omitempty"` -} - -// ProductEntityBaseParameters product Entity Base Parameters -type ProductEntityBaseParameters struct { - // Description - Product description. May include HTML formatting tags. - Description *string `json:"description,omitempty"` - // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. - Terms *string `json:"terms,omitempty"` - // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. - SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. - ApprovalRequired *bool `json:"approvalRequired,omitempty"` - // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. - SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` - // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' - State ProductState `json:"state,omitempty"` -} - -// ProductTagResourceContractProperties product profile. -type ProductTagResourceContractProperties struct { - // ID - Identifier of the product in the form of /products/{productId} +// PortalSignupSettings sign-Up settings for a developer portal. +type PortalSignupSettings struct { + autorest.Response `json:"-"` + // PortalSignupSettingsProperties - Sign-up settings contract properties. + *PortalSignupSettingsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` - // Name - Product name. + // Name - READ-ONLY; Resource name. Name *string `json:"name,omitempty"` - // Description - Product description. May include HTML formatting tags. - Description *string `json:"description,omitempty"` - // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. - Terms *string `json:"terms,omitempty"` - // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. - SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. - ApprovalRequired *bool `json:"approvalRequired,omitempty"` - // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. - SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` - // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' - State ProductState `json:"state,omitempty"` -} - -// ProductUpdateParameters product Update parameters. -type ProductUpdateParameters struct { - // ProductUpdateProperties - Product entity Update contract properties. - *ProductUpdateProperties `json:"properties,omitempty"` + // Type - READ-ONLY; Resource type for API Management resource. + Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ProductUpdateParameters. -func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for PortalSignupSettings. +func (pss PortalSignupSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pup.ProductUpdateProperties != nil { - objectMap["properties"] = pup.ProductUpdateProperties + if pss.PortalSignupSettingsProperties != nil { + objectMap["properties"] = pss.PortalSignupSettingsProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct. -func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for PortalSignupSettings struct. +func (pss *PortalSignupSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -7258,12 +8735,39 @@ func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var productUpdateProperties ProductUpdateProperties - err = json.Unmarshal(*v, &productUpdateProperties) + var portalSignupSettingsProperties PortalSignupSettingsProperties + err = json.Unmarshal(*v, &portalSignupSettingsProperties) if err != nil { return err } - pup.ProductUpdateProperties = &productUpdateProperties + pss.PortalSignupSettingsProperties = &portalSignupSettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pss.Type = &typeVar } } } @@ -7271,44 +8775,34 @@ func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { return nil } -// ProductUpdateProperties parameters supplied to the Update Product operation. -type ProductUpdateProperties struct { - // DisplayName - Product name. - DisplayName *string `json:"displayName,omitempty"` - // Description - Product description. May include HTML formatting tags. - Description *string `json:"description,omitempty"` - // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. - Terms *string `json:"terms,omitempty"` - // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. - SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` - // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. - ApprovalRequired *bool `json:"approvalRequired,omitempty"` - // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. - SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` - // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' - State ProductState `json:"state,omitempty"` +// PortalSignupSettingsProperties sign-up settings contract properties. +type PortalSignupSettingsProperties struct { + // Enabled - Allow users to sign up on a developer portal. + Enabled *bool `json:"enabled,omitempty"` + // TermsOfService - Terms of service contract properties. + TermsOfService *TermsOfServiceProperties `json:"termsOfService,omitempty"` } -// PropertyCollection paged Property list representation. -type PropertyCollection struct { +// ProductCollection paged Products list representation. +type ProductCollection struct { autorest.Response `json:"-"` // Value - Page values. - Value *[]PropertyContract `json:"value,omitempty"` + Value *[]ProductContract `json:"value,omitempty"` // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } -// PropertyCollectionIterator provides access to a complete listing of PropertyContract values. -type PropertyCollectionIterator struct { +// ProductCollectionIterator provides access to a complete listing of ProductContract values. +type ProductCollectionIterator struct { i int - page PropertyCollectionPage + page ProductCollectionPage } // NextWithContext advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. -func (iter *PropertyCollectionIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ProductCollectionIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -7333,42 +8827,42 @@ func (iter *PropertyCollectionIterator) NextWithContext(ctx context.Context) (er // Next advances to the next value. If there was an error making // the request the iterator does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (iter *PropertyCollectionIterator) Next() error { +func (iter *ProductCollectionIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter PropertyCollectionIterator) NotDone() bool { +func (iter ProductCollectionIterator) NotDone() bool { return iter.page.NotDone() && iter.i < len(iter.page.Values()) } // Response returns the raw server response from the last page request. -func (iter PropertyCollectionIterator) Response() PropertyCollection { +func (iter ProductCollectionIterator) Response() ProductCollection { return iter.page.Response() } // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter PropertyCollectionIterator) Value() PropertyContract { +func (iter ProductCollectionIterator) Value() ProductContract { if !iter.page.NotDone() { - return PropertyContract{} + return ProductContract{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the PropertyCollectionIterator type. -func NewPropertyCollectionIterator(page PropertyCollectionPage) PropertyCollectionIterator { - return PropertyCollectionIterator{page: page} +// Creates a new instance of the ProductCollectionIterator type. +func NewProductCollectionIterator(page ProductCollectionPage) ProductCollectionIterator { + return ProductCollectionIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (pc PropertyCollection) IsEmpty() bool { +func (pc ProductCollection) IsEmpty() bool { return pc.Value == nil || len(*pc.Value) == 0 } -// propertyCollectionPreparer prepares a request to retrieve the next set of results. +// productCollectionPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (pc PropertyCollection) propertyCollectionPreparer(ctx context.Context) (*http.Request, error) { +func (pc ProductCollection) productCollectionPreparer(ctx context.Context) (*http.Request, error) { if pc.NextLink == nil || len(to.String(pc.NextLink)) < 1 { return nil, nil } @@ -7378,17 +8872,17 @@ func (pc PropertyCollection) propertyCollectionPreparer(ctx context.Context) (*h autorest.WithBaseURL(to.String(pc.NextLink))) } -// PropertyCollectionPage contains a page of PropertyContract values. -type PropertyCollectionPage struct { - fn func(context.Context, PropertyCollection) (PropertyCollection, error) - pc PropertyCollection +// ProductCollectionPage contains a page of ProductContract values. +type ProductCollectionPage struct { + fn func(context.Context, ProductCollection) (ProductCollection, error) + pc ProductCollection } // NextWithContext advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. -func (page *PropertyCollectionPage) NextWithContext(ctx context.Context) (err error) { +func (page *ProductCollectionPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PropertyCollectionPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProductCollectionPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -7408,38 +8902,38 @@ func (page *PropertyCollectionPage) NextWithContext(ctx context.Context) (err er // Next advances to the next page of values. If there was an error making // the request the page does not advance and the error is returned. // Deprecated: Use NextWithContext() instead. -func (page *PropertyCollectionPage) Next() error { +func (page *ProductCollectionPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page PropertyCollectionPage) NotDone() bool { +func (page ProductCollectionPage) NotDone() bool { return !page.pc.IsEmpty() } // Response returns the raw server response from the last page request. -func (page PropertyCollectionPage) Response() PropertyCollection { +func (page ProductCollectionPage) Response() ProductCollection { return page.pc } // Values returns the slice of values for the current page or nil if there are no values. -func (page PropertyCollectionPage) Values() []PropertyContract { +func (page ProductCollectionPage) Values() []ProductContract { if page.pc.IsEmpty() { return nil } return *page.pc.Value } -// Creates a new instance of the PropertyCollectionPage type. -func NewPropertyCollectionPage(getNextPage func(context.Context, PropertyCollection) (PropertyCollection, error)) PropertyCollectionPage { - return PropertyCollectionPage{fn: getNextPage} +// Creates a new instance of the ProductCollectionPage type. +func NewProductCollectionPage(getNextPage func(context.Context, ProductCollection) (ProductCollection, error)) ProductCollectionPage { + return ProductCollectionPage{fn: getNextPage} } -// PropertyContract property details. -type PropertyContract struct { +// ProductContract product details. +type ProductContract struct { autorest.Response `json:"-"` - // PropertyContractProperties - Property entity contract properties. - *PropertyContractProperties `json:"properties,omitempty"` + // ProductContractProperties - Product entity contract properties. + *ProductContractProperties `json:"properties,omitempty"` // ID - READ-ONLY; Resource ID. ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name. @@ -7448,17 +8942,17 @@ type PropertyContract struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for PropertyContract. -func (pc PropertyContract) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ProductContract. +func (pc ProductContract) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pc.PropertyContractProperties != nil { - objectMap["properties"] = pc.PropertyContractProperties + if pc.ProductContractProperties != nil { + objectMap["properties"] = pc.ProductContractProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for PropertyContract struct. -func (pc *PropertyContract) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ProductContract struct. +func (pc *ProductContract) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -7468,12 +8962,12 @@ func (pc *PropertyContract) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var propertyContractProperties PropertyContractProperties - err = json.Unmarshal(*v, &propertyContractProperties) + var productContractProperties ProductContractProperties + err = json.Unmarshal(*v, &productContractProperties) if err != nil { return err } - pc.PropertyContractProperties = &propertyContractProperties + pc.ProductContractProperties = &productContractProperties } case "id": if v != nil { @@ -7508,55 +9002,77 @@ func (pc *PropertyContract) UnmarshalJSON(body []byte) error { return nil } -// PropertyContractProperties property Contract properties. -type PropertyContractProperties struct { - // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. +// ProductContractProperties product profile. +type ProductContractProperties struct { + // DisplayName - Product name. DisplayName *string `json:"displayName,omitempty"` - // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. - Value *string `json:"value,omitempty"` - // Tags - Optional tags that when provided can be used to filter the property list. - Tags *[]string `json:"tags,omitempty"` - // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. - Secret *bool `json:"secret,omitempty"` + // Description - Product description. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. + Terms *string `json:"terms,omitempty"` + // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` + // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. + ApprovalRequired *bool `json:"approvalRequired,omitempty"` + // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` + // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' + State ProductState `json:"state,omitempty"` } -// PropertyEntityBaseParameters property Entity Base Parameters set. -type PropertyEntityBaseParameters struct { - // Tags - Optional tags that when provided can be used to filter the property list. - Tags *[]string `json:"tags,omitempty"` - // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. - Secret *bool `json:"secret,omitempty"` +// ProductEntityBaseParameters product Entity Base Parameters +type ProductEntityBaseParameters struct { + // Description - Product description. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. + Terms *string `json:"terms,omitempty"` + // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` + // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. + ApprovalRequired *bool `json:"approvalRequired,omitempty"` + // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` + // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' + State ProductState `json:"state,omitempty"` } -// PropertyUpdateParameterProperties property Contract properties. -type PropertyUpdateParameterProperties struct { - // DisplayName - Unique name of Property. It may contain only letters, digits, period, dash, and underscore characters. - DisplayName *string `json:"displayName,omitempty"` - // Value - Value of the property. Can contain policy expressions. It may not be empty or consist only of whitespace. - Value *string `json:"value,omitempty"` - // Tags - Optional tags that when provided can be used to filter the property list. - Tags *[]string `json:"tags,omitempty"` - // Secret - Determines whether the value is a secret and should be encrypted or not. Default value is false. - Secret *bool `json:"secret,omitempty"` +// ProductTagResourceContractProperties product profile. +type ProductTagResourceContractProperties struct { + // ID - Identifier of the product in the form of /products/{productId} + ID *string `json:"id,omitempty"` + // Name - Product name. + Name *string `json:"name,omitempty"` + // Description - Product description. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. + Terms *string `json:"terms,omitempty"` + // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` + // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. + ApprovalRequired *bool `json:"approvalRequired,omitempty"` + // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` + // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' + State ProductState `json:"state,omitempty"` } -// PropertyUpdateParameters property update Parameters. -type PropertyUpdateParameters struct { - // PropertyUpdateParameterProperties - Property entity Update contract properties. - *PropertyUpdateParameterProperties `json:"properties,omitempty"` +// ProductUpdateParameters product Update parameters. +type ProductUpdateParameters struct { + // ProductUpdateProperties - Product entity Update contract properties. + *ProductUpdateProperties `json:"properties,omitempty"` } -// MarshalJSON is the custom marshaler for PropertyUpdateParameters. -func (pup PropertyUpdateParameters) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ProductUpdateParameters. +func (pup ProductUpdateParameters) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if pup.PropertyUpdateParameterProperties != nil { - objectMap["properties"] = pup.PropertyUpdateParameterProperties + if pup.ProductUpdateProperties != nil { + objectMap["properties"] = pup.ProductUpdateProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for PropertyUpdateParameters struct. -func (pup *PropertyUpdateParameters) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ProductUpdateParameters struct. +func (pup *ProductUpdateParameters) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -7566,12 +9082,12 @@ func (pup *PropertyUpdateParameters) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var propertyUpdateParameterProperties PropertyUpdateParameterProperties - err = json.Unmarshal(*v, &propertyUpdateParameterProperties) + var productUpdateProperties ProductUpdateProperties + err = json.Unmarshal(*v, &productUpdateProperties) if err != nil { return err } - pup.PropertyUpdateParameterProperties = &propertyUpdateParameterProperties + pup.ProductUpdateProperties = &productUpdateProperties } } } @@ -7579,6 +9095,31 @@ func (pup *PropertyUpdateParameters) UnmarshalJSON(body []byte) error { return nil } +// ProductUpdateProperties parameters supplied to the Update Product operation. +type ProductUpdateProperties struct { + // DisplayName - Product name. + DisplayName *string `json:"displayName,omitempty"` + // Description - Product description. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + // Terms - Product terms of use. Developers trying to subscribe to the product will be presented and required to accept these terms before they can complete the subscription process. + Terms *string `json:"terms,omitempty"` + // SubscriptionRequired - Whether a product subscription is required for accessing APIs included in this product. If true, the product is referred to as "protected" and a valid subscription key is required for a request to an API included in the product to succeed. If false, the product is referred to as "open" and requests to an API included in the product can be made without a subscription key. If property is omitted when creating a new product it's value is assumed to be true. + SubscriptionRequired *bool `json:"subscriptionRequired,omitempty"` + // ApprovalRequired - whether subscription approval is required. If false, new subscriptions will be approved automatically enabling developers to call the product’s APIs immediately after subscribing. If true, administrators must manually approve the subscription before the developer can any of the product’s APIs. Can be present only if subscriptionRequired property is present and has a value of false. + ApprovalRequired *bool `json:"approvalRequired,omitempty"` + // SubscriptionsLimit - Whether the number of subscriptions a user can have to this product at the same time. Set to null or omit to allow unlimited per user subscriptions. Can be present only if subscriptionRequired property is present and has a value of false. + SubscriptionsLimit *int32 `json:"subscriptionsLimit,omitempty"` + // State - whether product is published or not. Published products are discoverable by users of developer portal. Non published products are visible only to administrators. Default state of Product is notPublished. Possible values include: 'NotPublished', 'Published' + State ProductState `json:"state,omitempty"` +} + +// PropertyValueContract client or app secret used in IdentityProviders, Aad, OpenID or OAuth. +type PropertyValueContract struct { + autorest.Response `json:"-"` + // Value - This is secret value of the NamedValue entity. + Value *string `json:"value,omitempty"` +} + // QuotaCounterCollection paged Quota Counter list representation. type QuotaCounterCollection struct { autorest.Response `json:"-"` @@ -8289,9 +9830,21 @@ type Resource struct { Type *string `json:"type,omitempty"` } +// ResourceLocationDataContract resource location data properties. +type ResourceLocationDataContract struct { + // Name - A canonical name for the geographic or physical location. + Name *string `json:"name,omitempty"` + // City - The city or locality where the resource is located. + City *string `json:"city,omitempty"` + // District - The district, state, or province where the resource is located. + District *string `json:"district,omitempty"` + // CountryOrRegion - The country or region where the resource is located. + CountryOrRegion *string `json:"countryOrRegion,omitempty"` +} + // ResourceSku describes an available API Management SKU. type ResourceSku struct { - // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic' + // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' Name SkuType `json:"name,omitempty"` } @@ -8303,7 +9856,7 @@ type ResourceSkuCapacity struct { Maximum *int32 `json:"maximum,omitempty"` // Default - READ-ONLY; The default capacity. Default *int32 `json:"default,omitempty"` - // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'Automatic', 'Manual', 'None' + // ScaleType - READ-ONLY; The scale type applicable to the sku. Possible values include: 'ResourceSkuCapacityScaleTypeAutomatic', 'ResourceSkuCapacityScaleTypeManual', 'ResourceSkuCapacityScaleTypeNone' ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` } @@ -8475,8 +10028,55 @@ type ResponseContract struct { Headers *[]ParameterContract `json:"headers,omitempty"` } -// SaveConfigurationParameter parameters supplied to the Save Tenant Configuration operation. +// SamplingSettings sampling settings for Diagnostic. +type SamplingSettings struct { + // SamplingType - Sampling type. Possible values include: 'Fixed' + SamplingType SamplingType `json:"samplingType,omitempty"` + // Percentage - Rate of sampling for fixed-rate sampling. + Percentage *float64 `json:"percentage,omitempty"` +} + +// SaveConfigurationParameter save Tenant Configuration Contract details. type SaveConfigurationParameter struct { + // SaveConfigurationParameterProperties - Properties of the Save Configuration Parameters. + *SaveConfigurationParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SaveConfigurationParameter. +func (scp SaveConfigurationParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scp.SaveConfigurationParameterProperties != nil { + objectMap["properties"] = scp.SaveConfigurationParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SaveConfigurationParameter struct. +func (scp *SaveConfigurationParameter) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var saveConfigurationParameterProperties SaveConfigurationParameterProperties + err = json.Unmarshal(*v, &saveConfigurationParameterProperties) + if err != nil { + return err + } + scp.SaveConfigurationParameterProperties = &saveConfigurationParameterProperties + } + } + } + + return nil +} + +// SaveConfigurationParameterProperties parameters supplied to the Save Tenant Configuration operation. +type SaveConfigurationParameterProperties struct { // Branch - The name of the Git branch in which to commit the current configuration snapshot. Branch *string `json:"branch,omitempty"` // Force - The value if true, the current configuration database is committed to the Git repository, even if the Git repository has newer changes that would be overwritten. @@ -8702,11 +10302,11 @@ func (sc *SchemaContract) UnmarshalJSON(body []byte) error { return nil } -// SchemaContractProperties schema contract Properties. +// SchemaContractProperties API Schema create or update contract Properties. type SchemaContractProperties struct { - // ContentType - Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml). + // ContentType - Must be a valid a media type used in a Content-Type header as defined in the RFC 2616. Media type of the schema document (e.g. application/json, application/xml).
- `Swagger` Schema use `application/vnd.ms-azure-apim.swagger.definitions+json`
- `WSDL` Schema use `application/vnd.ms-azure-apim.xsd+xml`
- `OpenApi` Schema use `application/vnd.oai.openapi.components+json`
- `WADL Schema` use `application/vnd.ms-azure-apim.wadl.grammars+xml`. ContentType *string `json:"contentType,omitempty"` - // SchemaDocumentProperties - Properties of the Schema Document. + // SchemaDocumentProperties - Create or update Properties of the Schema Document. *SchemaDocumentProperties `json:"document,omitempty"` } @@ -8757,8 +10357,10 @@ func (scp *SchemaContractProperties) UnmarshalJSON(body []byte) error { // SchemaDocumentProperties schema Document Properties. type SchemaDocumentProperties struct { - // Value - Json escaped string defining the document representing the Schema. + // Value - Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. Value *string `json:"value,omitempty"` + // Definitions - Types definitions. Used for Swagger/OpenAPI schemas only, null otherwise. + Definitions interface{} `json:"definitions,omitempty"` } // ServiceApplyNetworkConfigurationParameters parameter supplied to the Apply Network configuration @@ -8859,6 +10461,8 @@ type ServiceBaseProperties struct { ManagementAPIURL *string `json:"managementApiUrl,omitempty"` // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. ScmURL *string `json:"scmUrl,omitempty"` + // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` // HostnameConfigurations - Custom hostname configuration of the API Management service. HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. @@ -8869,12 +10473,18 @@ type ServiceBaseProperties struct { VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` // AdditionalLocations - Additional datacenter locations of the API Management service. AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` - // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. + // CustomProperties - Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure CloudService internal components: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 CustomProperties map[string]*string `json:"customProperties"` // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` + // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` + // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. + DisableGateway *bool `json:"disableGateway,omitempty"` // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` + // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. + APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` } // MarshalJSON is the custom marshaler for ServiceBaseProperties. @@ -8898,9 +10508,18 @@ func (sbp ServiceBaseProperties) MarshalJSON() ([]byte, error) { if sbp.Certificates != nil { objectMap["certificates"] = sbp.Certificates } + if sbp.EnableClientCertificate != nil { + objectMap["enableClientCertificate"] = sbp.EnableClientCertificate + } + if sbp.DisableGateway != nil { + objectMap["disableGateway"] = sbp.DisableGateway + } if sbp.VirtualNetworkType != "" { objectMap["virtualNetworkType"] = sbp.VirtualNetworkType } + if sbp.APIVersionConstraint != nil { + objectMap["apiVersionConstraint"] = sbp.APIVersionConstraint + } return json.Marshal(objectMap) } @@ -8939,6 +10558,35 @@ func (future *ServiceCreateOrUpdateFuture) Result(client ServiceClient) (sr Serv return } +// ServiceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServiceDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ServiceDeleteFuture) Result(client ServiceClient) (sr ServiceResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { + sr, err = client.DeleteResponder(sr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ServiceDeleteFuture", "Result", sr.Response.Response, "Failure responding to request") + } + } + return +} + // ServiceGetSsoTokenResult the response of the GetSsoToken operation. type ServiceGetSsoTokenResult struct { autorest.Response `json:"-"` @@ -8948,12 +10596,29 @@ type ServiceGetSsoTokenResult struct { // ServiceIdentity identity properties of the Api Management service resource. type ServiceIdentity struct { - // Type - The identity type. Currently the only supported type is 'SystemAssigned'. - Type *string `json:"type,omitempty"` + // Type - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned', 'None' + Type ApimIdentityType `json:"type,omitempty"` // PrincipalID - READ-ONLY; The principal id of the identity. PrincipalID *uuid.UUID `json:"principalId,omitempty"` // TenantID - READ-ONLY; The client tenant id of the identity. TenantID *uuid.UUID `json:"tenantId,omitempty"` + // UserAssignedIdentities - The list of user identities associated with the resource. The user identity + // dictionary key references will be ARM resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + // providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*UserIdentityProperties `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for ServiceIdentity. +func (si ServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if si.Type != "" { + objectMap["type"] = si.Type + } + if si.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = si.UserAssignedIdentities + } + return json.Marshal(objectMap) } // ServiceListResult the response of the List API Management services operation. @@ -9137,6 +10802,8 @@ type ServiceProperties struct { ManagementAPIURL *string `json:"managementApiUrl,omitempty"` // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. ScmURL *string `json:"scmUrl,omitempty"` + // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` // HostnameConfigurations - Custom hostname configuration of the API Management service. HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. @@ -9147,12 +10814,18 @@ type ServiceProperties struct { VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` // AdditionalLocations - Additional datacenter locations of the API Management service. AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` - // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. + // CustomProperties - Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure CloudService internal components: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 CustomProperties map[string]*string `json:"customProperties"` // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` + // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` + // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. + DisableGateway *bool `json:"disableGateway,omitempty"` // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` + // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. + APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` } // MarshalJSON is the custom marshaler for ServiceProperties. @@ -9182,9 +10855,18 @@ func (sp ServiceProperties) MarshalJSON() ([]byte, error) { if sp.Certificates != nil { objectMap["certificates"] = sp.Certificates } + if sp.EnableClientCertificate != nil { + objectMap["enableClientCertificate"] = sp.EnableClientCertificate + } + if sp.DisableGateway != nil { + objectMap["disableGateway"] = sp.DisableGateway + } if sp.VirtualNetworkType != "" { objectMap["virtualNetworkType"] = sp.VirtualNetworkType } + if sp.APIVersionConstraint != nil { + objectMap["apiVersionConstraint"] = sp.APIVersionConstraint + } return json.Marshal(objectMap) } @@ -9359,9 +11041,9 @@ func (future *ServiceRestoreFuture) Result(client ServiceClient) (sr ServiceReso // ServiceSkuProperties API Management service resource SKU properties. type ServiceSkuProperties struct { - // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic' + // Name - Name of the Sku. Possible values include: 'SkuTypeDeveloper', 'SkuTypeStandard', 'SkuTypePremium', 'SkuTypeBasic', 'SkuTypeConsumption' Name SkuType `json:"name,omitempty"` - // Capacity - Capacity of the SKU (number of deployed units of the SKU). The default value is 1. + // Capacity - Capacity of the SKU (number of deployed units of the SKU). For Consumption SKU capacity must be specified as 0. Capacity *int32 `json:"capacity,omitempty"` } @@ -9394,43 +11076,6 @@ func (future *ServiceUpdateFuture) Result(client ServiceClient) (sr ServiceResou return } -// ServiceUpdateHostnameFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type ServiceUpdateHostnameFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *ServiceUpdateHostnameFuture) Result(client ServiceClient) (sr ServiceResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("apimanagement.ServiceUpdateHostnameFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if sr.Response.Response, err = future.GetResult(sender); err == nil && sr.Response.Response.StatusCode != http.StatusNoContent { - sr, err = client.UpdateHostnameResponder(sr.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceUpdateHostnameFuture", "Result", sr.Response.Response, "Failure responding to request") - } - } - return -} - -// ServiceUpdateHostnameParameters parameters supplied to the UpdateHostname operation. -type ServiceUpdateHostnameParameters struct { - // Update - Hostnames to create or update. - Update *[]HostnameConfigurationOld `json:"update,omitempty"` - // Delete - Hostnames types to delete. - Delete *[]HostnameType `json:"delete,omitempty"` -} - // ServiceUpdateParameters parameter supplied to Update Api Management Service. type ServiceUpdateParameters struct { // ServiceUpdateProperties - Properties of the API Management service. @@ -9580,6 +11225,8 @@ type ServiceUpdateProperties struct { ManagementAPIURL *string `json:"managementApiUrl,omitempty"` // ScmURL - READ-ONLY; SCM endpoint URL of the API Management service. ScmURL *string `json:"scmUrl,omitempty"` + // DeveloperPortalURL - READ-ONLY; DEveloper Portal endpoint URL of the API Management service. + DeveloperPortalURL *string `json:"developerPortalUrl,omitempty"` // HostnameConfigurations - Custom hostname configuration of the API Management service. HostnameConfigurations *[]HostnameConfiguration `json:"hostnameConfigurations,omitempty"` // PublicIPAddresses - READ-ONLY; Public Static Load Balanced IP addresses of the API Management service in Primary region. Available only for Basic, Standard and Premium SKU. @@ -9590,12 +11237,18 @@ type ServiceUpdateProperties struct { VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"` // AdditionalLocations - Additional datacenter locations of the API Management service. AdditionalLocations *[]AdditionalLocation `json:"additionalLocations,omitempty"` - // CustomProperties - Custom properties of the API Management service. Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2). Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1 and setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service. + // CustomProperties - Custom properties of the API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TripleDes168` will disable the cipher TLS_RSA_WITH_3DES_EDE_CBC_SHA for all TLS(1.0, 1.1 and 1.2).
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls11` can be used to disable just TLS 1.1.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10` can be used to disable TLS 1.0 on an API Management service.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls11` can be used to disable just TLS 1.1 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Backend.Protocols.Tls10` can be used to disable TLS 1.0 for communications with backends.
Setting `Microsoft.WindowsAzure.ApiManagement.Gateway.Protocols.Server.Http2` can be used to enable HTTP2 protocol on an API Management service.
Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For all the settings except Http2 the default value is `True` if the service was created on or before April 1st 2018 and `False` otherwise. Http2 setting's default value is `False`.

You can disable any of next ciphers by using settings `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]`: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA. For example, `Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256`:`false`. The default value is `true` for them. Note: next ciphers can't be disabled since they are required by Azure CloudService internal components: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,TLS_RSA_WITH_AES_256_GCM_SHA384 CustomProperties map[string]*string `json:"customProperties"` // Certificates - List of Certificates that need to be installed in the API Management service. Max supported certificates that can be installed is 10. Certificates *[]CertificateConfiguration `json:"certificates,omitempty"` + // EnableClientCertificate - Property only meant to be used for Consumption SKU Service. This enforces a client certificate to be presented on each request to the gateway. This also enables the ability to authenticate the certificate in the policy on the gateway. + EnableClientCertificate *bool `json:"enableClientCertificate,omitempty"` + // DisableGateway - Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway in master region. + DisableGateway *bool `json:"disableGateway,omitempty"` // VirtualNetworkType - The type of VPN in which API Management service needs to be configured in. None (Default Value) means the API Management service is not part of any Virtual Network, External means the API Management deployment is set up inside a Virtual Network having an Internet Facing Endpoint, and Internal means that API Management deployment is setup inside a Virtual Network having an Intranet Facing Endpoint only. Possible values include: 'VirtualNetworkTypeNone', 'VirtualNetworkTypeExternal', 'VirtualNetworkTypeInternal' VirtualNetworkType VirtualNetworkType `json:"virtualNetworkType,omitempty"` + // APIVersionConstraint - Control Plane Apis version constraint for the API Management service. + APIVersionConstraint *APIVersionConstraint `json:"apiVersionConstraint,omitempty"` } // MarshalJSON is the custom marshaler for ServiceUpdateProperties. @@ -9625,23 +11278,21 @@ func (sup ServiceUpdateProperties) MarshalJSON() ([]byte, error) { if sup.Certificates != nil { objectMap["certificates"] = sup.Certificates } + if sup.EnableClientCertificate != nil { + objectMap["enableClientCertificate"] = sup.EnableClientCertificate + } + if sup.DisableGateway != nil { + objectMap["disableGateway"] = sup.DisableGateway + } if sup.VirtualNetworkType != "" { objectMap["virtualNetworkType"] = sup.VirtualNetworkType } + if sup.APIVersionConstraint != nil { + objectMap["apiVersionConstraint"] = sup.APIVersionConstraint + } return json.Marshal(objectMap) } -// ServiceUploadCertificateParameters parameters supplied to the Upload SSL certificate for an API -// Management service operation. -type ServiceUploadCertificateParameters struct { - // Type - Hostname type. Possible values include: 'Proxy', 'Portal', 'Management', 'Scm' - Type HostnameType `json:"type,omitempty"` - // Certificate - Base64 Encoded certificate. - Certificate *string `json:"certificate,omitempty"` - // CertificatePassword - Certificate password. - CertificatePassword *string `json:"certificate_password,omitempty"` -} - // SubscriptionCollection paged Subscriptions list representation. type SubscriptionCollection struct { autorest.Response `json:"-"` @@ -9863,10 +11514,10 @@ func (sc *SubscriptionContract) UnmarshalJSON(body []byte) error { // SubscriptionContractProperties subscription details. type SubscriptionContractProperties struct { - // UserID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{uid} where {uid} is a user identifier. - UserID *string `json:"userId,omitempty"` - // ProductID - The product resource identifier of the subscribed product. The value is a valid relative URL in the format of /products/{productId} where {productId} is a product identifier. - ProductID *string `json:"productId,omitempty"` + // OwnerID - The user resource identifier of the subscription owner. The value is a valid relative URL in the format of /users/{userId} where {userId} is a user identifier. + OwnerID *string `json:"ownerId,omitempty"` + // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. + Scope *string `json:"scope,omitempty"` // DisplayName - The name of the subscription, or null if the subscription has no name. DisplayName *string `json:"displayName,omitempty"` // State - Subscription state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled' @@ -9881,20 +11532,22 @@ type SubscriptionContractProperties struct { EndDate *date.Time `json:"endDate,omitempty"` // NotificationDate - Upcoming subscription expiration notification date. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. NotificationDate *date.Time `json:"notificationDate,omitempty"` - // PrimaryKey - Subscription primary key. + // PrimaryKey - Subscription primary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. PrimaryKey *string `json:"primaryKey,omitempty"` - // SecondaryKey - Subscription secondary key. + // SecondaryKey - Subscription secondary key. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. SecondaryKey *string `json:"secondaryKey,omitempty"` // StateComment - Optional subscription comment added by an administrator. StateComment *string `json:"stateComment,omitempty"` + // AllowTracing - Determines whether tracing is enabled + AllowTracing *bool `json:"allowTracing,omitempty"` } // SubscriptionCreateParameterProperties parameters supplied to the Create subscription operation. type SubscriptionCreateParameterProperties struct { - // UserID - User (user id path) for whom subscription is being created in form /users/{uid} - UserID *string `json:"userId,omitempty"` - // ProductID - Product (product id path) for which subscription is being created in form /products/{productId} - ProductID *string `json:"productId,omitempty"` + // OwnerID - User (user id path) for whom subscription is being created in form /users/{userId} + OwnerID *string `json:"ownerId,omitempty"` + // Scope - Scope like /products/{productId} or /apis or /apis/{apiId}. + Scope *string `json:"scope,omitempty"` // DisplayName - Subscription name. DisplayName *string `json:"displayName,omitempty"` // PrimaryKey - Primary subscription key. If not specified during request key will be generated automatically. @@ -9903,6 +11556,8 @@ type SubscriptionCreateParameterProperties struct { SecondaryKey *string `json:"secondaryKey,omitempty"` // State - Initial subscription state. If no value is specified, subscription is created with Submitted state. Possible states are * active – the subscription is active, * suspended – the subscription is blocked, and the subscriber cannot call any APIs of the product, * submitted – the subscription request has been made by the developer, but has not yet been approved or rejected, * rejected – the subscription request has been denied by an administrator, * cancelled – the subscription has been cancelled by the developer or administrator, * expired – the subscription reached its expiration date and was deactivated. Possible values include: 'Suspended', 'Active', 'Expired', 'Submitted', 'Rejected', 'Cancelled' State SubscriptionState `json:"state,omitempty"` + // AllowTracing - Determines whether tracing can be enabled + AllowTracing *bool `json:"allowTracing,omitempty"` } // SubscriptionCreateParameters subscription create details. @@ -9952,6 +11607,15 @@ type SubscriptionKeyParameterNamesContract struct { Query *string `json:"query,omitempty"` } +// SubscriptionKeysContract subscription keys. +type SubscriptionKeysContract struct { + autorest.Response `json:"-"` + // PrimaryKey - Subscription primary key. + PrimaryKey *string `json:"primaryKey,omitempty"` + // SecondaryKey - Subscription secondary key. + SecondaryKey *string `json:"secondaryKey,omitempty"` +} + // SubscriptionsDelegationSettingsProperties subscriptions delegation settings properties. type SubscriptionsDelegationSettingsProperties struct { // Enabled - Enable or disable delegation for subscriptions. @@ -9960,10 +11624,10 @@ type SubscriptionsDelegationSettingsProperties struct { // SubscriptionUpdateParameterProperties parameters supplied to the Update subscription operation. type SubscriptionUpdateParameterProperties struct { - // UserID - User identifier path: /users/{uid} - UserID *string `json:"userId,omitempty"` - // ProductID - Product identifier path: /products/{productId} - ProductID *string `json:"productId,omitempty"` + // OwnerID - User identifier path: /users/{userId} + OwnerID *string `json:"ownerId,omitempty"` + // Scope - Scope like /products/{productId} or /apis or /apis/{apiId} + Scope *string `json:"scope,omitempty"` // ExpirationDate - Subscription expiration date. The setting is for audit purposes only and the subscription is not automatically expired. The subscription lifecycle can be managed by using the `state` property. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. ExpirationDate *date.Time `json:"expirationDate,omitempty"` // DisplayName - Subscription name. @@ -9976,6 +11640,8 @@ type SubscriptionUpdateParameterProperties struct { State SubscriptionState `json:"state,omitempty"` // StateComment - Comments describing subscription state change by the administrator. StateComment *string `json:"stateComment,omitempty"` + // AllowTracing - Determines whether tracing can be enabled + AllowTracing *bool `json:"allowTracing,omitempty"` } // SubscriptionUpdateParameters subscription update details. @@ -10512,6 +12178,8 @@ func (tdc *TagDescriptionContract) UnmarshalJSON(body []byte) error { // TagDescriptionContractProperties tagDescription contract Properties. type TagDescriptionContractProperties struct { + // TagID - Identifier of the tag in the form of /tags/{tagId} + TagID *string `json:"tagId,omitempty"` // DisplayName - Tag name. DisplayName *string `json:"displayName,omitempty"` // Description - Description of the Tag. @@ -10566,8 +12234,6 @@ type TagResourceCollection struct { autorest.Response `json:"-"` // Value - Page values. Value *[]TagResourceContract `json:"value,omitempty"` - // Count - Total record count number across all pages. - Count *int64 `json:"count,omitempty"` // NextLink - Next page link if any. NextLink *string `json:"nextLink,omitempty"` } @@ -11102,6 +12768,8 @@ type UserCreateParameterProperties struct { LastName *string `json:"lastName,omitempty"` // Password - User Password. If no value is provided, a default password is generated. Password *string `json:"password,omitempty"` + // AppType - Determines the type of application which send the create user request. Default is old publisher portal. Possible values include: 'DeveloperPortal' + AppType AppType `json:"appType,omitempty"` // Confirmation - Determines the type of confirmation e-mail that will be sent to the newly created user. Possible values include: 'Signup', 'Invite' Confirmation Confirmation `json:"confirmation,omitempty"` // State - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer portal or call any APIs of subscribed products. Default state is Active. Possible values include: 'UserStateActive', 'UserStateBlocked', 'UserStatePending', 'UserStateDeleted' @@ -11317,14 +12985,61 @@ type UserIdentityContract struct { ID *string `json:"id,omitempty"` } -// UserTokenParameters parameters supplied to the Get User Token operation. -type UserTokenParameters struct { +// UserIdentityProperties ... +type UserIdentityProperties struct { + // PrincipalID - The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + +// UserTokenParameterProperties parameters supplied to the Get User Token operation. +type UserTokenParameterProperties struct { // KeyType - The Key to be used to generate token for user. Possible values include: 'Primary', 'Secondary' KeyType KeyType `json:"keyType,omitempty"` // Expiry - The Expiry time of the Token. Maximum token expiry time is set to 30 days. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard. Expiry *date.Time `json:"expiry,omitempty"` } +// UserTokenParameters get User Token parameters. +type UserTokenParameters struct { + // UserTokenParameterProperties - User Token Parameter contract properties. + *UserTokenParameterProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserTokenParameters. +func (utp UserTokenParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if utp.UserTokenParameterProperties != nil { + objectMap["properties"] = utp.UserTokenParameterProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UserTokenParameters struct. +func (utp *UserTokenParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var userTokenParameterProperties UserTokenParameterProperties + err = json.Unmarshal(*v, &userTokenParameterProperties) + if err != nil { + return err + } + utp.UserTokenParameterProperties = &userTokenParameterProperties + } + } + } + + return nil +} + // UserTokenResult get User Token response details. type UserTokenResult struct { autorest.Response `json:"-"` diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/namedvalue.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/namedvalue.go new file mode 100644 index 0000000000000..88c758c169edc --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/namedvalue.go @@ -0,0 +1,747 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// NamedValueClient is the apiManagement Client +type NamedValueClient struct { + BaseClient +} + +// NewNamedValueClient creates an instance of the NamedValueClient client. +func NewNamedValueClient(subscriptionID string) NamedValueClient { + return NewNamedValueClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNamedValueClientWithBaseURI creates an instance of the NamedValueClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewNamedValueClientWithBaseURI(baseURI string, subscriptionID string) NamedValueClient { + return NamedValueClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a NamedValue. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// namedValueID - identifier of the NamedValue. +// parameters - create parameters. +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client NamedValueClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, parameters NamedValueCreateContract, ifMatch string) (result NamedValueCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: namedValueID, + Constraints: []validation.Constraint{{Target: "namedValueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "namedValueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.NamedValueCreateContractProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.NamedValueCreateContractProperties.DisplayName", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.NamedValueCreateContractProperties.DisplayName", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "parameters.NamedValueCreateContractProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "parameters.NamedValueCreateContractProperties.DisplayName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]+$`, Chain: nil}, + }}, + {Target: "parameters.NamedValueCreateContractProperties.Value", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.NamedValueCreateContractProperties.Value", Name: validation.MaxLength, Rule: 4096, Chain: nil}, + {Target: "parameters.NamedValueCreateContractProperties.Value", Name: validation.MinLength, Rule: 1, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, namedValueID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client NamedValueClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, parameters NamedValueCreateContract, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namedValueId": autorest.Encode("path", namedValueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) CreateOrUpdateSender(req *http.Request) (future NamedValueCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client NamedValueClient) CreateOrUpdateResponder(resp *http.Response) (result NamedValueContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specific NamedValue from the API Management service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// namedValueID - identifier of the NamedValue. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client NamedValueClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, ifMatch string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: namedValueID, + Constraints: []validation.Constraint{{Target: "namedValueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "namedValueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, namedValueID, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client NamedValueClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namedValueId": autorest.Encode("path", namedValueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client NamedValueClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the NamedValue specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// namedValueID - identifier of the NamedValue. +func (client NamedValueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string) (result NamedValueContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: namedValueID, + Constraints: []validation.Constraint{{Target: "namedValueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "namedValueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, namedValueID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client NamedValueClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namedValueId": autorest.Encode("path", namedValueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client NamedValueClient) GetResponder(resp *http.Response) (result NamedValueContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEntityTag gets the entity state (Etag) version of the NamedValue specified by its identifier. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// namedValueID - identifier of the NamedValue. +func (client NamedValueClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.GetEntityTag") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: namedValueID, + Constraints: []validation.Constraint{{Target: "namedValueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "namedValueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, namedValueID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client NamedValueClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namedValueId": autorest.Encode("path", namedValueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client NamedValueClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByService lists a collection of NamedValues defined within a service instance. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| tags | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith, any, all |
| displayName | filter | ge, le, eq, ne, gt, +// lt | substringof, contains, startswith, endswith |
+// top - number of records to return. +// skip - number of records to skip. +func (client NamedValueClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result NamedValueCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.ListByService") + defer func() { + sc := -1 + if result.nvc.Response.Response != nil { + sc = result.nvc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "ListByService", err.Error()) + } + + result.fn = client.listByServiceNextResults + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "ListByService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServiceSender(req) + if err != nil { + result.nvc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "ListByService", resp, "Failure sending request") + return + } + + result.nvc, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "ListByService", resp, "Failure responding to request") + } + + return +} + +// ListByServicePreparer prepares the ListByService request. +func (client NamedValueClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServiceSender sends the ListByService request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) ListByServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServiceResponder handles the response to the ListByService request. The method always +// closes the http.Response Body. +func (client NamedValueClient) ListByServiceResponder(resp *http.Response) (result NamedValueCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServiceNextResults retrieves the next set of results, if any. +func (client NamedValueClient) listByServiceNextResults(ctx context.Context, lastResults NamedValueCollection) (result NamedValueCollection, err error) { + req, err := lastResults.namedValueCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "listByServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "listByServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "listByServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client NamedValueClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result NamedValueCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.ListByService") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + return +} + +// ListValue gets the secret value of the NamedValue. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// namedValueID - identifier of the NamedValue. +func (client NamedValueClient) ListValue(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string) (result PropertyValueContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.ListValue") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: namedValueID, + Constraints: []validation.Constraint{{Target: "namedValueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "namedValueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "ListValue", err.Error()) + } + + req, err := client.ListValuePreparer(ctx, resourceGroupName, serviceName, namedValueID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "ListValue", nil, "Failure preparing request") + return + } + + resp, err := client.ListValueSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "ListValue", resp, "Failure sending request") + return + } + + result, err = client.ListValueResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "ListValue", resp, "Failure responding to request") + } + + return +} + +// ListValuePreparer prepares the ListValue request. +func (client NamedValueClient) ListValuePreparer(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namedValueId": autorest.Encode("path", namedValueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}/listValue", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListValueSender sends the ListValue request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) ListValueSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListValueResponder handles the response to the ListValue request. The method always +// closes the http.Response Body. +func (client NamedValueClient) ListValueResponder(resp *http.Response) (result PropertyValueContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates the specific NamedValue. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// namedValueID - identifier of the NamedValue. +// parameters - update parameters. +// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET +// request or it should be * for unconditional update. +func (client NamedValueClient) Update(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, parameters NamedValueUpdateParameters, ifMatch string) (result NamedValueUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NamedValueClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: namedValueID, + Constraints: []validation.Constraint{{Target: "namedValueID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "namedValueID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.NamedValueClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, namedValueID, parameters, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.NamedValueClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client NamedValueClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, parameters NamedValueUpdateParameters, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "namedValueId": autorest.Encode("path", namedValueID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/namedValues/{namedValueId}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client NamedValueClient) UpdateSender(req *http.Request) (future NamedValueUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client NamedValueClient) UpdateResponder(resp *http.Response) (result NamedValueContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/networkstatus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/networkstatus.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/networkstatus.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/networkstatus.go index 6076dcb4c0534..1af7879028e50 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/networkstatus.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/networkstatus.go @@ -100,7 +100,7 @@ func (client NetworkStatusClient) ListByLocationPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -185,7 +185,7 @@ func (client NetworkStatusClient) ListByServicePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notification.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notification.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notification.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notification.go index 5c03524ed16e1..bdd23eecb6d5f 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notification.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notification.go @@ -42,7 +42,7 @@ func NewNotificationClientWithBaseURI(baseURI string, subscriptionID string) Not return NotificationClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate updates an Notification. +// CreateOrUpdate create or Update API Management publisher notification. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -97,7 +97,7 @@ func (client NotificationClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -187,7 +187,7 @@ func (client NotificationClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -280,7 +280,7 @@ func (client NotificationClient) ListByServicePreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notificationrecipientemail.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notificationrecipientemail.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notificationrecipientemail.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notificationrecipientemail.go index 70c2e3a87341f..8bddd00f2f9ba 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notificationrecipientemail.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notificationrecipientemail.go @@ -99,7 +99,7 @@ func (client NotificationRecipientEmailClient) CheckEntityExistsPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -186,7 +186,7 @@ func (client NotificationRecipientEmailClient) CreateOrUpdatePreparer(ctx contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -274,7 +274,7 @@ func (client NotificationRecipientEmailClient) DeletePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -359,7 +359,7 @@ func (client NotificationRecipientEmailClient) ListByNotificationPreparer(ctx co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notificationrecipientuser.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notificationrecipientuser.go similarity index 88% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notificationrecipientuser.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notificationrecipientuser.go index d1b7d1b31d479..5324a910bb2fb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/notificationrecipientuser.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/notificationrecipientuser.go @@ -48,8 +48,8 @@ func NewNotificationRecipientUserClientWithBaseURI(baseURI string, subscriptionI // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // notificationName - notification Name Identifier. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client NotificationRecipientUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (result autorest.Response, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client NotificationRecipientUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/NotificationRecipientUserClient.CheckEntityExists") defer func() { @@ -65,14 +65,13 @@ func (client NotificationRecipientUserClient) CheckEntityExists(ctx context.Cont Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.NotificationRecipientUserClient", "CheckEntityExists", err.Error()) } - req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, notificationName, UID) + req, err := client.CheckEntityExistsPreparer(ctx, resourceGroupName, serviceName, notificationName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "CheckEntityExists", nil, "Failure preparing request") return @@ -94,16 +93,16 @@ func (client NotificationRecipientUserClient) CheckEntityExists(ctx context.Cont } // CheckEntityExistsPreparer prepares the CheckEntityExists request. -func (client NotificationRecipientUserClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (*http.Request, error) { +func (client NotificationRecipientUserClient) CheckEntityExistsPreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "notificationName": autorest.Encode("path", notificationName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -111,7 +110,7 @@ func (client NotificationRecipientUserClient) CheckEntityExistsPreparer(ctx cont preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -139,8 +138,8 @@ func (client NotificationRecipientUserClient) CheckEntityExistsResponder(resp *h // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // notificationName - notification Name Identifier. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client NotificationRecipientUserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (result RecipientUserContract, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client NotificationRecipientUserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string) (result RecipientUserContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/NotificationRecipientUserClient.CreateOrUpdate") defer func() { @@ -156,14 +155,13 @@ func (client NotificationRecipientUserClient) CreateOrUpdate(ctx context.Context Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.NotificationRecipientUserClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, notificationName, UID) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, notificationName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -185,16 +183,16 @@ func (client NotificationRecipientUserClient) CreateOrUpdate(ctx context.Context } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client NotificationRecipientUserClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (*http.Request, error) { +func (client NotificationRecipientUserClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "notificationName": autorest.Encode("path", notificationName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -202,7 +200,7 @@ func (client NotificationRecipientUserClient) CreateOrUpdatePreparer(ctx context preparer := autorest.CreatePreparer( autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -231,8 +229,8 @@ func (client NotificationRecipientUserClient) CreateOrUpdateResponder(resp *http // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // notificationName - notification Name Identifier. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client NotificationRecipientUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (result autorest.Response, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client NotificationRecipientUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/NotificationRecipientUserClient.Delete") defer func() { @@ -248,14 +246,13 @@ func (client NotificationRecipientUserClient) Delete(ctx context.Context, resour Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.NotificationRecipientUserClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, notificationName, UID) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, notificationName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.NotificationRecipientUserClient", "Delete", nil, "Failure preparing request") return @@ -277,16 +274,16 @@ func (client NotificationRecipientUserClient) Delete(ctx context.Context, resour } // DeletePreparer prepares the Delete request. -func (client NotificationRecipientUserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, UID string) (*http.Request, error) { +func (client NotificationRecipientUserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "notificationName": autorest.Encode("path", notificationName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -294,7 +291,7 @@ func (client NotificationRecipientUserClient) DeletePreparer(ctx context.Context preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/notifications/{notificationName}/recipientUsers/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -371,7 +368,7 @@ func (client NotificationRecipientUserClient) ListByNotificationPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/openidconnectprovider.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/openidconnectprovider.go similarity index 86% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/openidconnectprovider.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/openidconnectprovider.go index 6a17a95442b60..552546def4c22 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/openidconnectprovider.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/openidconnectprovider.go @@ -109,7 +109,7 @@ func (client OpenIDConnectProviderClient) CreateOrUpdatePreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -206,7 +206,7 @@ func (client OpenIDConnectProviderClient) DeletePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -295,7 +295,7 @@ func (client OpenIDConnectProviderClient) GetPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -384,7 +384,7 @@ func (client OpenIDConnectProviderClient) GetEntityTagPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -415,14 +415,14 @@ func (client OpenIDConnectProviderClient) GetEntityTagResponder(resp *http.Respo return } -// ListByService lists all OpenID Connect Providers. +// ListByService lists of all the OpenId Connect Providers. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client OpenIDConnectProviderClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result OpenIDConnectProviderCollectionPage, err error) { @@ -480,7 +480,7 @@ func (client OpenIDConnectProviderClient) ListByServicePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -558,6 +558,95 @@ func (client OpenIDConnectProviderClient) ListByServiceComplete(ctx context.Cont return } +// ListSecrets gets the client secret details of the OpenID Connect Provider. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// opid - identifier of the OpenID Connect Provider. +func (client OpenIDConnectProviderClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, opid string) (result ClientSecretContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenIDConnectProviderClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: opid, + Constraints: []validation.Constraint{{Target: "opid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "opid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.OpenIDConnectProviderClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName, opid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.OpenIDConnectProviderClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client OpenIDConnectProviderClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string, opid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "opid": autorest.Encode("path", opid), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/openidConnectProviders/{opid}/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client OpenIDConnectProviderClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client OpenIDConnectProviderClient) ListSecretsResponder(resp *http.Response) (result ClientSecretContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Update updates the specific OpenID Connect Provider. // Parameters: // resourceGroupName - the name of the resource group. @@ -618,7 +707,7 @@ func (client OpenIDConnectProviderClient) UpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/operation.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/operation.go similarity index 84% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/operation.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/operation.go index 1a3b64929659d..ff124e130f6aa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/operation.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/operation.go @@ -48,17 +48,18 @@ func NewOperationClientWithBaseURI(baseURI string, subscriptionID string) Operat // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| method | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client OperationClient) ListByTags(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagResourceCollectionPage, err error) { +// includeNotTaggedOperations - include not tagged Operations. +func (client OperationClient) ListByTags(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32, includeNotTaggedOperations *bool) (result TagResourceCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationClient.ListByTags") defer func() { @@ -88,7 +89,7 @@ func (client OperationClient) ListByTags(ctx context.Context, resourceGroupName } result.fn = client.listByTagsNextResults - req, err := client.ListByTagsPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + req, err := client.ListByTagsPreparer(ctx, resourceGroupName, serviceName, apiid, filter, top, skip, includeNotTaggedOperations) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.OperationClient", "ListByTags", nil, "Failure preparing request") return @@ -110,7 +111,7 @@ func (client OperationClient) ListByTags(ctx context.Context, resourceGroupName } // ListByTagsPreparer prepares the ListByTags request. -func (client OperationClient) ListByTagsPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client OperationClient) ListByTagsPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32, includeNotTaggedOperations *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -118,7 +119,7 @@ func (client OperationClient) ListByTagsPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -131,6 +132,9 @@ func (client OperationClient) ListByTagsPreparer(ctx context.Context, resourceGr if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if includeNotTaggedOperations != nil { + queryParameters["includeNotTaggedOperations"] = autorest.Encode("query", *includeNotTaggedOperations) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -181,7 +185,7 @@ func (client OperationClient) listByTagsNextResults(ctx context.Context, lastRes } // ListByTagsComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationClient) ListByTagsComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagResourceCollectionIterator, err error) { +func (client OperationClient) ListByTagsComplete(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32, includeNotTaggedOperations *bool) (result TagResourceCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationClient.ListByTags") defer func() { @@ -192,6 +196,6 @@ func (client OperationClient) ListByTagsComplete(ctx context.Context, resourceGr tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByTags(ctx, resourceGroupName, serviceName, apiid, filter, top, skip) + result.page, err = client.ListByTags(ctx, resourceGroupName, serviceName, apiid, filter, top, skip, includeNotTaggedOperations) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/operations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/operations.go index 2a04e801a9e2b..84b4976056b6c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/operations.go @@ -77,7 +77,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/policy.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/policy.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/policy.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/policy.go index 7e05f4b531975..a1d4fbf54cabf 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/policy.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/policy.go @@ -47,7 +47,8 @@ func NewPolicyClientWithBaseURI(baseURI string, subscriptionID string) PolicyCli // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // parameters - the policy contents to apply. -func (client PolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PolicyContract) (result PolicyContract, err error) { +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client PolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PolicyContract, ifMatch string) (result PolicyContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyClient.CreateOrUpdate") defer func() { @@ -65,11 +66,11 @@ func (client PolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.PolicyContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.PolicyContent", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.Value", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.PolicyClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -91,7 +92,7 @@ func (client PolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client PolicyClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PolicyContract) (*http.Request, error) { +func (client PolicyClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PolicyContract, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyId": autorest.Encode("path", "policy"), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -99,7 +100,7 @@ func (client PolicyClient) CreateOrUpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -111,6 +112,10 @@ func (client PolicyClient) CreateOrUpdatePreparer(ctx context.Context, resourceG autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policies/{policyId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -188,7 +193,7 @@ func (client PolicyClient) DeletePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -224,7 +229,8 @@ func (client PolicyClient) DeleteResponder(resp *http.Response) (result autorest // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -func (client PolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string) (result PolicyContract, err error) { +// formatParameter - policy Export Format. +func (client PolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, formatParameter PolicyExportFormat) (result PolicyContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyClient.Get") defer func() { @@ -243,7 +249,7 @@ func (client PolicyClient) Get(ctx context.Context, resourceGroupName string, se return result, validation.NewError("apimanagement.PolicyClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, formatParameter) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "Get", nil, "Failure preparing request") return @@ -265,7 +271,7 @@ func (client PolicyClient) Get(ctx context.Context, resourceGroupName string, se } // GetPreparer prepares the Get request. -func (client PolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { +func (client PolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, formatParameter PolicyExportFormat) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyId": autorest.Encode("path", "policy"), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -273,10 +279,15 @@ func (client PolicyClient) GetPreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(formatParameter)) > 0 { + queryParameters["format"] = autorest.Encode("query", formatParameter) + } else { + queryParameters["format"] = autorest.Encode("query", "xml") + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -358,7 +369,7 @@ func (client PolicyClient) GetEntityTagPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -393,8 +404,7 @@ func (client PolicyClient) GetEntityTagResponder(resp *http.Response) (result au // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// scope - policy scope. -func (client PolicyClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (result PolicyCollection, err error) { +func (client PolicyClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string) (result PolicyCollection, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyClient.ListByService") defer func() { @@ -413,7 +423,7 @@ func (client PolicyClient) ListByService(ctx context.Context, resourceGroupName return result, validation.NewError("apimanagement.PolicyClient", "ListByService", err.Error()) } - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, scope) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.PolicyClient", "ListByService", nil, "Failure preparing request") return @@ -435,20 +445,17 @@ func (client PolicyClient) ListByService(ctx context.Context, resourceGroupName } // ListByServicePreparer prepares the ListByService request. -func (client PolicyClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (*http.Request, error) { +func (client PolicyClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } - if len(string(scope)) > 0 { - queryParameters["scope"] = autorest.Encode("query", scope) - } preparer := autorest.CreatePreparer( autorest.AsGet(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/policysnippets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/policydescription.go similarity index 62% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/policysnippets.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/policydescription.go index 949a4d62c939b..bdefd3f94abad 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/policysnippets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/policydescription.go @@ -26,30 +26,31 @@ import ( "net/http" ) -// PolicySnippetsClient is the apiManagement Client -type PolicySnippetsClient struct { +// PolicyDescriptionClient is the apiManagement Client +type PolicyDescriptionClient struct { BaseClient } -// NewPolicySnippetsClient creates an instance of the PolicySnippetsClient client. -func NewPolicySnippetsClient(subscriptionID string) PolicySnippetsClient { - return NewPolicySnippetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewPolicyDescriptionClient creates an instance of the PolicyDescriptionClient client. +func NewPolicyDescriptionClient(subscriptionID string) PolicyDescriptionClient { + return NewPolicyDescriptionClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewPolicySnippetsClientWithBaseURI creates an instance of the PolicySnippetsClient client using a custom endpoint. -// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewPolicySnippetsClientWithBaseURI(baseURI string, subscriptionID string) PolicySnippetsClient { - return PolicySnippetsClient{NewWithBaseURI(baseURI, subscriptionID)} +// NewPolicyDescriptionClientWithBaseURI creates an instance of the PolicyDescriptionClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPolicyDescriptionClientWithBaseURI(baseURI string, subscriptionID string) PolicyDescriptionClient { + return PolicyDescriptionClient{NewWithBaseURI(baseURI, subscriptionID)} } -// ListByService lists all policy snippets. +// ListByService lists all policy descriptions. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // scope - policy scope. -func (client PolicySnippetsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (result PolicySnippetsCollection, err error) { +func (client PolicyDescriptionClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (result PolicyDescriptionCollection, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PolicySnippetsClient.ListByService") + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyDescriptionClient.ListByService") defer func() { sc := -1 if result.Response.Response != nil { @@ -63,39 +64,39 @@ func (client PolicySnippetsClient) ListByService(ctx context.Context, resourceGr Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.PolicySnippetsClient", "ListByService", err.Error()) + return result, validation.NewError("apimanagement.PolicyDescriptionClient", "ListByService", err.Error()) } req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, scope) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PolicySnippetsClient", "ListByService", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.PolicyDescriptionClient", "ListByService", nil, "Failure preparing request") return } resp, err := client.ListByServiceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.PolicySnippetsClient", "ListByService", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.PolicyDescriptionClient", "ListByService", resp, "Failure sending request") return } result, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.PolicySnippetsClient", "ListByService", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.PolicyDescriptionClient", "ListByService", resp, "Failure responding to request") } return } // ListByServicePreparer prepares the ListByService request. -func (client PolicySnippetsClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (*http.Request, error) { +func (client PolicyDescriptionClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, scope PolicyScopeContract) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -106,20 +107,20 @@ func (client PolicySnippetsClient) ListByServicePreparer(ctx context.Context, re preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policySnippets", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyDescriptions", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. -func (client PolicySnippetsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { +func (client PolicyDescriptionClient) ListByServiceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client PolicySnippetsClient) ListByServiceResponder(resp *http.Response) (result PolicySnippetsCollection, err error) { +func (client PolicyDescriptionClient) ListByServiceResponder(resp *http.Response) (result PolicyDescriptionCollection, err error) { err = autorest.Respond( resp, client.ByInspecting(), diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/product.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/product.go similarity index 76% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/product.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/product.go index 4494fcc597d8b..805dff8375b4b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/product.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/product.go @@ -66,9 +66,8 @@ func (client ProductClient) CreateOrUpdate(ctx context.Context, resourceGroupNam {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.ProductContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ProductContractProperties.DisplayName", Name: validation.Null, Rule: true, @@ -109,7 +108,7 @@ func (client ProductClient) CreateOrUpdatePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -172,9 +171,8 @@ func (client ProductClient) Delete(ctx context.Context, resourceGroupName string {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductClient", "Delete", err.Error()) } @@ -208,7 +206,7 @@ func (client ProductClient) DeletePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -265,9 +263,8 @@ func (client ProductClient) Get(ctx context.Context, resourceGroupName string, s {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductClient", "Get", err.Error()) } @@ -301,7 +298,7 @@ func (client ProductClient) GetPreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -355,9 +352,8 @@ func (client ProductClient) GetEntityTag(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductClient", "GetEntityTag", err.Error()) } @@ -391,7 +387,7 @@ func (client ProductClient) GetEntityTagPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -426,18 +422,19 @@ func (client ProductClient) GetEntityTagResponder(resp *http.Response) (result a // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| state | filter | eq | |
| groups | expand | | | +//
// top - number of records to return. // skip - number of records to skip. // expandGroups - when set to true, the response contains an array of groups that have visibility to the // product. The default is false. -func (client ProductClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (result ProductCollectionPage, err error) { +// tags - products which are part of a specific tag. +func (client ProductClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool, tags string) (result ProductCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProductClient.ListByService") defer func() { @@ -463,7 +460,7 @@ func (client ProductClient) ListByService(ctx context.Context, resourceGroupName } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups, tags) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "ListByService", nil, "Failure preparing request") return @@ -485,14 +482,14 @@ func (client ProductClient) ListByService(ctx context.Context, resourceGroupName } // ListByServicePreparer prepares the ListByService request. -func (client ProductClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (*http.Request, error) { +func (client ProductClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool, tags string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -508,6 +505,9 @@ func (client ProductClient) ListByServicePreparer(ctx context.Context, resourceG if expandGroups != nil { queryParameters["expandGroups"] = autorest.Encode("query", *expandGroups) } + if len(tags) > 0 { + queryParameters["tags"] = autorest.Encode("query", tags) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -558,7 +558,7 @@ func (client ProductClient) listByServiceNextResults(ctx context.Context, lastRe } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client ProductClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (result ProductCollectionIterator, err error) { +func (client ProductClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool, tags string) (result ProductCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProductClient.ListByService") defer func() { @@ -569,11 +569,161 @@ func (client ProductClient) ListByServiceComplete(ctx context.Context, resourceG tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups, tags) + return +} + +// ListByTags lists a collection of products associated with tags. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| terms | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| state | filter | eq | substringof, contains, startswith, endswith | +//
+// top - number of records to return. +// skip - number of records to skip. +// includeNotTaggedProducts - include not tagged Products. +func (client ProductClient) ListByTags(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, includeNotTaggedProducts *bool) (result TagResourceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductClient.ListByTags") + defer func() { + sc := -1 + if result.trc.Response.Response != nil { + sc = result.trc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: top, + Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, + {TargetValue: skip, + Constraints: []validation.Constraint{{Target: "skip", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "skip", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { + return result, validation.NewError("apimanagement.ProductClient", "ListByTags", err.Error()) + } + + result.fn = client.listByTagsNextResults + req, err := client.ListByTagsPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, includeNotTaggedProducts) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "ListByTags", nil, "Failure preparing request") + return + } + + resp, err := client.ListByTagsSender(req) + if err != nil { + result.trc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "ListByTags", resp, "Failure sending request") + return + } + + result.trc, err = client.ListByTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "ListByTags", resp, "Failure responding to request") + } + + return +} + +// ListByTagsPreparer prepares the ListByTags request. +func (client ProductClient) ListByTagsPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, includeNotTaggedProducts *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if skip != nil { + queryParameters["$skip"] = autorest.Encode("query", *skip) + } + if includeNotTaggedProducts != nil { + queryParameters["includeNotTaggedProducts"] = autorest.Encode("query", *includeNotTaggedProducts) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/productsByTags", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByTagsSender sends the ListByTags request. The method will close the +// http.Response Body if it receives an error. +func (client ProductClient) ListByTagsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByTagsResponder handles the response to the ListByTags request. The method always +// closes the http.Response Body. +func (client ProductClient) ListByTagsResponder(resp *http.Response) (result TagResourceCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByTagsNextResults retrieves the next set of results, if any. +func (client ProductClient) listByTagsNextResults(ctx context.Context, lastResults TagResourceCollection) (result TagResourceCollection, err error) { + req, err := lastResults.tagResourceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "apimanagement.ProductClient", "listByTagsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByTagsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "apimanagement.ProductClient", "listByTagsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByTagsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.ProductClient", "listByTagsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByTagsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProductClient) ListByTagsComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, includeNotTaggedProducts *bool) (result TagResourceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductClient.ListByTags") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByTags(ctx, resourceGroupName, serviceName, filter, top, skip, includeNotTaggedProducts) return } -// Update update product. +// Update update existing product details. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -598,9 +748,8 @@ func (client ProductClient) Update(ctx context.Context, resourceGroupName string {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductClient", "Update", err.Error()) } @@ -634,7 +783,7 @@ func (client ProductClient) UpdatePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productapi.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productapi.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productapi.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productapi.go index fc534c75cd785..19b962a5dd6a7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productapi.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productapi.go @@ -66,9 +66,8 @@ func (client ProductAPIClient) CheckEntityExists(ctx context.Context, resourceGr {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -107,7 +106,7 @@ func (client ProductAPIClient) CheckEntityExistsPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -132,7 +131,7 @@ func (client ProductAPIClient) CheckEntityExistsResponder(resp *http.Response) ( err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return @@ -162,9 +161,8 @@ func (client ProductAPIClient) CreateOrUpdate(ctx context.Context, resourceGroup {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -203,7 +201,7 @@ func (client ProductAPIClient) CreateOrUpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -259,9 +257,8 @@ func (client ProductAPIClient) Delete(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: apiid, Constraints: []validation.Constraint{{Target: "apiid", Name: validation.MaxLength, Rule: 256, Chain: nil}, {Target: "apiid", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -300,7 +297,7 @@ func (client ProductAPIClient) DeletePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -336,13 +333,13 @@ func (client ProductAPIClient) DeleteResponder(resp *http.Response) (result auto // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client ProductAPIClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result APICollectionPage, err error) { @@ -362,9 +359,8 @@ func (client ProductAPIClient) ListByProduct(ctx context.Context, resourceGroupN {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -405,7 +401,7 @@ func (client ProductAPIClient) ListByProductPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productgroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productgroup.go similarity index 91% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productgroup.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productgroup.go index 55e600182e07e..18874c9b9f640 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productgroup.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productgroup.go @@ -65,13 +65,11 @@ func (client ProductGroupClient) CheckEntityExists(ctx context.Context, resource {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductGroupClient", "CheckEntityExists", err.Error()) } @@ -106,7 +104,7 @@ func (client ProductGroupClient) CheckEntityExistsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -131,7 +129,7 @@ func (client ProductGroupClient) CheckEntityExistsResponder(resp *http.Response) err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusNotFound), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return @@ -160,13 +158,11 @@ func (client ProductGroupClient) CreateOrUpdate(ctx context.Context, resourceGro {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductGroupClient", "CreateOrUpdate", err.Error()) } @@ -201,7 +197,7 @@ func (client ProductGroupClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -256,13 +252,11 @@ func (client ProductGroupClient) Delete(ctx context.Context, resourceGroupName s {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: groupID, - Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "groupID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "groupID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "groupID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductGroupClient", "Delete", err.Error()) } @@ -297,7 +291,7 @@ func (client ProductGroupClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,12 +327,9 @@ func (client ProductGroupClient) DeleteResponder(resp *http.Response) (result au // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | type | eq, ne | N/A | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | |
| displayName | filter | eq, ne | |
| description | filter | eq, ne | |
// top - number of records to return. // skip - number of records to skip. func (client ProductGroupClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result GroupCollectionPage, err error) { @@ -358,9 +349,8 @@ func (client ProductGroupClient) ListByProduct(ctx context.Context, resourceGrou {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -401,7 +391,7 @@ func (client ProductGroupClient) ListByProductPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productpolicy.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productpolicy.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productpolicy.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productpolicy.go index 619b9c1859a6d..662b26a98f757 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productpolicy.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productpolicy.go @@ -66,12 +66,11 @@ func (client ProductPolicyClient) CreateOrUpdate(ctx context.Context, resourceGr {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.PolicyContractProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.PolicyContent", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "parameters.PolicyContractProperties.Value", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.ProductPolicyClient", "CreateOrUpdate", err.Error()) } @@ -106,7 +105,7 @@ func (client ProductPolicyClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -168,9 +167,8 @@ func (client ProductPolicyClient) Delete(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductPolicyClient", "Delete", err.Error()) } @@ -205,7 +203,7 @@ func (client ProductPolicyClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +240,8 @@ func (client ProductPolicyClient) DeleteResponder(resp *http.Response) (result a // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. -func (client ProductPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string) (result PolicyContract, err error) { +// formatParameter - policy Export Format. +func (client ProductPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string, formatParameter PolicyExportFormat) (result PolicyContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProductPolicyClient.Get") defer func() { @@ -259,13 +258,12 @@ func (client ProductPolicyClient) Get(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductPolicyClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, productID) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, productID, formatParameter) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ProductPolicyClient", "Get", nil, "Failure preparing request") return @@ -287,7 +285,7 @@ func (client ProductPolicyClient) Get(ctx context.Context, resourceGroupName str } // GetPreparer prepares the Get request. -func (client ProductPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string) (*http.Request, error) { +func (client ProductPolicyClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, formatParameter PolicyExportFormat) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyId": autorest.Encode("path", "policy"), "productId": autorest.Encode("path", productID), @@ -296,10 +294,15 @@ func (client ProductPolicyClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if len(string(formatParameter)) > 0 { + queryParameters["format"] = autorest.Encode("query", formatParameter) + } else { + queryParameters["format"] = autorest.Encode("query", "xml") + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -350,9 +353,8 @@ func (client ProductPolicyClient) GetEntityTag(ctx context.Context, resourceGrou {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductPolicyClient", "GetEntityTag", err.Error()) } @@ -387,7 +389,7 @@ func (client ProductPolicyClient) GetEntityTagPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -440,9 +442,8 @@ func (client ProductPolicyClient) ListByProduct(ctx context.Context, resourceGro {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ProductPolicyClient", "ListByProduct", err.Error()) } @@ -476,7 +477,7 @@ func (client ProductPolicyClient) ListByProductPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productsubscriptions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productsubscriptions.go similarity index 88% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productsubscriptions.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productsubscriptions.go index c3a05795f4f3d..5b16d7c2b8192 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/productsubscriptions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/productsubscriptions.go @@ -48,14 +48,15 @@ func NewProductSubscriptionsClientWithBaseURI(baseURI string, subscriptionID str // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |--------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| state | filter | eq | |
| user | expand | | |
// top - number of records to return. // skip - number of records to skip. func (client ProductSubscriptionsClient) List(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionPage, err error) { @@ -75,9 +76,8 @@ func (client ProductSubscriptionsClient) List(ctx context.Context, resourceGroup {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -118,7 +118,7 @@ func (client ProductSubscriptionsClient) ListPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/quotabycounterkeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/quotabycounterkeys.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/quotabycounterkeys.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/quotabycounterkeys.go index a76f3cfd5e684..4574daf7fac15 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/quotabycounterkeys.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/quotabycounterkeys.go @@ -101,7 +101,7 @@ func (client QuotaByCounterKeysClient) ListByServicePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -192,7 +192,7 @@ func (client QuotaByCounterKeysClient) UpdatePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/quotabyperiodkeys.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/quotabyperiodkeys.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/quotabyperiodkeys.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/quotabyperiodkeys.go index 298294eb08cc1..aa010661566f0 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/quotabyperiodkeys.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/quotabyperiodkeys.go @@ -103,7 +103,7 @@ func (client QuotaByPeriodKeysClient) GetPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -195,7 +195,7 @@ func (client QuotaByPeriodKeysClient) UpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/regions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/region.go similarity index 66% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/regions.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/region.go index 04e737c72de3b..59802c7234951 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/regions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/region.go @@ -26,29 +26,29 @@ import ( "net/http" ) -// RegionsClient is the apiManagement Client -type RegionsClient struct { +// RegionClient is the apiManagement Client +type RegionClient struct { BaseClient } -// NewRegionsClient creates an instance of the RegionsClient client. -func NewRegionsClient(subscriptionID string) RegionsClient { - return NewRegionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +// NewRegionClient creates an instance of the RegionClient client. +func NewRegionClient(subscriptionID string) RegionClient { + return NewRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewRegionsClientWithBaseURI creates an instance of the RegionsClient client using a custom endpoint. Use this when +// NewRegionClientWithBaseURI creates an instance of the RegionClient client using a custom endpoint. Use this when // interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). -func NewRegionsClientWithBaseURI(baseURI string, subscriptionID string) RegionsClient { - return RegionsClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewRegionClientWithBaseURI(baseURI string, subscriptionID string) RegionClient { + return RegionClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListByService lists all azure regions in which the service exists. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -func (client RegionsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string) (result RegionListResultPage, err error) { +func (client RegionClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string) (result RegionListResultPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RegionsClient.ListByService") + ctx = tracing.StartSpan(ctx, fqdn+"/RegionClient.ListByService") defer func() { sc := -1 if result.rlr.Response.Response != nil { @@ -62,40 +62,40 @@ func (client RegionsClient) ListByService(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.RegionsClient", "ListByService", err.Error()) + return result, validation.NewError("apimanagement.RegionClient", "ListByService", err.Error()) } result.fn = client.listByServiceNextResults req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "ListByService", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "apimanagement.RegionClient", "ListByService", nil, "Failure preparing request") return } resp, err := client.ListByServiceSender(req) if err != nil { result.rlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "ListByService", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.RegionClient", "ListByService", resp, "Failure sending request") return } result.rlr, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "ListByService", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "apimanagement.RegionClient", "ListByService", resp, "Failure responding to request") } return } // ListByServicePreparer prepares the ListByService request. -func (client RegionsClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { +func (client RegionClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -110,13 +110,13 @@ func (client RegionsClient) ListByServicePreparer(ctx context.Context, resourceG // ListByServiceSender sends the ListByService request. The method will close the // http.Response Body if it receives an error. -func (client RegionsClient) ListByServiceSender(req *http.Request) (*http.Response, error) { +func (client RegionClient) ListByServiceSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } // ListByServiceResponder handles the response to the ListByService request. The method always // closes the http.Response Body. -func (client RegionsClient) ListByServiceResponder(resp *http.Response) (result RegionListResult, err error) { +func (client RegionClient) ListByServiceResponder(resp *http.Response) (result RegionListResult, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -128,10 +128,10 @@ func (client RegionsClient) ListByServiceResponder(resp *http.Response) (result } // listByServiceNextResults retrieves the next set of results, if any. -func (client RegionsClient) listByServiceNextResults(ctx context.Context, lastResults RegionListResult) (result RegionListResult, err error) { +func (client RegionClient) listByServiceNextResults(ctx context.Context, lastResults RegionListResult) (result RegionListResult, err error) { req, err := lastResults.regionListResultPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "listByServiceNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.RegionClient", "listByServiceNextResults", nil, "Failure preparing next results request") } if req == nil { return @@ -139,19 +139,19 @@ func (client RegionsClient) listByServiceNextResults(ctx context.Context, lastRe resp, err := client.ListByServiceSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "listByServiceNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "apimanagement.RegionClient", "listByServiceNextResults", resp, "Failure sending next results request") } result, err = client.ListByServiceResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.RegionsClient", "listByServiceNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "apimanagement.RegionClient", "listByServiceNextResults", resp, "Failure responding to next results request") } return } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client RegionsClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string) (result RegionListResultIterator, err error) { +func (client RegionClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string) (result RegionListResultIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/RegionsClient.ListByService") + ctx = tracing.StartSpan(ctx, fqdn+"/RegionClient.ListByService") defer func() { sc := -1 if result.Response().Response.Response != nil { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/reports.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/reports.go similarity index 81% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/reports.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/reports.go index 87dc967439964..3ae3a62d3b246 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/reports.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/reports.go @@ -49,7 +49,8 @@ func NewReportsClientWithBaseURI(baseURI string, subscriptionID string) ReportsC // filter - the filter to apply on the operation. // top - number of records to return. // skip - number of records to skip. -func (client ReportsClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { +// orderby - oData order by query option. +func (client ReportsClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByAPI") defer func() { @@ -75,7 +76,7 @@ func (client ReportsClient) ListByAPI(ctx context.Context, resourceGroupName str } result.fn = client.listByAPINextResults - req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByAPIPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByAPI", nil, "Failure preparing request") return @@ -97,14 +98,14 @@ func (client ReportsClient) ListByAPI(ctx context.Context, resourceGroupName str } // ListByAPIPreparer prepares the ListByAPI request. -func (client ReportsClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client ReportsClient) ListByAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "$filter": autorest.Encode("query", filter), "api-version": APIVersion, @@ -115,6 +116,9 @@ func (client ReportsClient) ListByAPIPreparer(ctx context.Context, resourceGroup if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -165,7 +169,7 @@ func (client ReportsClient) listByAPINextResults(ctx context.Context, lastResult } // ListByAPIComplete enumerates all values, automatically crossing page boundaries as required. -func (client ReportsClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { +func (client ReportsClient) ListByAPIComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByAPI") defer func() { @@ -176,7 +180,7 @@ func (client ReportsClient) ListByAPIComplete(ctx context.Context, resourceGroup tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByAPI(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) return } @@ -184,7 +188,17 @@ func (client ReportsClient) ListByAPIComplete(ctx context.Context, resourceGroup // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - the filter to apply on the operation. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | | +//
| country | select | | |
| region | select | | |
| zip | select | | | +//
| apiRegion | filter | eq | |
| userId | filter | eq | |
| productId | filter | eq | +// |
| subscriptionId | filter | eq | |
| apiId | filter | eq | |
| operationId | filter +// | eq | |
| callCountSuccess | select | | |
| callCountBlocked | select | | | +//
| callCountFailed | select | | |
| callCountOther | select | | |
| bandwidth +// | select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select +// | | |
| apiTimeAvg | select | | |
| apiTimeMin | select | | |
| +// apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | +// select | | |
| serviceTimeMax | select | | |
// top - number of records to return. // skip - number of records to skip. func (client ReportsClient) ListByGeo(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { @@ -242,13 +256,11 @@ func (client ReportsClient) ListByGeoPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), "api-version": APIVersion, } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } @@ -324,10 +336,22 @@ func (client ReportsClient) ListByGeoComplete(ctx context.Context, resourceGroup // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - the filter to apply on the operation. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | | +//
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId | +// filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | | +//
| apiId | filter | eq | |
| operationId | select, filter | eq | |
| callCountSuccess +// | select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| +// callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | |
| +// callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | |
| +// cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | +// select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | +// |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| +// serviceTimeMax | select | | |
// top - number of records to return. // skip - number of records to skip. -func (client ReportsClient) ListByOperation(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { +// orderby - oData order by query option. +func (client ReportsClient) ListByOperation(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByOperation") defer func() { @@ -353,7 +377,7 @@ func (client ReportsClient) ListByOperation(ctx context.Context, resourceGroupNa } result.fn = client.listByOperationNextResults - req, err := client.ListByOperationPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByOperationPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByOperation", nil, "Failure preparing request") return @@ -375,14 +399,14 @@ func (client ReportsClient) ListByOperation(ctx context.Context, resourceGroupNa } // ListByOperationPreparer prepares the ListByOperation request. -func (client ReportsClient) ListByOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client ReportsClient) ListByOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "$filter": autorest.Encode("query", filter), "api-version": APIVersion, @@ -393,6 +417,9 @@ func (client ReportsClient) ListByOperationPreparer(ctx context.Context, resourc if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -443,7 +470,7 @@ func (client ReportsClient) listByOperationNextResults(ctx context.Context, last } // ListByOperationComplete enumerates all values, automatically crossing page boundaries as required. -func (client ReportsClient) ListByOperationComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { +func (client ReportsClient) ListByOperationComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByOperation") defer func() { @@ -454,7 +481,7 @@ func (client ReportsClient) ListByOperationComplete(ctx context.Context, resourc tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByOperation(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByOperation(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) return } @@ -462,10 +489,21 @@ func (client ReportsClient) ListByOperationComplete(ctx context.Context, resourc // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - the filter to apply on the operation. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | | +//
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId | +// filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | filter | eq | +// |
| callCountSuccess | select, orderBy | | |
| callCountBlocked | select, orderBy | | +// |
| callCountFailed | select, orderBy | | |
| callCountOther | select, orderBy | | +// |
| callCountTotal | select, orderBy | | |
| bandwidth | select, orderBy | | | +//
| cacheHitsCount | select | | |
| cacheMissCount | select | | |
| apiTimeAvg +// | select, orderBy | | |
| apiTimeMin | select | | |
| apiTimeMax | select | | +// |
| serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| +// serviceTimeMax | select | | |
// top - number of records to return. // skip - number of records to skip. -func (client ReportsClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { +// orderby - oData order by query option. +func (client ReportsClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByProduct") defer func() { @@ -491,7 +529,7 @@ func (client ReportsClient) ListByProduct(ctx context.Context, resourceGroupName } result.fn = client.listByProductNextResults - req, err := client.ListByProductPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByProductPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByProduct", nil, "Failure preparing request") return @@ -513,14 +551,14 @@ func (client ReportsClient) ListByProduct(ctx context.Context, resourceGroupName } // ListByProductPreparer prepares the ListByProduct request. -func (client ReportsClient) ListByProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client ReportsClient) ListByProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "$filter": autorest.Encode("query", filter), "api-version": APIVersion, @@ -531,6 +569,9 @@ func (client ReportsClient) ListByProductPreparer(ctx context.Context, resourceG if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -581,7 +622,7 @@ func (client ReportsClient) listByProductNextResults(ctx context.Context, lastRe } // ListByProductComplete enumerates all values, automatically crossing page boundaries as required. -func (client ReportsClient) ListByProductComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { +func (client ReportsClient) ListByProductComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByProduct") defer func() { @@ -592,7 +633,7 @@ func (client ReportsClient) ListByProductComplete(ctx context.Context, resourceG tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByProduct(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByProduct(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) return } @@ -600,7 +641,11 @@ func (client ReportsClient) ListByProductComplete(ctx context.Context, resourceG // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - the filter to apply on the operation. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | | +//
| apiId | filter | eq | |
| operationId | filter | eq | |
| productId | filter | eq | +// |
| userId | filter | eq | |
| apiRegion | filter | eq | |
| subscriptionId | filter +// | eq | |
// top - number of records to return. // skip - number of records to skip. func (client ReportsClient) ListByRequest(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result RequestReportCollection, err error) { @@ -657,7 +702,7 @@ func (client ReportsClient) ListByRequestPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "$filter": autorest.Encode("query", filter), "api-version": APIVersion, @@ -700,10 +745,21 @@ func (client ReportsClient) ListByRequestResponder(resp *http.Response) (result // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - the filter to apply on the operation. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | | +//
| displayName | select, orderBy | | |
| apiRegion | filter | eq | |
| userId | +// select, filter | eq | |
| productId | select, filter | eq | |
| subscriptionId | select, +// filter | eq | |
| callCountSuccess | select, orderBy | | |
| callCountBlocked | +// select, orderBy | | |
| callCountFailed | select, orderBy | | |
| callCountOther | +// select, orderBy | | |
| callCountTotal | select, orderBy | | |
| bandwidth | +// select, orderBy | | |
| cacheHitsCount | select | | |
| cacheMissCount | select | +// | |
| apiTimeAvg | select, orderBy | | |
| apiTimeMin | select | | |
| +// apiTimeMax | select | | |
| serviceTimeAvg | select | | |
| serviceTimeMin | +// select | | |
| serviceTimeMax | select | | |
// top - number of records to return. // skip - number of records to skip. -func (client ReportsClient) ListBySubscription(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { +// orderby - oData order by query option. +func (client ReportsClient) ListBySubscription(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListBySubscription") defer func() { @@ -729,7 +785,7 @@ func (client ReportsClient) ListBySubscription(ctx context.Context, resourceGrou } result.fn = client.listBySubscriptionNextResults - req, err := client.ListBySubscriptionPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListBySubscriptionPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListBySubscription", nil, "Failure preparing request") return @@ -751,26 +807,27 @@ func (client ReportsClient) ListBySubscription(ctx context.Context, resourceGrou } // ListBySubscriptionPreparer prepares the ListBySubscription request. -func (client ReportsClient) ListBySubscriptionPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client ReportsClient) ListBySubscriptionPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), "api-version": APIVersion, } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -821,7 +878,7 @@ func (client ReportsClient) listBySubscriptionNextResults(ctx context.Context, l } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client ReportsClient) ListBySubscriptionComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { +func (client ReportsClient) ListBySubscriptionComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListBySubscription") defer func() { @@ -832,7 +889,7 @@ func (client ReportsClient) ListBySubscriptionComplete(ctx context.Context, reso tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListBySubscription(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListBySubscription(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) return } @@ -840,13 +897,24 @@ func (client ReportsClient) ListBySubscriptionComplete(ctx context.Context, reso // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter, select | ge, le | +// |
| interval | select | | |
| apiRegion | filter | eq | |
| userId | filter | eq +// | |
| productId | filter | eq | |
| subscriptionId | filter | eq | |
| apiId | +// filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | select | | | +//
| callCountBlocked | select | | |
| callCountFailed | select | | |
| +// callCountOther | select | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount +// | select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select | | | +//
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| serviceTimeAvg | +// select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | select | | +// |
// interval - by time interval. Interval must be multiple of 15 minutes and may not be zero. The value should // be in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert -// TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)) -// filter - the filter to apply on the operation. +// TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). // top - number of records to return. // skip - number of records to skip. -func (client ReportsClient) ListByTime(ctx context.Context, resourceGroupName string, serviceName string, interval string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { +// orderby - oData order by query option. +func (client ReportsClient) ListByTime(ctx context.Context, resourceGroupName string, serviceName string, filter string, interval string, top *int32, skip *int32, orderby string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByTime") defer func() { @@ -872,7 +940,7 @@ func (client ReportsClient) ListByTime(ctx context.Context, resourceGroupName st } result.fn = client.listByTimeNextResults - req, err := client.ListByTimePreparer(ctx, resourceGroupName, serviceName, interval, filter, top, skip) + req, err := client.ListByTimePreparer(ctx, resourceGroupName, serviceName, filter, interval, top, skip, orderby) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByTime", nil, "Failure preparing request") return @@ -894,27 +962,28 @@ func (client ReportsClient) ListByTime(ctx context.Context, resourceGroupName st } // ListByTimePreparer prepares the ListByTime request. -func (client ReportsClient) ListByTimePreparer(ctx context.Context, resourceGroupName string, serviceName string, interval string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client ReportsClient) ListByTimePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, interval string, top *int32, skip *int32, orderby string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), "api-version": APIVersion, "interval": autorest.Encode("query", interval), } - if len(filter) > 0 { - queryParameters["$filter"] = autorest.Encode("query", filter) - } if top != nil { queryParameters["$top"] = autorest.Encode("query", *top) } if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -965,7 +1034,7 @@ func (client ReportsClient) listByTimeNextResults(ctx context.Context, lastResul } // ListByTimeComplete enumerates all values, automatically crossing page boundaries as required. -func (client ReportsClient) ListByTimeComplete(ctx context.Context, resourceGroupName string, serviceName string, interval string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { +func (client ReportsClient) ListByTimeComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, interval string, top *int32, skip *int32, orderby string) (result ReportCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByTime") defer func() { @@ -976,7 +1045,7 @@ func (client ReportsClient) ListByTimeComplete(ctx context.Context, resourceGrou tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByTime(ctx, resourceGroupName, serviceName, interval, filter, top, skip) + result.page, err = client.ListByTime(ctx, resourceGroupName, serviceName, filter, interval, top, skip, orderby) return } @@ -984,10 +1053,22 @@ func (client ReportsClient) ListByTimeComplete(ctx context.Context, resourceGrou // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - the filter to apply on the operation. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| timestamp | filter | ge, le | | +//
| displayName | select, orderBy | | |
| userId | select, filter | eq | |
| +// apiRegion | filter | eq | |
| productId | filter | eq | |
| subscriptionId | filter | eq | +// |
| apiId | filter | eq | |
| operationId | filter | eq | |
| callCountSuccess | +// select, orderBy | | |
| callCountBlocked | select, orderBy | | |
| callCountFailed +// | select, orderBy | | |
| callCountOther | select, orderBy | | |
| callCountTotal +// | select, orderBy | | |
| bandwidth | select, orderBy | | |
| cacheHitsCount | +// select | | |
| cacheMissCount | select | | |
| apiTimeAvg | select, orderBy | +// | |
| apiTimeMin | select | | |
| apiTimeMax | select | | |
| +// serviceTimeAvg | select | | |
| serviceTimeMin | select | | |
| serviceTimeMax | +// select | | |
// top - number of records to return. // skip - number of records to skip. -func (client ReportsClient) ListByUser(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionPage, err error) { +// orderby - oData order by query option. +func (client ReportsClient) ListByUser(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByUser") defer func() { @@ -1013,7 +1094,7 @@ func (client ReportsClient) ListByUser(ctx context.Context, resourceGroupName st } result.fn = client.listByUserNextResults - req, err := client.ListByUserPreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByUserPreparer(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.ReportsClient", "ListByUser", nil, "Failure preparing request") return @@ -1035,14 +1116,14 @@ func (client ReportsClient) ListByUser(ctx context.Context, resourceGroupName st } // ListByUserPreparer prepares the ListByUser request. -func (client ReportsClient) ListByUserPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client ReportsClient) ListByUserPreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "$filter": autorest.Encode("query", filter), "api-version": APIVersion, @@ -1053,6 +1134,9 @@ func (client ReportsClient) ListByUserPreparer(ctx context.Context, resourceGrou if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -1103,7 +1187,7 @@ func (client ReportsClient) listByUserNextResults(ctx context.Context, lastResul } // ListByUserComplete enumerates all values, automatically crossing page boundaries as required. -func (client ReportsClient) ListByUserComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result ReportCollectionIterator, err error) { +func (client ReportsClient) ListByUserComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, orderby string) (result ReportCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.ListByUser") defer func() { @@ -1114,6 +1198,6 @@ func (client ReportsClient) ListByUserComplete(ctx context.Context, resourceGrou tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByUser(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByUser(ctx, resourceGroupName, serviceName, filter, top, skip, orderby) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/service.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/service.go similarity index 82% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/service.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/service.go index 3bbf589f6c0ee..dde5f5e9622be 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/service.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/service.go @@ -92,7 +92,7 @@ func (client ServiceClient) ApplyNetworkConfigurationUpdatesPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -188,7 +188,7 @@ func (client ServiceClient) BackupPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -275,7 +275,7 @@ func (client ServiceClient) CheckNameAvailabilityPreparer(ctx context.Context, p "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -338,9 +338,8 @@ func (client ServiceClient) CreateOrUpdate(ctx context.Context, resourceGroupNam {Target: "parameters.ServiceProperties.PublisherName", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.ServiceProperties.PublisherName", Name: validation.MaxLength, Rule: 100, Chain: nil}}}, }}, - {Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.Identity", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.Identity.Type", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Sku", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.ServiceClient", "CreateOrUpdate", err.Error()) } @@ -368,7 +367,7 @@ func (client ServiceClient) CreateOrUpdatePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -413,13 +412,13 @@ func (client ServiceClient) CreateOrUpdateResponder(resp *http.Response) (result // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -func (client ServiceClient) Delete(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) { +func (client ServiceClient) Delete(ctx context.Context, resourceGroupName string, serviceName string) (result ServiceDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.Delete") defer func() { sc := -1 - if result.Response != nil { - sc = result.Response.StatusCode + if result.Response() != nil { + sc = result.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -438,18 +437,12 @@ func (client ServiceClient) Delete(ctx context.Context, resourceGroupName string return } - resp, err := client.DeleteSender(req) + result, err = client.DeleteSender(req) if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Delete", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Delete", result.Response(), "Failure sending request") return } - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "Delete", resp, "Failure responding to request") - } - return } @@ -461,7 +454,7 @@ func (client ServiceClient) DeletePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -476,19 +469,26 @@ func (client ServiceClient) DeletePreparer(ctx context.Context, resourceGroupNam // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. -func (client ServiceClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client ServiceClient) DeleteSender(req *http.Request) (future ServiceDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return } // DeleteResponder handles the response to the Delete request. The method always // closes the http.Response Body. -func (client ServiceClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { +func (client ServiceClient) DeleteResponder(resp *http.Response) (result ServiceResource, err error) { err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) - result.Response = resp + result.Response = autorest.Response{Response: resp} return } @@ -544,7 +544,7 @@ func (client ServiceClient) GetPreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -628,7 +628,7 @@ func (client ServiceClient) GetSsoTokenPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -700,7 +700,7 @@ func (client ServiceClient) ListPreparer(ctx context.Context) (*http.Request, er "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -812,7 +812,7 @@ func (client ServiceClient) ListByResourceGroupPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -934,7 +934,7 @@ func (client ServiceClient) RestorePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1021,7 +1021,7 @@ func (client ServiceClient) UpdatePreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1061,183 +1061,3 @@ func (client ServiceClient) UpdateResponder(resp *http.Response) (result Service result.Response = autorest.Response{Response: resp} return } - -// UpdateHostname creates, updates, or deletes the custom hostnames for an API Management service. The custom hostname -// can be applied to the Proxy and Portal endpoint. This is a long running operation and could take several minutes to -// complete. This operation will be deprecated in the next version update. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// parameters - parameters supplied to the UpdateHostname operation. -func (client ServiceClient) UpdateHostname(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUpdateHostnameParameters) (result ServiceUpdateHostnameFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.UpdateHostname") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.ServiceClient", "UpdateHostname", err.Error()) - } - - req, err := client.UpdateHostnamePreparer(ctx, resourceGroupName, serviceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UpdateHostname", nil, "Failure preparing request") - return - } - - result, err = client.UpdateHostnameSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UpdateHostname", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdateHostnamePreparer prepares the UpdateHostname request. -func (client ServiceClient) UpdateHostnamePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUpdateHostnameParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/updatehostname", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UpdateHostnameSender sends the UpdateHostname request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceClient) UpdateHostnameSender(req *http.Request) (future ServiceUpdateHostnameFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// UpdateHostnameResponder handles the response to the UpdateHostname request. The method always -// closes the http.Response Body. -func (client ServiceClient) UpdateHostnameResponder(resp *http.Response) (result ServiceResource, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// UploadCertificate upload Custom Domain SSL certificate for an API Management service. This operation will be -// deprecated in future releases. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -// parameters - parameters supplied to the Upload SSL certificate for an API Management service operation. -func (client ServiceClient) UploadCertificate(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUploadCertificateParameters) (result CertificateInformation, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceClient.UploadCertificate") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Certificate", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.CertificatePassword", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.ServiceClient", "UploadCertificate", err.Error()) - } - - req, err := client.UploadCertificatePreparer(ctx, resourceGroupName, serviceName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UploadCertificate", nil, "Failure preparing request") - return - } - - resp, err := client.UploadCertificateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UploadCertificate", resp, "Failure sending request") - return - } - - result, err = client.UploadCertificateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.ServiceClient", "UploadCertificate", resp, "Failure responding to request") - } - - return -} - -// UploadCertificatePreparer prepares the UploadCertificate request. -func (client ServiceClient) UploadCertificatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUploadCertificateParameters) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/updatecertificate", pathParameters), - autorest.WithJSON(parameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// UploadCertificateSender sends the UploadCertificate request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceClient) UploadCertificateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// UploadCertificateResponder handles the response to the UploadCertificate request. The method always -// closes the http.Response Body. -func (client ServiceClient) UploadCertificateResponder(resp *http.Response) (result CertificateInformation, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/serviceskus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/serviceskus.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/serviceskus.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/serviceskus.go index 6b3540f383c2a..c3c17473b5db5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/serviceskus.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/serviceskus.go @@ -95,7 +95,7 @@ func (client ServiceSkusClient) ListAvailableServiceSkusPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/signinsettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/signinsettings.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/signinsettings.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/signinsettings.go index 931c31185682d..cf617ede92b39 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/signinsettings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/signinsettings.go @@ -47,7 +47,8 @@ func NewSignInSettingsClientWithBaseURI(baseURI string, subscriptionID string) S // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // parameters - create or update parameters. -func (client SignInSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings) (result PortalSigninSettings, err error) { +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client SignInSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings, ifMatch string) (result PortalSigninSettings, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SignInSettingsClient.CreateOrUpdate") defer func() { @@ -66,7 +67,7 @@ func (client SignInSettingsClient) CreateOrUpdate(ctx context.Context, resourceG return result, validation.NewError("apimanagement.SignInSettingsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.SignInSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -88,14 +89,14 @@ func (client SignInSettingsClient) CreateOrUpdate(ctx context.Context, resourceG } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SignInSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings) (*http.Request, error) { +func (client SignInSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -107,6 +108,10 @@ func (client SignInSettingsClient) CreateOrUpdatePreparer(ctx context.Context, r autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signin", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -129,7 +134,7 @@ func (client SignInSettingsClient) CreateOrUpdateResponder(resp *http.Response) return } -// Get get Sign-In settings. +// Get get Sign In Settings for the Portal // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -181,7 +186,7 @@ func (client SignInSettingsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -265,7 +270,7 @@ func (client SignInSettingsClient) GetEntityTagPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -351,7 +356,7 @@ func (client SignInSettingsClient) UpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/signupsettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/signupsettings.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/signupsettings.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/signupsettings.go index 94f5f7009f761..68fbe636935dc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/signupsettings.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/signupsettings.go @@ -47,7 +47,8 @@ func NewSignUpSettingsClientWithBaseURI(baseURI string, subscriptionID string) S // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // parameters - create or update parameters. -func (client SignUpSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings) (result PortalSignupSettings, err error) { +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client SignUpSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings, ifMatch string) (result PortalSignupSettings, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SignUpSettingsClient.CreateOrUpdate") defer func() { @@ -66,7 +67,7 @@ func (client SignUpSettingsClient) CreateOrUpdate(ctx context.Context, resourceG return result, validation.NewError("apimanagement.SignUpSettingsClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.SignUpSettingsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -88,14 +89,14 @@ func (client SignUpSettingsClient) CreateOrUpdate(ctx context.Context, resourceG } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SignUpSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings) (*http.Request, error) { +func (client SignUpSettingsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -107,6 +108,10 @@ func (client SignUpSettingsClient) CreateOrUpdatePreparer(ctx context.Context, r autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalsettings/signup", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -129,7 +134,7 @@ func (client SignUpSettingsClient) CreateOrUpdateResponder(resp *http.Response) return } -// Get get Sign-Up settings. +// Get get Sign Up Settings for the Portal // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -181,7 +186,7 @@ func (client SignUpSettingsClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -265,7 +270,7 @@ func (client SignUpSettingsClient) GetEntityTagPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -351,7 +356,7 @@ func (client SignUpSettingsClient) UpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/subscription.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/subscription.go similarity index 85% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/subscription.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/subscription.go index 08ef61b822174..f026e7eef3efd 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/subscription.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/subscription.go @@ -70,12 +70,11 @@ func (client SubscriptionClient) CreateOrUpdate(ctx context.Context, resourceGro {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SubscriptionCreateParameterProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.SubscriptionCreateParameterProperties.UserID", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "parameters.SubscriptionCreateParameterProperties.ProductID", Name: validation.Null, Rule: true, Chain: nil}, + Chain: []validation.Constraint{{Target: "parameters.SubscriptionCreateParameterProperties.Scope", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.SubscriptionCreateParameterProperties.DisplayName", Name: validation.Null, Rule: true, Chain: []validation.Constraint{{Target: "parameters.SubscriptionCreateParameterProperties.DisplayName", Name: validation.MaxLength, Rule: 100, Chain: nil}, {Target: "parameters.SubscriptionCreateParameterProperties.DisplayName", Name: validation.MinLength, Rule: 1, Chain: nil}, @@ -122,7 +121,7 @@ func (client SubscriptionClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -188,8 +187,8 @@ func (client SubscriptionClient) Delete(ctx context.Context, resourceGroupName s {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.SubscriptionClient", "Delete", err.Error()) } @@ -223,7 +222,7 @@ func (client SubscriptionClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -278,8 +277,8 @@ func (client SubscriptionClient) Get(ctx context.Context, resourceGroupName stri {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.SubscriptionClient", "Get", err.Error()) } @@ -313,7 +312,7 @@ func (client SubscriptionClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -368,8 +367,8 @@ func (client SubscriptionClient) GetEntityTag(ctx context.Context, resourceGroup {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.SubscriptionClient", "GetEntityTag", err.Error()) } @@ -403,7 +402,7 @@ func (client SubscriptionClient) GetEntityTagPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -438,14 +437,15 @@ func (client SubscriptionClient) GetEntityTagResponder(resp *http.Response) (res // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |--------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| state | filter | eq | |
| user | expand | | |
// top - number of records to return. // skip - number of records to skip. func (client SubscriptionClient) List(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result SubscriptionCollectionPage, err error) { @@ -503,7 +503,7 @@ func (client SubscriptionClient) ListPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -581,6 +581,96 @@ func (client SubscriptionClient) ListComplete(ctx context.Context, resourceGroup return } +// ListSecrets gets the subscription keys. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// sid - subscription entity Identifier. The entity represents the association between a user and a product in +// API Management. +func (client SubscriptionClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, sid string) (result SubscriptionKeysContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: sid, + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.SubscriptionClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName, sid) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.SubscriptionClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client SubscriptionClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string, sid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "sid": autorest.Encode("path", sid), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/subscriptions/{sid}/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client SubscriptionClient) ListSecretsResponder(resp *http.Response) (result SubscriptionKeysContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // RegeneratePrimaryKey regenerates primary key of existing subscription of the API Management service instance. // Parameters: // resourceGroupName - the name of the resource group. @@ -604,8 +694,8 @@ func (client SubscriptionClient) RegeneratePrimaryKey(ctx context.Context, resou {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.SubscriptionClient", "RegeneratePrimaryKey", err.Error()) } @@ -639,7 +729,7 @@ func (client SubscriptionClient) RegeneratePrimaryKeyPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -693,8 +783,8 @@ func (client SubscriptionClient) RegenerateSecondaryKey(ctx context.Context, res {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.SubscriptionClient", "RegenerateSecondaryKey", err.Error()) } @@ -728,7 +818,7 @@ func (client SubscriptionClient) RegenerateSecondaryKeyPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -788,8 +878,8 @@ func (client SubscriptionClient) Update(ctx context.Context, resourceGroupName s {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: sid, - Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "sid", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "sid", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "sid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.SubscriptionClient", "Update", err.Error()) } @@ -823,7 +913,7 @@ func (client SubscriptionClient) UpdatePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tag.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tag.go similarity index 92% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tag.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tag.go index 719743e711811..6b08874f5e5e4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tag.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tag.go @@ -49,8 +49,7 @@ func NewTagClientWithBaseURI(baseURI string, subscriptionID string) TagClient { // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. // tagID - tag identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client TagClient) AssignToAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (result TagContract, err error) { +func (client TagClient) AssignToAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (result TagContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.AssignToAPI") defer func() { @@ -73,11 +72,11 @@ func (client TagClient) AssignToAPI(ctx context.Context, resourceGroupName strin {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "AssignToAPI", err.Error()) } - req, err := client.AssignToAPIPreparer(ctx, resourceGroupName, serviceName, apiid, tagID, ifMatch) + req, err := client.AssignToAPIPreparer(ctx, resourceGroupName, serviceName, apiid, tagID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToAPI", nil, "Failure preparing request") return @@ -99,7 +98,7 @@ func (client TagClient) AssignToAPI(ctx context.Context, resourceGroupName strin } // AssignToAPIPreparer prepares the AssignToAPI request. -func (client TagClient) AssignToAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (*http.Request, error) { +func (client TagClient) AssignToAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -108,7 +107,7 @@ func (client TagClient) AssignToAPIPreparer(ctx context.Context, resourceGroupNa "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -118,10 +117,6 @@ func (client TagClient) AssignToAPIPreparer(ctx context.Context, resourceGroupNa autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}", pathParameters), autorest.WithQueryParameters(queryParameters)) - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -153,8 +148,7 @@ func (client TagClient) AssignToAPIResponder(resp *http.Response) (result TagCon // operationID - operation identifier within an API. Must be unique in the current API Management service // instance. // tagID - tag identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client TagClient) AssignToOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string, ifMatch string) (result TagContract, err error) { +func (client TagClient) AssignToOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string) (result TagContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.AssignToOperation") defer func() { @@ -176,16 +170,15 @@ func (client TagClient) AssignToOperation(ctx context.Context, resourceGroupName {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "AssignToOperation", err.Error()) } - req, err := client.AssignToOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, tagID, ifMatch) + req, err := client.AssignToOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, tagID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToOperation", nil, "Failure preparing request") return @@ -207,7 +200,7 @@ func (client TagClient) AssignToOperation(ctx context.Context, resourceGroupName } // AssignToOperationPreparer prepares the AssignToOperation request. -func (client TagClient) AssignToOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string, ifMatch string) (*http.Request, error) { +func (client TagClient) AssignToOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "operationId": autorest.Encode("path", operationID), @@ -217,7 +210,7 @@ func (client TagClient) AssignToOperationPreparer(ctx context.Context, resourceG "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -227,10 +220,6 @@ func (client TagClient) AssignToOperationPreparer(ctx context.Context, resourceG autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}", pathParameters), autorest.WithQueryParameters(queryParameters)) - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -259,8 +248,7 @@ func (client TagClient) AssignToOperationResponder(resp *http.Response) (result // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. // tagID - tag identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client TagClient) AssignToProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, ifMatch string) (result TagContract, err error) { +func (client TagClient) AssignToProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string) (result TagContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.AssignToProduct") defer func() { @@ -277,17 +265,16 @@ func (client TagClient) AssignToProduct(ctx context.Context, resourceGroupName s {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "AssignToProduct", err.Error()) } - req, err := client.AssignToProductPreparer(ctx, resourceGroupName, serviceName, productID, tagID, ifMatch) + req, err := client.AssignToProductPreparer(ctx, resourceGroupName, serviceName, productID, tagID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "AssignToProduct", nil, "Failure preparing request") return @@ -309,7 +296,7 @@ func (client TagClient) AssignToProduct(ctx context.Context, resourceGroupName s } // AssignToProductPreparer prepares the AssignToProduct request. -func (client TagClient) AssignToProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, ifMatch string) (*http.Request, error) { +func (client TagClient) AssignToProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "productId": autorest.Encode("path", productID), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -318,7 +305,7 @@ func (client TagClient) AssignToProductPreparer(ctx context.Context, resourceGro "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -328,10 +315,6 @@ func (client TagClient) AssignToProductPreparer(ctx context.Context, resourceGro autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}", pathParameters), autorest.WithQueryParameters(queryParameters)) - if len(ifMatch) > 0 { - preparer = autorest.DecoratePreparer(preparer, - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -360,7 +343,8 @@ func (client TagClient) AssignToProductResponder(resp *http.Response) (result Ta // serviceName - the name of the API Management service. // tagID - tag identifier. Must be unique in the current API Management service instance. // parameters - create parameters. -func (client TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters) (result TagContract, err error) { +// ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. +func (client TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters, ifMatch string) (result TagContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.CreateOrUpdate") defer func() { @@ -379,7 +363,7 @@ func (client TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName st {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.TagContractProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.TagContractProperties.DisplayName", Name: validation.Null, Rule: true, @@ -390,7 +374,7 @@ func (client TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName st return result, validation.NewError("apimanagement.TagClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, tagID, parameters) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, tagID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -412,7 +396,7 @@ func (client TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName st } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client TagClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters) (*http.Request, error) { +func (client TagClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), @@ -420,7 +404,7 @@ func (client TagClient) CreateOrUpdatePreparer(ctx context.Context, resourceGrou "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -432,6 +416,10 @@ func (client TagClient) CreateOrUpdatePreparer(ctx context.Context, resourceGrou autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tags/{tagId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -480,7 +468,7 @@ func (client TagClient) Delete(ctx context.Context, resourceGroupName string, se {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "Delete", err.Error()) } @@ -514,7 +502,7 @@ func (client TagClient) DeletePreparer(ctx context.Context, resourceGroupName st "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -553,9 +541,7 @@ func (client TagClient) DeleteResponder(resp *http.Response) (result autorest.Re // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. // tagID - tag identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET -// request or it should be * for unconditional update. -func (client TagClient) DetachFromAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (result autorest.Response, err error) { +func (client TagClient) DetachFromAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.DetachFromAPI") defer func() { @@ -578,11 +564,11 @@ func (client TagClient) DetachFromAPI(ctx context.Context, resourceGroupName str {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "DetachFromAPI", err.Error()) } - req, err := client.DetachFromAPIPreparer(ctx, resourceGroupName, serviceName, apiid, tagID, ifMatch) + req, err := client.DetachFromAPIPreparer(ctx, resourceGroupName, serviceName, apiid, tagID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromAPI", nil, "Failure preparing request") return @@ -604,7 +590,7 @@ func (client TagClient) DetachFromAPI(ctx context.Context, resourceGroupName str } // DetachFromAPIPreparer prepares the DetachFromAPI request. -func (client TagClient) DetachFromAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string, ifMatch string) (*http.Request, error) { +func (client TagClient) DetachFromAPIPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, tagID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -613,7 +599,7 @@ func (client TagClient) DetachFromAPIPreparer(ctx context.Context, resourceGroup "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -622,8 +608,7 @@ func (client TagClient) DetachFromAPIPreparer(ctx context.Context, resourceGroup autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/tags/{tagId}", pathParameters), - autorest.WithQueryParameters(queryParameters), - autorest.WithHeader("If-Match", autorest.String(ifMatch))) + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -654,9 +639,7 @@ func (client TagClient) DetachFromAPIResponder(resp *http.Response) (result auto // operationID - operation identifier within an API. Must be unique in the current API Management service // instance. // tagID - tag identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET -// request or it should be * for unconditional update. -func (client TagClient) DetachFromOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string, ifMatch string) (result autorest.Response, err error) { +func (client TagClient) DetachFromOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.DetachFromOperation") defer func() { @@ -678,16 +661,15 @@ func (client TagClient) DetachFromOperation(ctx context.Context, resourceGroupNa {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "DetachFromOperation", err.Error()) } - req, err := client.DetachFromOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, tagID, ifMatch) + req, err := client.DetachFromOperationPreparer(ctx, resourceGroupName, serviceName, apiid, operationID, tagID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromOperation", nil, "Failure preparing request") return @@ -709,7 +691,7 @@ func (client TagClient) DetachFromOperation(ctx context.Context, resourceGroupNa } // DetachFromOperationPreparer prepares the DetachFromOperation request. -func (client TagClient) DetachFromOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string, ifMatch string) (*http.Request, error) { +func (client TagClient) DetachFromOperationPreparer(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, tagID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "apiId": autorest.Encode("path", apiid), "operationId": autorest.Encode("path", operationID), @@ -719,7 +701,7 @@ func (client TagClient) DetachFromOperationPreparer(ctx context.Context, resourc "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -728,8 +710,7 @@ func (client TagClient) DetachFromOperationPreparer(ctx context.Context, resourc autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/operations/{operationId}/tags/{tagId}", pathParameters), - autorest.WithQueryParameters(queryParameters), - autorest.WithHeader("If-Match", autorest.String(ifMatch))) + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -757,9 +738,7 @@ func (client TagClient) DetachFromOperationResponder(resp *http.Response) (resul // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. // tagID - tag identifier. Must be unique in the current API Management service instance. -// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET -// request or it should be * for unconditional update. -func (client TagClient) DetachFromProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, ifMatch string) (result autorest.Response, err error) { +func (client TagClient) DetachFromProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.DetachFromProduct") defer func() { @@ -776,17 +755,16 @@ func (client TagClient) DetachFromProduct(ctx context.Context, resourceGroupName {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "DetachFromProduct", err.Error()) } - req, err := client.DetachFromProductPreparer(ctx, resourceGroupName, serviceName, productID, tagID, ifMatch) + req, err := client.DetachFromProductPreparer(ctx, resourceGroupName, serviceName, productID, tagID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "DetachFromProduct", nil, "Failure preparing request") return @@ -808,7 +786,7 @@ func (client TagClient) DetachFromProduct(ctx context.Context, resourceGroupName } // DetachFromProductPreparer prepares the DetachFromProduct request. -func (client TagClient) DetachFromProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, ifMatch string) (*http.Request, error) { +func (client TagClient) DetachFromProductPreparer(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "productId": autorest.Encode("path", productID), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -817,7 +795,7 @@ func (client TagClient) DetachFromProductPreparer(ctx context.Context, resourceG "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -826,8 +804,7 @@ func (client TagClient) DetachFromProductPreparer(ctx context.Context, resourceG autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/tags/{tagId}", pathParameters), - autorest.WithQueryParameters(queryParameters), - autorest.WithHeader("If-Match", autorest.String(ifMatch))) + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -873,7 +850,7 @@ func (client TagClient) Get(ctx context.Context, resourceGroupName string, servi {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "Get", err.Error()) } @@ -907,7 +884,7 @@ func (client TagClient) GetPreparer(ctx context.Context, resourceGroupName strin "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -969,7 +946,7 @@ func (client TagClient) GetByAPI(ctx context.Context, resourceGroupName string, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetByAPI", err.Error()) } @@ -1004,7 +981,7 @@ func (client TagClient) GetByAPIPreparer(ctx context.Context, resourceGroupName "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1067,12 +1044,11 @@ func (client TagClient) GetByOperation(ctx context.Context, resourceGroupName st {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetByOperation", err.Error()) } @@ -1108,7 +1084,7 @@ func (client TagClient) GetByOperationPreparer(ctx context.Context, resourceGrou "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1163,13 +1139,12 @@ func (client TagClient) GetByProduct(ctx context.Context, resourceGroupName stri {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetByProduct", err.Error()) } @@ -1204,7 +1179,7 @@ func (client TagClient) GetByProductPreparer(ctx context.Context, resourceGroupN "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1260,7 +1235,7 @@ func (client TagClient) GetEntityState(ctx context.Context, resourceGroupName st {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetEntityState", err.Error()) } @@ -1294,7 +1269,7 @@ func (client TagClient) GetEntityStatePreparer(ctx context.Context, resourceGrou "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1355,7 +1330,7 @@ func (client TagClient) GetEntityStateByAPI(ctx context.Context, resourceGroupNa {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetEntityStateByAPI", err.Error()) } @@ -1390,7 +1365,7 @@ func (client TagClient) GetEntityStateByAPIPreparer(ctx context.Context, resourc "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1452,12 +1427,11 @@ func (client TagClient) GetEntityStateByOperation(ctx context.Context, resourceG {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetEntityStateByOperation", err.Error()) } @@ -1493,7 +1467,7 @@ func (client TagClient) GetEntityStateByOperationPreparer(ctx context.Context, r "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1547,13 +1521,12 @@ func (client TagClient) GetEntityStateByProduct(ctx context.Context, resourceGro {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "GetEntityStateByProduct", err.Error()) } @@ -1588,7 +1561,7 @@ func (client TagClient) GetEntityStateByProductPreparer(ctx context.Context, res "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1625,10 +1598,10 @@ func (client TagClient) GetEntityStateByProductResponder(resp *http.Response) (r // serviceName - the name of the API Management service. // apiid - API revision identifier. Must be unique in the current API Management service instance. Non-current // revision has ;rev=n as a suffix where n is the revision number. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client TagClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiid string, filter string, top *int32, skip *int32) (result TagCollectionPage, err error) { @@ -1691,7 +1664,7 @@ func (client TagClient) ListByAPIPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1777,13 +1750,10 @@ func (client TagClient) ListByAPIComplete(ctx context.Context, resourceGroupName // revision has ;rev=n as a suffix where n is the revision number. // operationID - operation identifier within an API. Must be unique in the current API Management service // instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client TagClient) ListByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiid string, operationID string, filter string, top *int32, skip *int32) (result TagCollectionPage, err error) { @@ -1808,8 +1778,7 @@ func (client TagClient) ListByOperation(ctx context.Context, resourceGroupName s {Target: "apiid", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}, {TargetValue: operationID, Constraints: []validation.Constraint{{Target: "operationID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "operationID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {Target: "operationID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -1851,7 +1820,7 @@ func (client TagClient) ListByOperationPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1934,10 +1903,10 @@ func (client TagClient) ListByOperationComplete(ctx context.Context, resourceGro // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. // productID - product identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| displayName | filter | ge, le, eq, ne, +// gt, lt | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. func (client TagClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, filter string, top *int32, skip *int32) (result TagCollectionPage, err error) { @@ -1957,9 +1926,8 @@ func (client TagClient) ListByProduct(ctx context.Context, resourceGroupName str {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: productID, - Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "productID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + Constraints: []validation.Constraint{{Target: "productID", Name: validation.MaxLength, Rule: 256, Chain: nil}, + {Target: "productID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -2000,7 +1968,7 @@ func (client TagClient) ListByProductPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2082,13 +2050,14 @@ func (client TagClient) ListByProductComplete(ctx context.Context, resourceGroup // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client TagClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagCollectionPage, err error) { +// scope - scope like 'apis', 'products' or 'apis/{apiId} +func (client TagClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, scope string) (result TagCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.ListByService") defer func() { @@ -2114,7 +2083,7 @@ func (client TagClient) ListByService(ctx context.Context, resourceGroupName str } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, scope) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.TagClient", "ListByService", nil, "Failure preparing request") return @@ -2136,14 +2105,14 @@ func (client TagClient) ListByService(ctx context.Context, resourceGroupName str } // ListByServicePreparer prepares the ListByService request. -func (client TagClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client TagClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, scope string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -2156,6 +2125,9 @@ func (client TagClient) ListByServicePreparer(ctx context.Context, resourceGroup if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if len(scope) > 0 { + queryParameters["scope"] = autorest.Encode("query", scope) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -2206,7 +2178,7 @@ func (client TagClient) listByServiceNextResults(ctx context.Context, lastResult } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client TagClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagCollectionIterator, err error) { +func (client TagClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, scope string) (result TagCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/TagClient.ListByService") defer func() { @@ -2217,7 +2189,7 @@ func (client TagClient) ListByServiceComplete(ctx context.Context, resourceGroup tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, scope) return } @@ -2248,7 +2220,7 @@ func (client TagClient) Update(ctx context.Context, resourceGroupName string, se {TargetValue: tagID, Constraints: []validation.Constraint{{Target: "tagID", Name: validation.MaxLength, Rule: 80, Chain: nil}, {Target: "tagID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "tagID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {Target: "tagID", Name: validation.Pattern, Rule: `^[^*#&+:<>?]+$`, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.TagClient", "Update", err.Error()) } @@ -2282,7 +2254,7 @@ func (client TagClient) UpdatePreparer(ctx context.Context, resourceGroupName st "tagId": autorest.Encode("path", tagID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tagresource.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tagresource.go similarity index 85% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tagresource.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tagresource.go index 62061d0a10d92..e57157bb3d3dc 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tagresource.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tagresource.go @@ -46,21 +46,19 @@ func NewTagResourceClientWithBaseURI(baseURI string, subscriptionID string) TagR // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | aid | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | apiName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | apiRevision | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | path | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | serviceUrl | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | method | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | urlTemplate | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | terms | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | isCurrent | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| aid | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| name | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| apiName | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| apiRevision | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, +// endswith |
| description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, +// endswith |
| serviceUrl | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith +// |
| method | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| +// urlTemplate | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| terms | +// filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith |
| state | filter | eq | +// |
| isCurrent | filter | eq | |
// top - number of records to return. // skip - number of records to skip. func (client TagResourceClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result TagResourceCollectionPage, err error) { @@ -118,7 +116,7 @@ func (client TagResourceClient) ListByServicePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantaccess.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantaccess.go similarity index 68% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantaccess.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantaccess.go index db66e144ee937..6373c5a369ee5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantaccess.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantaccess.go @@ -42,7 +42,7 @@ func NewTenantAccessClientWithBaseURI(baseURI string, subscriptionID string) Ten return TenantAccessClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get get tenant access information details. +// Get get tenant access information details without secrets. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -95,7 +95,7 @@ func (client TenantAccessClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -127,7 +127,176 @@ func (client TenantAccessClient) GetResponder(resp *http.Response) (result Acces return } -// RegeneratePrimaryKey regenerate primary access key. +// GetEntityTag tenant access metadata +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client TenantAccessClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TenantAccessClient.GetEntityTag") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantAccessClient", "GetEntityTag", err.Error()) + } + + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "GetEntityTag", nil, "Failure preparing request") + return + } + + resp, err := client.GetEntityTagSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "GetEntityTag", resp, "Failure sending request") + return + } + + result, err = client.GetEntityTagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "GetEntityTag", resp, "Failure responding to request") + } + + return +} + +// GetEntityTagPreparer prepares the GetEntityTag request. +func (client TenantAccessClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accessName": autorest.Encode("path", "access"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsHead(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEntityTagSender sends the GetEntityTag request. The method will close the +// http.Response Body if it receives an error. +func (client TenantAccessClient) GetEntityTagSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetEntityTagResponder handles the response to the GetEntityTag request. The method always +// closes the http.Response Body. +func (client TenantAccessClient) GetEntityTagResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListSecrets get tenant access information details. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client TenantAccessClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string) (result AccessInformationContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TenantAccessClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantAccessClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client TenantAccessClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accessName": autorest.Encode("path", "access"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client TenantAccessClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client TenantAccessClient) ListSecretsResponder(resp *http.Response) (result AccessInformationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegeneratePrimaryKey regenerate primary access key // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -180,7 +349,7 @@ func (client TenantAccessClient) RegeneratePrimaryKeyPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -211,7 +380,7 @@ func (client TenantAccessClient) RegeneratePrimaryKeyResponder(resp *http.Respon return } -// RegenerateSecondaryKey regenerate secondary access key. +// RegenerateSecondaryKey regenerate secondary access key // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -264,7 +433,7 @@ func (client TenantAccessClient) RegenerateSecondaryKeyPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -351,7 +520,7 @@ func (client TenantAccessClient) UpdatePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantaccessgit.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantaccessgit.go similarity index 76% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantaccessgit.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantaccessgit.go index 70f26d6af5275..8964499687477 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantaccessgit.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantaccessgit.go @@ -42,7 +42,7 @@ func NewTenantAccessGitClientWithBaseURI(baseURI string, subscriptionID string) return TenantAccessGitClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Get gets the Git access configuration for the tenant. +// Get gets the Git access configuration for the tenant. Without secrets. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. @@ -95,7 +95,7 @@ func (client TenantAccessGitClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -127,6 +127,91 @@ func (client TenantAccessGitClient) GetResponder(resp *http.Response) (result Ac return } +// ListSecrets gets the Git access configuration for the tenant. +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +func (client TenantAccessGitClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string) (result AccessInformationContract, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TenantAccessGitClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.TenantAccessGitClient", "ListSecrets", err.Error()) + } + + req, err := client.ListSecretsPreparer(ctx, resourceGroupName, serviceName) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.TenantAccessGitClient", "ListSecrets", resp, "Failure responding to request") + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client TenantAccessGitClient) ListSecretsPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accessName": autorest.Encode("path", "access"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/tenant/{accessName}/git/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client TenantAccessGitClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client TenantAccessGitClient) ListSecretsResponder(resp *http.Response) (result AccessInformationContract, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // RegeneratePrimaryKey regenerate primary access key for GIT. // Parameters: // resourceGroupName - the name of the resource group. @@ -180,7 +265,7 @@ func (client TenantAccessGitClient) RegeneratePrimaryKeyPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -264,7 +349,7 @@ func (client TenantAccessGitClient) RegenerateSecondaryKeyPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantconfiguration.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantconfiguration.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantconfiguration.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantconfiguration.go index d546ef6c65590..a943e10becad2 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/tenantconfiguration.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/tenantconfiguration.go @@ -66,7 +66,8 @@ func (client TenantConfigurationClient) Deploy(ctx context.Context, resourceGrou {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.DeployConfigurationParameterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DeployConfigurationParameterProperties.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.TenantConfigurationClient", "Deploy", err.Error()) } @@ -94,7 +95,7 @@ func (client TenantConfigurationClient) DeployPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -188,7 +189,7 @@ func (client TenantConfigurationClient) GetSyncStatePreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +244,8 @@ func (client TenantConfigurationClient) Save(ctx context.Context, resourceGroupN {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.SaveConfigurationParameterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SaveConfigurationParameterProperties.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.TenantConfigurationClient", "Save", err.Error()) } @@ -271,7 +273,7 @@ func (client TenantConfigurationClient) SavePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -334,7 +336,8 @@ func (client TenantConfigurationClient) Validate(ctx context.Context, resourceGr {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.DeployConfigurationParameterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DeployConfigurationParameterProperties.Branch", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.TenantConfigurationClient", "Validate", err.Error()) } @@ -362,7 +365,7 @@ func (client TenantConfigurationClient) ValidatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/user.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/user.go similarity index 75% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/user.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/user.go index 768fa15d6c359..f53a321e76391 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/user.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/user.go @@ -46,10 +46,10 @@ func NewUserClientWithBaseURI(baseURI string, subscriptionID string) UserClient // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. +// userID - user identifier. Must be unique in the current API Management service instance. // parameters - create or update parameters. // ifMatch - eTag of the Entity. Not required when creating an entity, but required when updating an entity. -func (client UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserCreateParameters, ifMatch string) (result UserContract, err error) { +func (client UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserCreateParameters, ifMatch string) (result UserContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.CreateOrUpdate") defer func() { @@ -65,10 +65,9 @@ func (client UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.UserCreateParameterProperties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.UserCreateParameterProperties.Email", Name: validation.Null, Rule: true, @@ -87,7 +86,7 @@ func (client UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName s return result, validation.NewError("apimanagement.UserClient", "CreateOrUpdate", err.Error()) } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, UID, parameters, ifMatch) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, serviceName, userID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -109,15 +108,15 @@ func (client UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName s } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client UserClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserCreateParameters, ifMatch string) (*http.Request, error) { +func (client UserClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserCreateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -126,7 +125,7 @@ func (client UserClient) CreateOrUpdatePreparer(ctx context.Context, resourceGro autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) if len(ifMatch) > 0 { @@ -159,12 +158,12 @@ func (client UserClient) CreateOrUpdateResponder(resp *http.Response) (result Us // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. +// userID - user identifier. Must be unique in the current API Management service instance. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. // deleteSubscriptions - whether to delete user's subscription or not. // notify - send an Account Closed Email notification to the User. -func (client UserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, UID string, ifMatch string, deleteSubscriptions *bool, notify *bool) (result autorest.Response, err error) { +func (client UserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, userID string, ifMatch string, deleteSubscriptions *bool, notify *bool) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.Delete") defer func() { @@ -180,14 +179,13 @@ func (client UserClient) Delete(ctx context.Context, resourceGroupName string, s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.UserClient", "Delete", err.Error()) } - req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, UID, ifMatch, deleteSubscriptions, notify) + req, err := client.DeletePreparer(ctx, resourceGroupName, serviceName, userID, ifMatch, deleteSubscriptions, notify) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Delete", nil, "Failure preparing request") return @@ -209,15 +207,15 @@ func (client UserClient) Delete(ctx context.Context, resourceGroupName string, s } // DeletePreparer prepares the Delete request. -func (client UserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, ifMatch string, deleteSubscriptions *bool, notify *bool) (*http.Request, error) { +func (client UserClient) DeletePreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string, ifMatch string, deleteSubscriptions *bool, notify *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -231,7 +229,7 @@ func (client UserClient) DeletePreparer(ctx context.Context, resourceGroupName s preparer := autorest.CreatePreparer( autorest.AsDelete(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -260,8 +258,8 @@ func (client UserClient) DeleteResponder(resp *http.Response) (result autorest.R // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client UserClient) GenerateSsoURL(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result GenerateSsoURLResult, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client UserClient) GenerateSsoURL(ctx context.Context, resourceGroupName string, serviceName string, userID string) (result GenerateSsoURLResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.GenerateSsoURL") defer func() { @@ -277,14 +275,13 @@ func (client UserClient) GenerateSsoURL(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.UserClient", "GenerateSsoURL", err.Error()) } - req, err := client.GenerateSsoURLPreparer(ctx, resourceGroupName, serviceName, UID) + req, err := client.GenerateSsoURLPreparer(ctx, resourceGroupName, serviceName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GenerateSsoURL", nil, "Failure preparing request") return @@ -306,15 +303,15 @@ func (client UserClient) GenerateSsoURL(ctx context.Context, resourceGroupName s } // GenerateSsoURLPreparer prepares the GenerateSsoURL request. -func (client UserClient) GenerateSsoURLPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string) (*http.Request, error) { +func (client UserClient) GenerateSsoURLPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -322,7 +319,7 @@ func (client UserClient) GenerateSsoURLPreparer(ctx context.Context, resourceGro preparer := autorest.CreatePreparer( autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/generateSsoUrl", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/generateSsoUrl", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -350,8 +347,8 @@ func (client UserClient) GenerateSsoURLResponder(resp *http.Response) (result Ge // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client UserClient) Get(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result UserContract, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client UserClient) Get(ctx context.Context, resourceGroupName string, serviceName string, userID string) (result UserContract, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.Get") defer func() { @@ -367,14 +364,13 @@ func (client UserClient) Get(ctx context.Context, resourceGroupName string, serv Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.UserClient", "Get", err.Error()) } - req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, UID) + req, err := client.GetPreparer(ctx, resourceGroupName, serviceName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Get", nil, "Failure preparing request") return @@ -396,15 +392,15 @@ func (client UserClient) Get(ctx context.Context, resourceGroupName string, serv } // GetPreparer prepares the Get request. -func (client UserClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string) (*http.Request, error) { +func (client UserClient) GetPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -412,7 +408,7 @@ func (client UserClient) GetPreparer(ctx context.Context, resourceGroupName stri preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -440,8 +436,8 @@ func (client UserClient) GetResponder(resp *http.Response) (result UserContract, // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client UserClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result autorest.Response, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client UserClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, userID string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.GetEntityTag") defer func() { @@ -457,14 +453,13 @@ func (client UserClient) GetEntityTag(ctx context.Context, resourceGroupName str Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.UserClient", "GetEntityTag", err.Error()) } - req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, UID) + req, err := client.GetEntityTagPreparer(ctx, resourceGroupName, serviceName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetEntityTag", nil, "Failure preparing request") return @@ -486,15 +481,15 @@ func (client UserClient) GetEntityTag(ctx context.Context, resourceGroupName str } // GetEntityTagPreparer prepares the GetEntityTag request. -func (client UserClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string) (*http.Request, error) { +func (client UserClient) GetEntityTagPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -502,7 +497,7 @@ func (client UserClient) GetEntityTagPreparer(ctx context.Context, resourceGroup preparer := autorest.CreatePreparer( autorest.AsHead(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -525,97 +520,13 @@ func (client UserClient) GetEntityTagResponder(resp *http.Response) (result auto return } -// GetIdentity returns calling user identity information. -// Parameters: -// resourceGroupName - the name of the resource group. -// serviceName - the name of the API Management service. -func (client UserClient) GetIdentity(ctx context.Context, resourceGroupName string, serviceName string) (result CurrentUserIdentity, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.GetIdentity") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: serviceName, - Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}}); err != nil { - return result, validation.NewError("apimanagement.UserClient", "GetIdentity", err.Error()) - } - - req, err := client.GetIdentityPreparer(ctx, resourceGroupName, serviceName) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetIdentity", nil, "Failure preparing request") - return - } - - resp, err := client.GetIdentitySender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetIdentity", resp, "Failure sending request") - return - } - - result, err = client.GetIdentityResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetIdentity", resp, "Failure responding to request") - } - - return -} - -// GetIdentityPreparer prepares the GetIdentity request. -func (client UserClient) GetIdentityPreparer(ctx context.Context, resourceGroupName string, serviceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "serviceName": autorest.Encode("path", serviceName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2018-01-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/identity", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetIdentitySender sends the GetIdentity request. The method will close the -// http.Response Body if it receives an error. -func (client UserClient) GetIdentitySender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// GetIdentityResponder handles the response to the GetIdentity request. The method always -// closes the http.Response Body. -func (client UserClient) GetIdentityResponder(resp *http.Response) (result CurrentUserIdentity, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // GetSharedAccessToken gets the Shared Access Authorization Token for the User. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. +// userID - user identifier. Must be unique in the current API Management service instance. // parameters - create Authorization Token parameters. -func (client UserClient) GetSharedAccessToken(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserTokenParameters) (result UserTokenResult, err error) { +func (client UserClient) GetSharedAccessToken(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserTokenParameters) (result UserTokenResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.GetSharedAccessToken") defer func() { @@ -631,16 +542,16 @@ func (client UserClient) GetSharedAccessToken(ctx context.Context, resourceGroup Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.Expiry", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "parameters.UserTokenParameterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.UserTokenParameterProperties.Expiry", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("apimanagement.UserClient", "GetSharedAccessToken", err.Error()) } - req, err := client.GetSharedAccessTokenPreparer(ctx, resourceGroupName, serviceName, UID, parameters) + req, err := client.GetSharedAccessTokenPreparer(ctx, resourceGroupName, serviceName, userID, parameters) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "GetSharedAccessToken", nil, "Failure preparing request") return @@ -662,15 +573,15 @@ func (client UserClient) GetSharedAccessToken(ctx context.Context, resourceGroup } // GetSharedAccessTokenPreparer prepares the GetSharedAccessToken request. -func (client UserClient) GetSharedAccessTokenPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserTokenParameters) (*http.Request, error) { +func (client UserClient) GetSharedAccessTokenPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserTokenParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -679,7 +590,7 @@ func (client UserClient) GetSharedAccessTokenPreparer(ctx context.Context, resou autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/token", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/token", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -708,18 +619,18 @@ func (client UserClient) GetSharedAccessTokenResponder(resp *http.Response) (res // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// filter - | Field | Supported operators | Supported functions | -// |------------------|------------------------|-----------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | firstName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | lastName | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | email | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | N/A | -// | registrationDate | ge, le, eq, ne, gt, lt | N/A | -// | note | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| firstName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| lastName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| email | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| state | filter | eq | |
| registrationDate | filter | ge, +// le, eq, ne, gt, lt | |
| note | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| groups | expand | | |
// top - number of records to return. // skip - number of records to skip. -func (client UserClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result UserCollectionPage, err error) { +// expandGroups - detailed Group in response. +func (client UserClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (result UserCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.ListByService") defer func() { @@ -745,7 +656,7 @@ func (client UserClient) ListByService(ctx context.Context, resourceGroupName st } result.fn = client.listByServiceNextResults - req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip) + req, err := client.ListByServicePreparer(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "ListByService", nil, "Failure preparing request") return @@ -767,14 +678,14 @@ func (client UserClient) ListByService(ctx context.Context, resourceGroupName st } // ListByServicePreparer prepares the ListByService request. -func (client UserClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client UserClient) ListByServicePreparer(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -787,6 +698,9 @@ func (client UserClient) ListByServicePreparer(ctx context.Context, resourceGrou if skip != nil { queryParameters["$skip"] = autorest.Encode("query", *skip) } + if expandGroups != nil { + queryParameters["expandGroups"] = autorest.Encode("query", *expandGroups) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -837,7 +751,7 @@ func (client UserClient) listByServiceNextResults(ctx context.Context, lastResul } // ListByServiceComplete enumerates all values, automatically crossing page boundaries as required. -func (client UserClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32) (result UserCollectionIterator, err error) { +func (client UserClient) ListByServiceComplete(ctx context.Context, resourceGroupName string, serviceName string, filter string, top *int32, skip *int32, expandGroups *bool) (result UserCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.ListByService") defer func() { @@ -848,7 +762,7 @@ func (client UserClient) ListByServiceComplete(ctx context.Context, resourceGrou tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip) + result.page, err = client.ListByService(ctx, resourceGroupName, serviceName, filter, top, skip, expandGroups) return } @@ -856,11 +770,11 @@ func (client UserClient) ListByServiceComplete(ctx context.Context, resourceGrou // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. +// userID - user identifier. Must be unique in the current API Management service instance. // parameters - update parameters. // ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET // request or it should be * for unconditional update. -func (client UserClient) Update(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserUpdateParameters, ifMatch string) (result autorest.Response, err error) { +func (client UserClient) Update(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserUpdateParameters, ifMatch string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserClient.Update") defer func() { @@ -876,14 +790,13 @@ func (client UserClient) Update(ctx context.Context, resourceGroupName string, s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.UserClient", "Update", err.Error()) } - req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, UID, parameters, ifMatch) + req, err := client.UpdatePreparer(ctx, resourceGroupName, serviceName, userID, parameters, ifMatch) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserClient", "Update", nil, "Failure preparing request") return @@ -905,15 +818,15 @@ func (client UserClient) Update(ctx context.Context, resourceGroupName string, s } // UpdatePreparer prepares the Update request. -func (client UserClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, parameters UserUpdateParameters, ifMatch string) (*http.Request, error) { +func (client UserClient) UpdatePreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserUpdateParameters, ifMatch string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -922,7 +835,7 @@ func (client UserClient) UpdatePreparer(ctx context.Context, resourceGroupName s autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters), autorest.WithHeader("If-Match", autorest.String(ifMatch))) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/userconfirmationpassword.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/userconfirmationpassword.go new file mode 100644 index 0000000000000..f432d059dc5e8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/userconfirmationpassword.go @@ -0,0 +1,132 @@ +package apimanagement + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// UserConfirmationPasswordClient is the apiManagement Client +type UserConfirmationPasswordClient struct { + BaseClient +} + +// NewUserConfirmationPasswordClient creates an instance of the UserConfirmationPasswordClient client. +func NewUserConfirmationPasswordClient(subscriptionID string) UserConfirmationPasswordClient { + return NewUserConfirmationPasswordClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUserConfirmationPasswordClientWithBaseURI creates an instance of the UserConfirmationPasswordClient client using +// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewUserConfirmationPasswordClientWithBaseURI(baseURI string, subscriptionID string) UserConfirmationPasswordClient { + return UserConfirmationPasswordClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// SendMethod sends confirmation +// Parameters: +// resourceGroupName - the name of the resource group. +// serviceName - the name of the API Management service. +// userID - user identifier. Must be unique in the current API Management service instance. +func (client UserConfirmationPasswordClient) SendMethod(ctx context.Context, resourceGroupName string, serviceName string, userID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserConfirmationPasswordClient.SendMethod") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceName, + Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("apimanagement.UserConfirmationPasswordClient", "SendMethod", err.Error()) + } + + req, err := client.SendMethodPreparer(ctx, resourceGroupName, serviceName, userID) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserConfirmationPasswordClient", "SendMethod", nil, "Failure preparing request") + return + } + + resp, err := client.SendMethodSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "apimanagement.UserConfirmationPasswordClient", "SendMethod", resp, "Failure sending request") + return + } + + result, err = client.SendMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "apimanagement.UserConfirmationPasswordClient", "SendMethod", resp, "Failure responding to request") + } + + return +} + +// SendMethodPreparer prepares the SendMethod request. +func (client UserConfirmationPasswordClient) SendMethodPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceName": autorest.Encode("path", serviceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userId": autorest.Encode("path", userID), + } + + const APIVersion = "2019-12-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/confirmations/password/send", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SendMethodSender sends the SendMethod request. The method will close the +// http.Response Body if it receives an error. +func (client UserConfirmationPasswordClient) SendMethodSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SendMethodResponder handles the response to the SendMethod request. The method always +// closes the http.Response Body. +func (client UserConfirmationPasswordClient) SendMethodResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/usergroup.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/usergroup.go similarity index 82% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/usergroup.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/usergroup.go index e4e781f865202..b2e738d408450 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/usergroup.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/usergroup.go @@ -46,15 +46,15 @@ func NewUserGroupClientWithBaseURI(baseURI string, subscriptionID string) UserGr // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |-------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | description | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | +// userID - user identifier. Must be unique in the current API Management service instance. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| description | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client UserGroupClient) List(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (result GroupCollectionPage, err error) { +func (client UserGroupClient) List(ctx context.Context, resourceGroupName string, serviceName string, userID string, filter string, top *int32, skip *int32) (result GroupCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserGroupClient.List") defer func() { @@ -70,10 +70,9 @@ func (client UserGroupClient) List(ctx context.Context, resourceGroupName string Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -84,7 +83,7 @@ func (client UserGroupClient) List(ctx context.Context, resourceGroupName string } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, UID, filter, top, skip) + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, userID, filter, top, skip) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserGroupClient", "List", nil, "Failure preparing request") return @@ -106,15 +105,15 @@ func (client UserGroupClient) List(ctx context.Context, resourceGroupName string } // ListPreparer prepares the List request. -func (client UserGroupClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client UserGroupClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -131,7 +130,7 @@ func (client UserGroupClient) ListPreparer(ctx context.Context, resourceGroupNam preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/groups", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/groups", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -177,7 +176,7 @@ func (client UserGroupClient) listNextResults(ctx context.Context, lastResults G } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UserGroupClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (result GroupCollectionIterator, err error) { +func (client UserGroupClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, userID string, filter string, top *int32, skip *int32) (result GroupCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserGroupClient.List") defer func() { @@ -188,6 +187,6 @@ func (client UserGroupClient) ListComplete(ctx context.Context, resourceGroupNam tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, serviceName, UID, filter, top, skip) + result.page, err = client.List(ctx, resourceGroupName, serviceName, userID, filter, top, skip) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/useridentities.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/useridentities.go similarity index 87% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/useridentities.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/useridentities.go index f0d5b0f4c6366..2c8a979b642a3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/useridentities.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/useridentities.go @@ -42,12 +42,12 @@ func NewUserIdentitiesClientWithBaseURI(baseURI string, subscriptionID string) U return UserIdentitiesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all user identities. +// List list of all user identities. // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. -func (client UserIdentitiesClient) List(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result UserIdentityCollectionPage, err error) { +// userID - user identifier. Must be unique in the current API Management service instance. +func (client UserIdentitiesClient) List(ctx context.Context, resourceGroupName string, serviceName string, userID string) (result UserIdentityCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentitiesClient.List") defer func() { @@ -63,15 +63,14 @@ func (client UserIdentitiesClient) List(ctx context.Context, resourceGroupName s Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}}); err != nil { + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("apimanagement.UserIdentitiesClient", "List", err.Error()) } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, UID) + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, userID) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserIdentitiesClient", "List", nil, "Failure preparing request") return @@ -93,15 +92,15 @@ func (client UserIdentitiesClient) List(ctx context.Context, resourceGroupName s } // ListPreparer prepares the List request. -func (client UserIdentitiesClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string) (*http.Request, error) { +func (client UserIdentitiesClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -109,7 +108,7 @@ func (client UserIdentitiesClient) ListPreparer(ctx context.Context, resourceGro preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/identities", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/identities", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -155,7 +154,7 @@ func (client UserIdentitiesClient) listNextResults(ctx context.Context, lastResu } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UserIdentitiesClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, UID string) (result UserIdentityCollectionIterator, err error) { +func (client UserIdentitiesClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, userID string) (result UserIdentityCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserIdentitiesClient.List") defer func() { @@ -166,6 +165,6 @@ func (client UserIdentitiesClient) ListComplete(ctx context.Context, resourceGro tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, serviceName, UID) + result.page, err = client.List(ctx, resourceGroupName, serviceName, userID) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/usersubscription.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/usersubscription.go similarity index 79% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/usersubscription.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/usersubscription.go index 8ac49f338d517..62f52e349c5ee 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/usersubscription.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/usersubscription.go @@ -47,18 +47,19 @@ func NewUserSubscriptionClientWithBaseURI(baseURI string, subscriptionID string) // Parameters: // resourceGroupName - the name of the resource group. // serviceName - the name of the API Management service. -// UID - user identifier. Must be unique in the current API Management service instance. -// filter - | Field | Supported operators | Supported functions | -// |--------------|------------------------|---------------------------------------------| -// | id | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | stateComment | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | userId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | productId | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | -// | state | eq | | +// userID - user identifier. Must be unique in the current API Management service instance. +// filter - | Field | Usage | Supported operators | Supported functions +// |
|-------------|-------------|-------------|-------------|
| name | filter | ge, le, eq, ne, gt, lt +// | substringof, contains, startswith, endswith |
| displayName | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| stateComment | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| ownerId | filter | ge, le, eq, ne, gt, lt | +// substringof, contains, startswith, endswith |
| scope | filter | ge, le, eq, ne, gt, lt | substringof, +// contains, startswith, endswith |
| userId | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
| productId | filter | ge, le, eq, ne, gt, lt | substringof, contains, +// startswith, endswith |
// top - number of records to return. // skip - number of records to skip. -func (client UserSubscriptionClient) List(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionPage, err error) { +func (client UserSubscriptionClient) List(ctx context.Context, resourceGroupName string, serviceName string, userID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserSubscriptionClient.List") defer func() { @@ -74,10 +75,9 @@ func (client UserSubscriptionClient) List(ctx context.Context, resourceGroupName Constraints: []validation.Constraint{{Target: "serviceName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "serviceName", Name: validation.MinLength, Rule: 1, Chain: nil}, {Target: "serviceName", Name: validation.Pattern, Rule: `^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$`, Chain: nil}}}, - {TargetValue: UID, - Constraints: []validation.Constraint{{Target: "UID", Name: validation.MaxLength, Rule: 80, Chain: nil}, - {Target: "UID", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "UID", Name: validation.Pattern, Rule: `(^[\w]+$)|(^[\w][\w\-]+[\w]$)`, Chain: nil}}}, + {TargetValue: userID, + Constraints: []validation.Constraint{{Target: "userID", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "userID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}, @@ -88,7 +88,7 @@ func (client UserSubscriptionClient) List(ctx context.Context, resourceGroupName } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, UID, filter, top, skip) + req, err := client.ListPreparer(ctx, resourceGroupName, serviceName, userID, filter, top, skip) if err != nil { err = autorest.NewErrorWithError(err, "apimanagement.UserSubscriptionClient", "List", nil, "Failure preparing request") return @@ -110,15 +110,15 @@ func (client UserSubscriptionClient) List(ctx context.Context, resourceGroupName } // ListPreparer prepares the List request. -func (client UserSubscriptionClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (*http.Request, error) { +func (client UserSubscriptionClient) ListPreparer(ctx context.Context, resourceGroupName string, serviceName string, userID string, filter string, top *int32, skip *int32) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "serviceName": autorest.Encode("path", serviceName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), - "uid": autorest.Encode("path", UID), + "userId": autorest.Encode("path", userID), } - const APIVersion = "2018-01-01" + const APIVersion = "2019-12-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -135,7 +135,7 @@ func (client UserSubscriptionClient) ListPreparer(ctx context.Context, resourceG preparer := autorest.CreatePreparer( autorest.AsGet(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{uid}/subscriptions", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}/subscriptions", pathParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -181,7 +181,7 @@ func (client UserSubscriptionClient) listNextResults(ctx context.Context, lastRe } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UserSubscriptionClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, UID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionIterator, err error) { +func (client UserSubscriptionClient) ListComplete(ctx context.Context, resourceGroupName string, serviceName string, userID string, filter string, top *int32, skip *int32) (result SubscriptionCollectionIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UserSubscriptionClient.List") defer func() { @@ -192,6 +192,6 @@ func (client UserSubscriptionClient) ListComplete(ctx context.Context, resourceG tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, serviceName, UID, filter, top, skip) + result.page, err = client.List(ctx, resourceGroupName, serviceName, userID, filter, top, skip) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/version.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/version.go index 9147ce76f4725..271f72ceb60df 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " apimanagement/2018-01-01" + return "Azure-SDK-For-Go/" + version.Number + " apimanagement/2019-12-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/modules.txt b/vendor/modules.txt index 42aa5743b21f2..265b3242490b8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -9,7 +9,7 @@ cloud.google.com/go/storage # github.com/Azure/azure-sdk-for-go v41.2.0+incompatible github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources github.com/Azure/azure-sdk-for-go/services/analysisservices/mgmt/2017-08-01/analysisservices -github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2018-01-01/apimanagement +github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement github.com/Azure/azure-sdk-for-go/services/appconfiguration/mgmt/2019-10-01/appconfiguration github.com/Azure/azure-sdk-for-go/services/appinsights/mgmt/2015-05-01/insights github.com/Azure/azure-sdk-for-go/services/automation/mgmt/2015-10-31/automation diff --git a/website/azurerm.erb b/website/azurerm.erb index 506f7eaf9332f..9b2850c031b7c 100644 --- a/website/azurerm.erb +++ b/website/azurerm.erb @@ -693,6 +693,10 @@ azurerm_api_management_logger +
  • + azurerm_api_management_named_value +
  • +
  • azurerm_api_management_openid_connect_provider
  • diff --git a/website/docs/r/api_management_named_value.html.markdown b/website/docs/r/api_management_named_value.html.markdown new file mode 100644 index 0000000000000..c64ddeaba9347 --- /dev/null +++ b/website/docs/r/api_management_named_value.html.markdown @@ -0,0 +1,83 @@ +--- +subcategory: "API Management" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_api_management_named_value" +description: |- + Manages an API Management Named Value. +--- + +# azurerm_api_management_named_value + +Manages an API Management Named Value. + + +## Example Usage + +```hcl +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West US" +} + +resource "azurerm_api_management" "example" { + name = "example-apim" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + publisher_name = "pub1" + publisher_email = "pub1@email.com" + + sku_name = "Developer_1" +} + +resource "azurerm_api_management_named_value" "example" { + name = "example-apimg" + resource_group_name = azurerm_resource_group.example.name + api_management_name = azurerm_api_management.example.name + display_name = "ExampleProperty" + value = "Example Value" +} +``` + + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) The name of the API Management Named Value. Changing this forces a new resource to be created. + +* `resource_group_name` - (Required) The name of the Resource Group in which the API Management Named Value should exist. Changing this forces a new resource to be created. + +* `api_management_name` - (Required) The name of the [API Management Service](api_management.html) in which the API Management Named Value should exist. Changing this forces a new resource to be created. + +* `display_name` - (Required) The display name of this API Management Named Value. + +* `value` - (Required) The value of this API Management Named Value. + +* `secret` - (Optional) Specifies whether the API Management Named Value is secret. Valid values are `true` or `false`. The default value is `false`. + +~> **NOTE:** setting the field `secret` to `true` doesn't make this field sensitive in Terraform, instead it marks the value as secret and encrypts the value in Azure. + +* `tags` - (Optional) A list of tags to be applied to the API Management Named Value. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `id` - The ID of the API Management Named Value. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the API Management Named Value. +* `update` - (Defaults to 30 minutes) Used when updating the API Management Named Value. +* `read` - (Defaults to 5 minutes) Used when retrieving the API Management Named Value. +* `delete` - (Defaults to 30 minutes) Used when deleting the API Management Named Value. + +## Import + +API Management Properties can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_api_management_named_value.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.ApiManagement/service/example-apim/namedValues/example-apimp +``` diff --git a/website/docs/r/api_management_property.html.markdown b/website/docs/r/api_management_property.html.markdown index 73f7a2fe7f592..3143cfb2daf3b 100644 --- a/website/docs/r/api_management_property.html.markdown +++ b/website/docs/r/api_management_property.html.markdown @@ -79,5 +79,5 @@ The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/d API Management Properties can be imported using the `resource id`, e.g. ```shell -terraform import azurerm_api_management_property.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.ApiManagement/service/example-apim/properties/example-apimp +terraform import azurerm_api_management_property.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.ApiManagement/service/example-apim/namedValues/example-apimp ``` From 1da7541d595735fa7a0892a8fc2a6666d89c8524 Mon Sep 17 00:00:00 2001 From: kt Date: Wed, 22 Apr 2020 10:12:36 -0700 Subject: [PATCH 018/223] update CHANGELOG.md to include #6479 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b915d24b27805..a559c1e06bdec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ FEATURES: IMPROVEMENTS: +* dependencies: updating `apimanagement` to `2019-12-01` [GH-6479] * dependencies: updating the fork of `github.com/Azure/go-autorest` [GH-6509] * Data Source: `app_service_environment` - export the `location` property [GH-6538] * `azurerm_cosmosdb_mongo_collection` - support for the `index` and `system_index` properties [GH-6426] From b0d2780d8f4e7c3e268a42615536f20de4780b2d Mon Sep 17 00:00:00 2001 From: Neil Ye Date: Thu, 23 Apr 2020 13:10:51 +0800 Subject: [PATCH 019/223] `azurerm_private_endpoint`: Add support for tags (#6574) * Add support for tags of private endpoint * Fix test issue Co-authored-by: Jeffrey Cline <20408400+WodansSon@users.noreply.github.com> --- .../network/resource_arm_private_endpoint.go | 8 +-- .../resource_arm_private_endpoint_test.go | 62 ++++++++++++++++++- website/docs/r/private_endpoint.html.markdown | 2 + 3 files changed, 65 insertions(+), 7 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_private_endpoint.go b/azurerm/internal/services/network/resource_arm_private_endpoint.go index db7d08aae658e..d9d16a5837609 100644 --- a/azurerm/internal/services/network/resource_arm_private_endpoint.go +++ b/azurerm/internal/services/network/resource_arm_private_endpoint.go @@ -13,6 +13,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -98,8 +99,7 @@ func resourceArmPrivateEndpoint() *schema.Resource { }, }, - // tags has been removed - // API Issue "Unable to remove Tags from Private Endpoint": https://github.com/Azure/azure-sdk-for-go/issues/6467 + "tags": tags.Schema(), }, } } @@ -142,6 +142,7 @@ func resourceArmPrivateEndpointCreateUpdate(d *schema.ResourceData, meta interfa ID: utils.String(subnetId), }, }, + Tags: tags.Expand(d.Get("tags").(map[string]interface{})), } future, err := client.CreateOrUpdate(ctx, resourceGroup, name, parameters) @@ -223,8 +224,7 @@ func resourceArmPrivateEndpointRead(d *schema.ResourceData, meta interface{}) er d.Set("subnet_id", subnetId) } - // API Issue "Unable to remove Tags from Private Link Endpoint": https://github.com/Azure/azure-sdk-for-go/issues/6467 - return nil + return tags.FlattenAndSet(d, resp.Tags) } func resourceArmPrivateEndpointDelete(d *schema.ResourceData, meta interface{}) error { diff --git a/azurerm/internal/services/network/tests/resource_arm_private_endpoint_test.go b/azurerm/internal/services/network/tests/resource_arm_private_endpoint_test.go index 4801011bd4945..673b5997b9e64 100644 --- a/azurerm/internal/services/network/tests/resource_arm_private_endpoint_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_private_endpoint_test.go @@ -32,6 +32,42 @@ func TestAccAzureRMPrivateEndpoint_basic(t *testing.T) { }) } +func TestAccAzureRMPrivateEndpoint_updateTag(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_private_endpoint", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMPrivateEndpointDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMPrivateEndpoint_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMPrivateEndpointExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "tags.%", "0"), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMPrivateEndpoint_withTag(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMPrivateEndpointExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "tags.%", "1"), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMPrivateEndpoint_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMPrivateEndpointExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "tags.%", "0"), + ), + }, + data.ImportStep(), + }, + }) +} + func TestAccAzureRMPrivateEndpoint_requestMessage(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_private_endpoint", "test") @@ -200,9 +236,6 @@ resource "azurerm_private_link_service" "test" { func testAccAzureRMPrivateEndpoint_serviceManualApprove(data acceptance.TestData) string { return fmt.Sprintf(` -provider "azurerm" { - features {} -} resource "azurerm_private_link_service" "test" { name = "acctestPLS-%d" @@ -241,6 +274,29 @@ resource "azurerm_private_endpoint" "test" { `, testAccAzureRMPrivateEndpointTemplate_template(data, testAccAzureRMPrivateEndpoint_serviceAutoApprove(data)), data.RandomInteger) } +func testAccAzureRMPrivateEndpoint_withTag(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_private_endpoint" "test" { + name = "acctest-privatelink-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + subnet_id = azurerm_subnet.endpoint.id + + private_service_connection { + name = azurerm_private_link_service.test.name + is_manual_connection = false + private_connection_resource_id = azurerm_private_link_service.test.id + } + + tags = { + env = "TEST" + } +} +`, testAccAzureRMPrivateEndpointTemplate_template(data, testAccAzureRMPrivateEndpoint_serviceAutoApprove(data)), data.RandomInteger) +} + func testAccAzureRMPrivateEndpoint_requestMessage(data acceptance.TestData, msg string) string { return fmt.Sprintf(` %s diff --git a/website/docs/r/private_endpoint.html.markdown b/website/docs/r/private_endpoint.html.markdown index 8c47cda30ef89..6fb34c9c75ac4 100644 --- a/website/docs/r/private_endpoint.html.markdown +++ b/website/docs/r/private_endpoint.html.markdown @@ -111,6 +111,8 @@ The following arguments are supported: * `private_service_connection` - (Required) A `private_service_connection` block as defined below. +* `tags` - (Optional) A mapping of tags to assign to the resource. + --- A `private_service_connection` supports the following: From 1e55c7036c632dc05c12fd59118f5470ded6f3a9 Mon Sep 17 00:00:00 2001 From: WS <20408400+WodansSon@users.noreply.github.com> Date: Wed, 22 Apr 2020 22:12:07 -0700 Subject: [PATCH 020/223] `azurerm_public_ip_prefix`: Update `prefix_length` validation to accept all valid IPv4 address ranges (#6589) * Update prefix length validation * Updated documentation for new ranges * Add test and change upper limit to 31 * Update error msgs to be go compliant * Add note to test case about subscription config --- .../network/resource_arm_public_ip_prefix.go | 12 ++--- .../resource_arm_public_ip_prefix_test.go | 50 +++++++++++++++++-- website/docs/r/public_ip_prefix.html.markdown | 2 +- 3 files changed, 54 insertions(+), 10 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_public_ip_prefix.go b/azurerm/internal/services/network/resource_arm_public_ip_prefix.go index 304f093f68f05..e7f8a37aabe29 100644 --- a/azurerm/internal/services/network/resource_arm_public_ip_prefix.go +++ b/azurerm/internal/services/network/resource_arm_public_ip_prefix.go @@ -59,7 +59,7 @@ func resourceArmPublicIpPrefix() *schema.Resource { Optional: true, Default: 28, ForceNew: true, - ValidateFunc: validation.IntBetween(28, 31), + ValidateFunc: validation.IntBetween(0, 31), }, "ip_prefix": { @@ -104,11 +104,11 @@ func resourceArmPublicIpPrefixCreateUpdate(d *schema.ResourceData, meta interfac future, err := client.CreateOrUpdate(ctx, resGroup, name, publicIpPrefix) if err != nil { - return fmt.Errorf("Error Creating/Updating Public IP Prefix %q (Resource Group %q): %+v", name, resGroup, err) + return fmt.Errorf("creating/Updating Public IP Prefix %q (Resource Group %q): %+v", name, resGroup, err) } if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("Error waiting for completion of Public IP Prefix %q (Resource Group %q): %+v", name, resGroup, err) + return fmt.Errorf("waiting for completion of Public IP Prefix %q (Resource Group %q): %+v", name, resGroup, err) } read, err := client.Get(ctx, resGroup, name, "") @@ -143,7 +143,7 @@ func resourceArmPublicIpPrefixRead(d *schema.ResourceData, meta interface{}) err return nil } - return fmt.Errorf("Error making Read request on Public IP Prefix %q (Resource Group %q): %+v", name, resGroup, err) + return fmt.Errorf("making Read request on Public IP Prefix %q (Resource Group %q): %+v", name, resGroup, err) } d.Set("name", resp.Name) @@ -179,11 +179,11 @@ func resourceArmPublicIpPrefixDelete(d *schema.ResourceData, meta interface{}) e future, err := client.Delete(ctx, resGroup, name) if err != nil { - return fmt.Errorf("Error deleting Public IP Prefix %q (Resource Group %q): %+v", name, resGroup, err) + return fmt.Errorf("deleting Public IP Prefix %q (Resource Group %q): %+v", name, resGroup, err) } if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { - return fmt.Errorf("Error waiting for deletion of Public IP Prefix %q (Resource Group %q): %+v", name, resGroup, err) + return fmt.Errorf("waiting for deletion of Public IP Prefix %q (Resource Group %q): %+v", name, resGroup, err) } return nil diff --git a/azurerm/internal/services/network/tests/resource_arm_public_ip_prefix_test.go b/azurerm/internal/services/network/tests/resource_arm_public_ip_prefix_test.go index 3a8146ab82ea9..544527d30370f 100644 --- a/azurerm/internal/services/network/tests/resource_arm_public_ip_prefix_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_public_ip_prefix_test.go @@ -118,7 +118,7 @@ func TestAccAzureRMPublicIpPrefix_basic(t *testing.T) { }) } -func TestAccAzureRMPublicIpPrefix_prefixLength(t *testing.T) { +func TestAccAzureRMPublicIpPrefix_prefixLength31(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_public_ip_prefix", "test") resource.ParallelTest(t, resource.TestCase{ @@ -127,7 +127,7 @@ func TestAccAzureRMPublicIpPrefix_prefixLength(t *testing.T) { CheckDestroy: testCheckAzureRMPublicIPPrefixDestroy, Steps: []resource.TestStep{ { - Config: testAccAzureRMPublicIPPrefix_prefixLength(data), + Config: testAccAzureRMPublicIPPrefix_prefixLength31(data), Check: resource.ComposeTestCheckFunc( testCheckAzureRMPublicIPPrefixExists(data.ResourceName), resource.TestCheckResourceAttrSet(data.ResourceName, "ip_prefix"), @@ -139,6 +139,29 @@ func TestAccAzureRMPublicIpPrefix_prefixLength(t *testing.T) { }) } +func TestAccAzureRMPublicIpPrefix_prefixLength24(t *testing.T) { + // NOTE: This test will fail unless the subscription is updated + // to accept a minimum PrefixLength of 24 + data := acceptance.BuildTestData(t, "azurerm_public_ip_prefix", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMPublicIPPrefixDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMPublicIPPrefix_prefixLength24(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMPublicIPPrefixExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "ip_prefix"), + resource.TestCheckResourceAttr(data.ResourceName, "prefix_length", "24"), + ), + }, + data.ImportStep(), + }, + }) +} + func TestAccAzureRMPublicIpPrefix_update(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_public_ip_prefix", "test") @@ -254,7 +277,7 @@ resource "azurerm_public_ip_prefix" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } -func testAccAzureRMPublicIPPrefix_prefixLength(data acceptance.TestData) string { +func testAccAzureRMPublicIPPrefix_prefixLength31(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { features {} @@ -274,3 +297,24 @@ resource "azurerm_public_ip_prefix" "test" { } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } + +func testAccAzureRMPublicIPPrefix_prefixLength24(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_public_ip_prefix" "test" { + name = "acctestpublicipprefix-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + prefix_length = 24 +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} diff --git a/website/docs/r/public_ip_prefix.html.markdown b/website/docs/r/public_ip_prefix.html.markdown index 16458054dbd8a..2cb6e0fc27cd7 100644 --- a/website/docs/r/public_ip_prefix.html.markdown +++ b/website/docs/r/public_ip_prefix.html.markdown @@ -45,7 +45,7 @@ The following arguments are supported: -> **Note**: Public IP Prefix can only be created with Standard SKUs at this time. -* `prefix_length` - (Optional) Specifies the number of bits of the prefix. The value can be set between 28 (16 addresses) and 31 (2 addresses). Changing this forces a new resource to be created. +* `prefix_length` - (Optional) Specifies the number of bits of the prefix. The value can be set between 0 (4,294,967,296 addresses) and 31 (2 addresses). Defaults to `28`(16 addresses). Changing this forces a new resource to be created. -> **Please Note**: There may be Public IP address limits on the subscription . [More information available here](https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits?toc=%2fazure%2fvirtual-network%2ftoc.json#publicip-address) From 44b223ea126e935a73f37fc3fbb0901999e8765b Mon Sep 17 00:00:00 2001 From: WS <20408400+WodansSon@users.noreply.github.com> Date: Wed, 22 Apr 2020 22:14:21 -0700 Subject: [PATCH 021/223] updating to include #6574 and #6589 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a559c1e06bdec..0022728ee8fcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ IMPROVEMENTS: * `azurerm_postgres_server` - support for the `infrastructure_encryption_enabled`, `public_network_access_enabled`, and `ssl_minimal_tls_version_enforced`, properties [GH-6459] * `azurerm_postgres_server` - all properties in the `storage_profile` block have been moved to the top level [GH-6459] * `azurerm_postgres_server` - the following properties were renamed and changed to a boolean type: `ssl_enforcement` to `ssl_enforcement_enabled`, `geo_redundant_backup` to `backup_geo_redundant_enabled`, and `auto_grow` to `auto_grow_enabled` [GH-6459] +* `azurerm_private_endpoint` - Add support for `tags` [GH-6574] BUG FIXES: @@ -28,6 +29,7 @@ BUG FIXES: * `azurerm_iothub_dps` - fix crash when path isn't cased correctly [GH-6570] * `azurerm_linux_virtual_machine_scale_set` - fixes crash with `boot_diagnositics` [GH-6569] * `azurerm_postgres_server` - the `storage_mb` is no optional when `auto_grow` is enabled [GH-6459] +* `azurerm_public_ip_prefix` - Update `prefix_length` validation to accept all valid IPv4 address ranges [GH-6589] * `azurerm_virtual_network_gateway` - per api requirements, `public_ip_address_id` is required [GH-6548] ## 2.6.0 (April 16, 2020) From 4223b999285a6aaa21d4647e9cc0f3838600c34d Mon Sep 17 00:00:00 2001 From: Rituraj12345 Date: Thu, 23 Apr 2020 11:51:59 +0530 Subject: [PATCH 022/223] Updating instead of foo to example (#6591) Updating instead of foo to example -code correction --- website/docs/r/iothub_consumer_group.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/iothub_consumer_group.html.markdown b/website/docs/r/iothub_consumer_group.html.markdown index b230c510957fd..d4c54d91f26ac 100644 --- a/website/docs/r/iothub_consumer_group.html.markdown +++ b/website/docs/r/iothub_consumer_group.html.markdown @@ -37,7 +37,7 @@ resource "azurerm_iothub_consumer_group" "example" { name = "terraform" iothub_name = azurerm_iothub.example.name eventhub_endpoint_name = "events" - resource_group_name = azurerm_resource_group.foo.name + resource_group_name = azurerm_resource_group.example.name } ``` From 66f67d47d347ef974fe8ad04d3b02560379e1ae5 Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Wed, 22 Apr 2020 23:23:17 -0700 Subject: [PATCH 023/223] Revert "CDN Endpoint: make origin_host_header required " (#6583) --- .../services/cdn/resource_arm_cdn_endpoint.go | 3 ++- .../cdn/tests/resource_arm_cdn_endpoint_test.go | 14 -------------- website/docs/r/cdn_endpoint.html.markdown | 4 +--- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/azurerm/internal/services/cdn/resource_arm_cdn_endpoint.go b/azurerm/internal/services/cdn/resource_arm_cdn_endpoint.go index 4888a50b26865..2572d5fe44121 100644 --- a/azurerm/internal/services/cdn/resource_arm_cdn_endpoint.go +++ b/azurerm/internal/services/cdn/resource_arm_cdn_endpoint.go @@ -58,7 +58,8 @@ func resourceArmCdnEndpoint() *schema.Resource { "origin_host_header": { Type: schema.TypeString, - Required: true, + Optional: true, + Computed: true, }, "is_http_allowed": { diff --git a/azurerm/internal/services/cdn/tests/resource_arm_cdn_endpoint_test.go b/azurerm/internal/services/cdn/tests/resource_arm_cdn_endpoint_test.go index d67442ad2da69..3c35f148f993b 100644 --- a/azurerm/internal/services/cdn/tests/resource_arm_cdn_endpoint_test.go +++ b/azurerm/internal/services/cdn/tests/resource_arm_cdn_endpoint_test.go @@ -449,8 +449,6 @@ resource "azurerm_cdn_endpoint" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name - origin_host_header = "www.example.com" - origin { name = "acceptanceTestCdnOrigin1" host_name = "www.example.com" @@ -472,8 +470,6 @@ resource "azurerm_cdn_endpoint" "import" { location = azurerm_cdn_endpoint.test.location resource_group_name = azurerm_cdn_endpoint.test.resource_group_name - origin_host_header = "www.example.com" - origin { name = "acceptanceTestCdnOrigin1" host_name = "www.example.com" @@ -548,8 +544,6 @@ resource "azurerm_cdn_endpoint" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name - origin_host_header = "www.example.com" - origin { name = "acceptanceTestCdnOrigin2" host_name = "www.example.com" @@ -589,8 +583,6 @@ resource "azurerm_cdn_endpoint" "test" { location = azurerm_resource_group.test.location resource_group_name = azurerm_resource_group.test.name - origin_host_header = "www.example.com" - origin { name = "acceptanceTestCdnOrigin2" host_name = "www.example.com" @@ -633,8 +625,6 @@ resource "azurerm_cdn_endpoint" "test" { origin_path = "/origin-path" probe_path = "/origin-path/probe" - origin_host_header = "www.example.com" - origin { name = "acceptanceTestCdnOrigin1" host_name = "www.example.com" @@ -684,8 +674,6 @@ resource "azurerm_cdn_endpoint" "test" { is_https_allowed = true optimization_type = "GeneralWebDelivery" - origin_host_header = "www.example.com" - origin { name = "acceptanceTestCdnOrigin1" host_name = "www.example.com" @@ -775,8 +763,6 @@ resource "azurerm_cdn_endpoint" "test" { is_http_allowed = %s is_https_allowed = %s - origin_host_header = "www.example.com" - origin { name = "acceptanceTestCdnOrigin1" host_name = "www.example.com" diff --git a/website/docs/r/cdn_endpoint.html.markdown b/website/docs/r/cdn_endpoint.html.markdown index fbc2e3af9ca9d..e75d1d2b295bf 100644 --- a/website/docs/r/cdn_endpoint.html.markdown +++ b/website/docs/r/cdn_endpoint.html.markdown @@ -31,8 +31,6 @@ resource "azurerm_cdn_endpoint" "example" { location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name - origin_host_header = "www.example.com" - origin { name = "example" host_name = "www.example.com" @@ -68,7 +66,7 @@ The following arguments are supported: * `origin` - (Required) The set of origins of the CDN endpoint. When multiple origins exist, the first origin will be used as primary and rest will be used as failover options. Each `origin` block supports fields documented below. -* `origin_host_header` - (Required) The host header CDN provider will send along with content requests to origins. Defaults to the host name of the origin. +* `origin_host_header` - (Optional) The host header CDN provider will send along with content requests to origins. Defaults to the host name of the origin. * `origin_path` - (Optional) The path used at for origin requests. From 538f7b1f38784d5df2e5c1573ad5a0ca1f8afd81 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Fri, 24 Apr 2020 15:30:55 +0800 Subject: [PATCH 024/223] ... --- a | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 a diff --git a/a b/a new file mode 100644 index 0000000000000..e69de29bb2d1d From ac23ac7c064874614a2e9e1d82376e9d053cf704 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Fri, 24 Apr 2020 15:31:15 +0800 Subject: [PATCH 025/223] ... --- a | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 a diff --git a/a b/a deleted file mode 100644 index e69de29bb2d1d..0000000000000 From 0b228b555d649e3a579d9a1a2267a7194f846efd Mon Sep 17 00:00:00 2001 From: kosinsky Date: Fri, 24 Apr 2020 07:49:57 -0700 Subject: [PATCH 026/223] Fix typo Co-Authored-By: Steve <11830746+jackofallops@users.noreply.github.com> --- website/docs/r/hdinsight_hadoop_cluster.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/hdinsight_hadoop_cluster.html.markdown b/website/docs/r/hdinsight_hadoop_cluster.html.markdown index 6513a11331072..bc7e707932a2b 100644 --- a/website/docs/r/hdinsight_hadoop_cluster.html.markdown +++ b/website/docs/r/hdinsight_hadoop_cluster.html.markdown @@ -261,7 +261,7 @@ A `metastores` block supports the following: * `oozie` - (Optional) A `oozie` block as defined below. -* `ambari` - (Optional) A `amabari` block as defined below. +* `ambari` - (Optional) A `ambari` block as defined below. --- From 5aa43f439582e566e9741334b2e023d366e4f1f2 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Fri, 24 Apr 2020 17:26:50 +0200 Subject: [PATCH 027/223] provider: pinning to Go 1.14.2 --- .gitignore | 3 --- .go-version | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) create mode 100644 .go-version diff --git a/.gitignore b/.gitignore index 06f9a5aecd803..5592125818126 100644 --- a/.gitignore +++ b/.gitignore @@ -35,9 +35,6 @@ website/vendor .env.sh -# goenv version file -.go-version - # generated by the example acceptance tests examples/**/test.tf examples/**/test.tfvars diff --git a/.go-version b/.go-version new file mode 100644 index 0000000000000..a4cc55716f5d9 --- /dev/null +++ b/.go-version @@ -0,0 +1 @@ +1.14.2 From 72652caf5e27e0aa5e135fd7dfa25f0ad017595f Mon Sep 17 00:00:00 2001 From: Konstantin Kosinsky Date: Fri, 24 Apr 2020 09:55:24 -0700 Subject: [PATCH 028/223] Added test for hive only and check in reading code --- azurerm/helpers/azure/hdinsight.go | 9 ++ ...ource_arm_hdinsight_hadoop_cluster_test.go | 106 ++++++++++++++++++ 2 files changed, 115 insertions(+) diff --git a/azurerm/helpers/azure/hdinsight.go b/azurerm/helpers/azure/hdinsight.go index 4bef5695452c2..ca129004101e5 100644 --- a/azurerm/helpers/azure/hdinsight.go +++ b/azurerm/helpers/azure/hdinsight.go @@ -174,6 +174,9 @@ func ExpandHDInsightsConfigurations(input []interface{}) map[string]interface{} } func ExpandHDInsightsHiveMetastore(input []interface{}) map[string]interface{} { + if len(input) == 0 { + return nil + } vs := input[0].(map[string]interface{}) server := vs["server"].(string) @@ -200,6 +203,9 @@ func ExpandHDInsightsHiveMetastore(input []interface{}) map[string]interface{} { } func ExpandHDInsightsOozieMetastore(input []interface{}) map[string]interface{} { + if len(input) == 0 { + return nil + } vs := input[0].(map[string]interface{}) server := vs["server"].(string) @@ -227,6 +233,9 @@ func ExpandHDInsightsOozieMetastore(input []interface{}) map[string]interface{} } func ExpandHDInsightsAmbariMetastore(input []interface{}) map[string]interface{} { + if len(input) == 0 { + return nil + } vs := input[0].(map[string]interface{}) server := vs["server"].(string) diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go b/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go index 6b07d2d6b1e57..d3ee753128821 100644 --- a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go +++ b/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go @@ -374,6 +374,35 @@ func TestAccAzureRMHDInsightHadoopCluster_metastore(t *testing.T) { }) } +func TestAccAzureRMHDInsightHadoopCluster_hiveMetastore(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_hdinsight_hadoop_cluster", "test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMHDInsightClusterDestroy(data.ResourceType), + Steps: []resource.TestStep{ + { + Config: testAccAzureRMHDInsightHadoopCluster_hiveMetastore(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMHDInsightClusterExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "https_endpoint"), + resource.TestCheckResourceAttrSet(data.ResourceName, "ssh_endpoint"), + ), + }, + data.ImportStep("roles.0.head_node.0.password", + "roles.0.head_node.0.vm_size", + "roles.0.worker_node.0.password", + "roles.0.worker_node.0.vm_size", + "roles.0.zookeeper_node.0.password", + "roles.0.zookeeper_node.0.vm_size", + "storage_account", + "metastores.0.hive.0.password", + "metastores.0.oozie.0.password", + "metastores.0.ambari.0.password"), + }, + }) +} + func testAccAzureRMHDInsightHadoopCluster_basic(data acceptance.TestData) string { template := testAccAzureRMHDInsightHadoopCluster_template(data) return fmt.Sprintf(` @@ -1178,3 +1207,80 @@ resource "azurerm_hdinsight_hadoop_cluster" "test" { } `, template, data.RandomInteger, data.RandomInteger) } + +func testAccAzureRMHDInsightHadoopCluster_hiveMetastore(data acceptance.TestData) string { + template := testAccAzureRMHDInsightHadoopCluster_template(data) + return fmt.Sprintf(` +%s +resource "azurerm_sql_server" "test" { + name = "acctestsql-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + administrator_login = "sql_admin" + administrator_login_password = "TerrAform123!" + version = "12.0" +} +resource "azurerm_sql_database" "hive" { + name = "hive" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + server_name = azurerm_sql_server.test.name + collation = "SQL_Latin1_General_CP1_CI_AS" + create_mode = "Default" + requested_service_objective_name = "GP_Gen5_2" +} +resource "azurerm_sql_firewall_rule" "AzureServices" { + name = "allow-azure-services" + resource_group_name = azurerm_resource_group.test.name + server_name = azurerm_sql_server.test.name + start_ip_address = "0.0.0.0" + end_ip_address = "0.0.0.0" +} +resource "azurerm_hdinsight_hadoop_cluster" "test" { + name = "acctesthdi-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + cluster_version = "3.6" + tier = "Standard" + component_version { + hadoop = "2.7" + } + gateway { + enabled = true + username = "acctestusrgw" + password = "TerrAform123!" + } + storage_account { + storage_container_id = azurerm_storage_container.test.id + storage_account_key = azurerm_storage_account.test.primary_access_key + is_default = true + } + roles { + head_node { + vm_size = "Standard_D3_v2" + username = "acctestusrvm" + password = "AccTestvdSC4daf986!" + } + worker_node { + vm_size = "Standard_D4_V2" + username = "acctestusrvm" + password = "AccTestvdSC4daf986!" + target_instance_count = 2 + } + zookeeper_node { + vm_size = "Standard_D3_v2" + username = "acctestusrvm" + password = "AccTestvdSC4daf986!" + } + } + metastores { + hive { + server = azurerm_sql_server.test.fully_qualified_domain_name + database_name = azurerm_sql_database.hive.name + username = azurerm_sql_server.test.administrator_login + password = azurerm_sql_server.test.administrator_login_password + } + } +} +`, template, data.RandomInteger, data.RandomInteger) +} From 4855c130e81d3d84e857051041f0044774a5eb18 Mon Sep 17 00:00:00 2001 From: Lucas Huet-Hudson Date: Fri, 24 Apr 2020 13:20:25 -0400 Subject: [PATCH 029/223] `azurerm_api_management_api` - support for openapi v3 content formats #6618 --- .../services/apimanagement/resource_arm_api_management_api.go | 4 ++++ examples/api-management/variables.tf | 2 +- website/docs/r/api_management_api.html.markdown | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api.go b/azurerm/internal/services/apimanagement/resource_arm_api_management_api.go index ea79b207f4be2..5c74cae2cfa32 100644 --- a/azurerm/internal/services/apimanagement/resource_arm_api_management_api.go +++ b/azurerm/internal/services/apimanagement/resource_arm_api_management_api.go @@ -100,6 +100,10 @@ func resourceArmApiManagementApi() *schema.Resource { Type: schema.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ + string(apimanagement.Openapi), + string(apimanagement.Openapijson), + string(apimanagement.OpenapijsonLink), + string(apimanagement.OpenapiLink), string(apimanagement.SwaggerJSON), string(apimanagement.SwaggerLinkJSON), string(apimanagement.WadlLinkJSON), diff --git a/examples/api-management/variables.tf b/examples/api-management/variables.tf index 13c4b32c803d5..0d7983f80e21d 100644 --- a/examples/api-management/variables.tf +++ b/examples/api-management/variables.tf @@ -7,7 +7,7 @@ variable "location" { } variable "open_api_spec_content_format" { - description = "The format of the content from which the API Definition should be imported. Possible values are: swagger-json, swagger-link-json, wadl-link-json, wadl-xml, wsdl and wsdl-link." + description = "The format of the content from which the API Definition should be imported. Possible values are: openapi, openapi+json, openapi+json-link, openapi-link, swagger-json, swagger-link-json, wadl-link-json, wadl-xml, wsdl and wsdl-link." } variable "open_api_spec_content_value" { diff --git a/website/docs/r/api_management_api.html.markdown b/website/docs/r/api_management_api.html.markdown index f32cb79d799b7..75e9b4261804e 100644 --- a/website/docs/r/api_management_api.html.markdown +++ b/website/docs/r/api_management_api.html.markdown @@ -84,7 +84,7 @@ The following arguments are supported: A `import` block supports the following: -* `content_format` - (Required) The format of the content from which the API Definition should be imported. Possible values are: `swagger-json`, `swagger-link-json`, `wadl-link-json`, `wadl-xml`, `wsdl` and `wsdl-link`. +* `content_format` - (Required) The format of the content from which the API Definition should be imported. Possible values are: `openapi`, `openapi+json`, `openapi+json-link`, `openapi-link`, `swagger-json`, `swagger-link-json`, `wadl-link-json`, `wadl-xml`, `wsdl` and `wsdl-link`. * `content_value` - (Required) The Content from which the API Definition should be imported. When a `content_format` of `*-link-*` is specified this must be a URL, otherwise this must be defined inline. From 232e8e2d4300602cb3a439bd3990fee4b39b67c1 Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Fri, 24 Apr 2020 10:20:49 -0700 Subject: [PATCH 030/223] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ccbbfa3239e0c..3b245482ea624 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ IMPROVEMENTS: * `azurerm_api_management` - `sku_name` supports Consumption [GH-6602] +* `azurerm_api_management_api` - support for openapi v3 content formats [GH-6618] ## 2.7.0 (April 23, 2020) From ec8406a8e2fc4df0aeea75de27a8e78d8d577981 Mon Sep 17 00:00:00 2001 From: Neil Ye Date: Sat, 25 Apr 2020 05:31:03 +0800 Subject: [PATCH 031/223] Update servicebus name validation (#6607) --- azurerm/helpers/azure/servicebus.go | 7 ------- ...rce_servicebus_namespace_authorization_rule.go | 3 ++- ..._source_servicebus_topic_authorization_rule.go | 3 ++- ...arm_servicebus_namespace_authorization_rule.go | 3 ++- .../servicebus/resource_arm_servicebus_queue.go | 3 ++- ...rce_arm_servicebus_queue_authorization_rule.go | 3 ++- .../resource_arm_servicebus_subscription.go | 3 ++- .../resource_arm_servicebus_subscription_rule.go | 3 ++- .../servicebus/resource_arm_servicebus_topic.go | 3 ++- ...rce_arm_servicebus_topic_authorization_rule.go | 3 ++- .../services/servicebus/validate/namespace.go | 15 +++++++++++++-- 11 files changed, 31 insertions(+), 18 deletions(-) diff --git a/azurerm/helpers/azure/servicebus.go b/azurerm/helpers/azure/servicebus.go index 62d5ba71727b1..99cdfe3db0ae6 100644 --- a/azurerm/helpers/azure/servicebus.go +++ b/azurerm/helpers/azure/servicebus.go @@ -12,13 +12,6 @@ import ( ) // validation -func ValidateServiceBusNamespaceName() schema.SchemaValidateFunc { - return validation.StringMatch( - regexp.MustCompile("^[a-zA-Z][-a-zA-Z0-9]{4,48}[a-zA-Z0-9]$"), - "The namespace name can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number and be between 6 and 50 characters long.", - ) -} - func ValidateServiceBusQueueName() schema.SchemaValidateFunc { return validation.StringMatch( regexp.MustCompile(`^[a-zA-Z0-9][\w-./~]{0,258}([a-zA-Z0-9])?$`), diff --git a/azurerm/internal/services/servicebus/data_source_servicebus_namespace_authorization_rule.go b/azurerm/internal/services/servicebus/data_source_servicebus_namespace_authorization_rule.go index 2d3cc589867dd..cafb7ca7b9fb6 100644 --- a/azurerm/internal/services/servicebus/data_source_servicebus_namespace_authorization_rule.go +++ b/azurerm/internal/services/servicebus/data_source_servicebus_namespace_authorization_rule.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -28,7 +29,7 @@ func dataSourceArmServiceBusNamespaceAuthorizationRule() *schema.Resource { "namespace_name": { Type: schema.TypeString, Required: true, - ValidateFunc: azure.ValidateServiceBusNamespaceName(), + ValidateFunc: validate.ServiceBusNamespaceName, }, "resource_group_name": azure.SchemaResourceGroupNameForDataSource(), diff --git a/azurerm/internal/services/servicebus/data_source_servicebus_topic_authorization_rule.go b/azurerm/internal/services/servicebus/data_source_servicebus_topic_authorization_rule.go index 59263a26b1c33..65e94313813db 100644 --- a/azurerm/internal/services/servicebus/data_source_servicebus_topic_authorization_rule.go +++ b/azurerm/internal/services/servicebus/data_source_servicebus_topic_authorization_rule.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -29,7 +30,7 @@ func dataSourceArmServiceBusTopicAuthorizationRule() *schema.Resource { "namespace_name": { Type: schema.TypeString, Required: true, - ValidateFunc: azure.ValidateServiceBusNamespaceName(), + ValidateFunc: validate.ServiceBusNamespaceName, }, "topic_name": { diff --git a/azurerm/internal/services/servicebus/resource_arm_servicebus_namespace_authorization_rule.go b/azurerm/internal/services/servicebus/resource_arm_servicebus_namespace_authorization_rule.go index 2d2888e70363d..cc3102171c595 100644 --- a/azurerm/internal/services/servicebus/resource_arm_servicebus_namespace_authorization_rule.go +++ b/azurerm/internal/services/servicebus/resource_arm_servicebus_namespace_authorization_rule.go @@ -11,6 +11,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -46,7 +47,7 @@ func resourceArmServiceBusNamespaceAuthorizationRule() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: azure.ValidateServiceBusNamespaceName(), + ValidateFunc: validate.ServiceBusNamespaceName, }, "resource_group_name": azure.SchemaResourceGroupName(), diff --git a/azurerm/internal/services/servicebus/resource_arm_servicebus_queue.go b/azurerm/internal/services/servicebus/resource_arm_servicebus_queue.go index b92f7bdeb6267..b0a6a61caa6c7 100644 --- a/azurerm/internal/services/servicebus/resource_arm_servicebus_queue.go +++ b/azurerm/internal/services/servicebus/resource_arm_servicebus_queue.go @@ -13,6 +13,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + azValidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -46,7 +47,7 @@ func resourceArmServiceBusQueue() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: azure.ValidateServiceBusNamespaceName(), + ValidateFunc: azValidate.ServiceBusNamespaceName, }, "resource_group_name": azure.SchemaResourceGroupName(), diff --git a/azurerm/internal/services/servicebus/resource_arm_servicebus_queue_authorization_rule.go b/azurerm/internal/services/servicebus/resource_arm_servicebus_queue_authorization_rule.go index 895bd7ed1a15b..030bd020e6e36 100644 --- a/azurerm/internal/services/servicebus/resource_arm_servicebus_queue_authorization_rule.go +++ b/azurerm/internal/services/servicebus/resource_arm_servicebus_queue_authorization_rule.go @@ -11,6 +11,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -45,7 +46,7 @@ func resourceArmServiceBusQueueAuthorizationRule() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: azure.ValidateServiceBusNamespaceName(), + ValidateFunc: validate.ServiceBusNamespaceName, }, "queue_name": { diff --git a/azurerm/internal/services/servicebus/resource_arm_servicebus_subscription.go b/azurerm/internal/services/servicebus/resource_arm_servicebus_subscription.go index 164c139b83009..4d05e785a4d4c 100644 --- a/azurerm/internal/services/servicebus/resource_arm_servicebus_subscription.go +++ b/azurerm/internal/services/servicebus/resource_arm_servicebus_subscription.go @@ -11,6 +11,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -44,7 +45,7 @@ func resourceArmServiceBusSubscription() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: azure.ValidateServiceBusNamespaceName(), + ValidateFunc: validate.ServiceBusNamespaceName, }, "topic_name": { diff --git a/azurerm/internal/services/servicebus/resource_arm_servicebus_subscription_rule.go b/azurerm/internal/services/servicebus/resource_arm_servicebus_subscription_rule.go index c8f82a1d66d1f..ddcf0d31397ae 100644 --- a/azurerm/internal/services/servicebus/resource_arm_servicebus_subscription_rule.go +++ b/azurerm/internal/services/servicebus/resource_arm_servicebus_subscription_rule.go @@ -14,6 +14,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -49,7 +50,7 @@ func resourceArmServiceBusSubscriptionRule() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: azure.ValidateServiceBusNamespaceName(), + ValidateFunc: validate.ServiceBusNamespaceName, }, "topic_name": { diff --git a/azurerm/internal/services/servicebus/resource_arm_servicebus_topic.go b/azurerm/internal/services/servicebus/resource_arm_servicebus_topic.go index 2c648c4bca254..9d062a41468b0 100644 --- a/azurerm/internal/services/servicebus/resource_arm_servicebus_topic.go +++ b/azurerm/internal/services/servicebus/resource_arm_servicebus_topic.go @@ -14,6 +14,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + azValidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -48,7 +49,7 @@ func resourceArmServiceBusTopic() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: azure.ValidateServiceBusNamespaceName(), + ValidateFunc: azValidate.ServiceBusNamespaceName, }, "resource_group_name": azure.SchemaResourceGroupName(), diff --git a/azurerm/internal/services/servicebus/resource_arm_servicebus_topic_authorization_rule.go b/azurerm/internal/services/servicebus/resource_arm_servicebus_topic_authorization_rule.go index 5e5ea7108e17f..6bda82477890b 100644 --- a/azurerm/internal/services/servicebus/resource_arm_servicebus_topic_authorization_rule.go +++ b/azurerm/internal/services/servicebus/resource_arm_servicebus_topic_authorization_rule.go @@ -11,6 +11,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -45,7 +46,7 @@ func resourceArmServiceBusTopicAuthorizationRule() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: azure.ValidateServiceBusNamespaceName(), + ValidateFunc: validate.ServiceBusNamespaceName, }, "topic_name": { diff --git a/azurerm/internal/services/servicebus/validate/namespace.go b/azurerm/internal/services/servicebus/validate/namespace.go index fb488f0c69099..4c619f09f28d6 100644 --- a/azurerm/internal/services/servicebus/validate/namespace.go +++ b/azurerm/internal/services/servicebus/validate/namespace.go @@ -3,6 +3,7 @@ package validate import ( "fmt" "regexp" + "strings" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus/parse" ) @@ -29,10 +30,20 @@ func ServiceBusNamespaceName(i interface{}, k string) (warnings []string, errors return } - if matched := regexp.MustCompile("^[a-zA-Z][-a-zA-Z0-9]{0,100}[a-zA-Z0-9]$").MatchString(v); !matched { - errors = append(errors, fmt.Errorf("%q can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number", k)) + if matched := regexp.MustCompile("^[a-zA-Z][-a-zA-Z0-9]{4,48}[a-zA-Z0-9]$").MatchString(v); !matched { + errors = append(errors, fmt.Errorf("%q can contain only letters, numbers, and hyphens. The namespace must start with a letter, and it must end with a letter or number and be between 6 and 50 characters long", k)) return } + // The name cannot end with "-", "-sb" or "-mgmt". + // See more details from link https://docs.microsoft.com/en-us/rest/api/servicebus/create-namespace. + illegalSuffixes := []string{"-", "-sb", "-mgmt"} + for _, illegalSuffix := range illegalSuffixes { + if strings.HasSuffix(v, illegalSuffix) { + errors = append(errors, fmt.Errorf("%q cannot end with a hyphen, -sb, or -mgmt", k)) + return + } + } + return warnings, errors } From 189a4599e83e233afb59505f0a458bbf80285a6a Mon Sep 17 00:00:00 2001 From: Konstantin Kosinsky Date: Fri, 24 Apr 2020 17:54:18 -0700 Subject: [PATCH 032/223] Update tests --- ...ource_arm_hdinsight_hadoop_cluster_test.go | 43 +++++++++++++++++-- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go b/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go index d3ee753128821..313981e4b5c20 100644 --- a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go +++ b/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go @@ -345,7 +345,7 @@ func TestAccAzureRMHDInsightHadoopCluster_tls(t *testing.T) { }) } -func TestAccAzureRMHDInsightHadoopCluster_metastore(t *testing.T) { +func TestAccAzureRMHDInsightHadoopCluster_allMetastores(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_hdinsight_hadoop_cluster", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, @@ -353,7 +353,7 @@ func TestAccAzureRMHDInsightHadoopCluster_metastore(t *testing.T) { CheckDestroy: testCheckAzureRMHDInsightClusterDestroy(data.ResourceType), Steps: []resource.TestStep{ { - Config: testAccAzureRMHDInsightHadoopCluster_metastore(data), + Config: testAccAzureRMHDInsightHadoopCluster_allMetastores(data), Check: resource.ComposeTestCheckFunc( testCheckAzureRMHDInsightClusterExists(data.ResourceName), resource.TestCheckResourceAttrSet(data.ResourceName, "https_endpoint"), @@ -389,6 +389,43 @@ func TestAccAzureRMHDInsightHadoopCluster_hiveMetastore(t *testing.T) { resource.TestCheckResourceAttrSet(data.ResourceName, "ssh_endpoint"), ), }, + }, + }) +} + +func TestAccAzureRMHDInsightHadoopCluster_updateMetastore(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_hdinsight_hadoop_cluster", "test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMHDInsightClusterDestroy(data.ResourceType), + Steps: []resource.TestStep{ + { + Config: testAccAzureRMHDInsightHadoopCluster_hiveMetastore(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMHDInsightClusterExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "https_endpoint"), + resource.TestCheckResourceAttrSet(data.ResourceName, "ssh_endpoint"), + ), + }, + data.ImportStep("roles.0.head_node.0.password", + "roles.0.head_node.0.vm_size", + "roles.0.worker_node.0.password", + "roles.0.worker_node.0.vm_size", + "roles.0.zookeeper_node.0.password", + "roles.0.zookeeper_node.0.vm_size", + "storage_account", + "metastores.0.hive.0.password", + "metastores.0.oozie.0.password", + "metastores.0.ambari.0.password"), + { + Config: testAccAzureRMHDInsightHadoopCluster_allMetastores(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMHDInsightClusterExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "https_endpoint"), + resource.TestCheckResourceAttrSet(data.ResourceName, "ssh_endpoint"), + ), + }, data.ImportStep("roles.0.head_node.0.password", "roles.0.head_node.0.vm_size", "roles.0.worker_node.0.password", @@ -1101,7 +1138,7 @@ resource "azurerm_hdinsight_hadoop_cluster" "test" { `, template, data.RandomInteger) } -func testAccAzureRMHDInsightHadoopCluster_metastore(data acceptance.TestData) string { +func testAccAzureRMHDInsightHadoopCluster_allMetastores(data acceptance.TestData) string { template := testAccAzureRMHDInsightHadoopCluster_template(data) return fmt.Sprintf(` %s From ca6c4b22347d22197ced2384f7fc7c7367566e73 Mon Sep 17 00:00:00 2001 From: Yuping Wei <56525716+yupwei68@users.noreply.github.com> Date: Sun, 26 Apr 2020 10:03:10 +0800 Subject: [PATCH 033/223] Fix `azurerm_sql_database` blob auditing error under online secondary create mode (#6402) --- .../internal/services/mssql/client/client.go | 7 +- .../mssql/helper/sql_extended_auditing.go | 98 ++++++++++++++++ .../mssql/resource_arm_mssql_database.go | 38 +++++- .../tests/resource_arm_mssql_database_test.go | 108 ++++++++++++++++++ .../services/sql/resource_arm_sql_database.go | 24 ++-- .../tests/resource_arm_sql_database_test.go | 75 ++++++++++++ website/docs/r/mssql_database.html.markdown | 27 +++++ 7 files changed, 363 insertions(+), 14 deletions(-) create mode 100644 azurerm/internal/services/mssql/helper/sql_extended_auditing.go diff --git a/azurerm/internal/services/mssql/client/client.go b/azurerm/internal/services/mssql/client/client.go index 8818b83641041..b7334e2ea491e 100644 --- a/azurerm/internal/services/mssql/client/client.go +++ b/azurerm/internal/services/mssql/client/client.go @@ -8,6 +8,7 @@ import ( type Client struct { DatabasesClient *sql.DatabasesClient + DatabaseExtendedBlobAuditingPoliciesClient *sql.ExtendedDatabaseBlobAuditingPoliciesClient DatabaseThreatDetectionPoliciesClient *sql.DatabaseThreatDetectionPoliciesClient ElasticPoolsClient *sql.ElasticPoolsClient DatabaseVulnerabilityAssessmentRuleBaselinesClient *sql.DatabaseVulnerabilityAssessmentRuleBaselinesClient @@ -21,6 +22,9 @@ func NewClient(o *common.ClientOptions) *Client { databasesClient := sql.NewDatabasesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&databasesClient.Client, o.ResourceManagerAuthorizer) + databaseExtendedBlobAuditingPoliciesClient := sql.NewExtendedDatabaseBlobAuditingPoliciesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + o.ConfigureClient(&databaseExtendedBlobAuditingPoliciesClient.Client, o.ResourceManagerAuthorizer) + databaseThreatDetectionPoliciesClient := sql.NewDatabaseThreatDetectionPoliciesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) o.ConfigureClient(&databaseThreatDetectionPoliciesClient.Client, o.ResourceManagerAuthorizer) @@ -43,7 +47,8 @@ func NewClient(o *common.ClientOptions) *Client { o.ConfigureClient(&sqlVirtualMachinesClient.Client, o.ResourceManagerAuthorizer) return &Client{ - DatabasesClient: &databasesClient, + DatabasesClient: &databasesClient, + DatabaseExtendedBlobAuditingPoliciesClient: &databaseExtendedBlobAuditingPoliciesClient, DatabaseThreatDetectionPoliciesClient: &databaseThreatDetectionPoliciesClient, DatabaseVulnerabilityAssessmentRuleBaselinesClient: &databaseVulnerabilityAssessmentRuleBaselinesClient, ElasticPoolsClient: &elasticPoolsClient, diff --git a/azurerm/internal/services/mssql/helper/sql_extended_auditing.go b/azurerm/internal/services/mssql/helper/sql_extended_auditing.go new file mode 100644 index 0000000000000..2127993fd5845 --- /dev/null +++ b/azurerm/internal/services/mssql/helper/sql_extended_auditing.go @@ -0,0 +1,98 @@ +package helper + +import ( + "github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v3.0/sql" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func ExtendedAuditingSchema() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "storage_account_access_key": { + Type: schema.TypeString, + Required: true, + Sensitive: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "storage_endpoint": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.IsURLWithHTTPS, + }, + + "storage_account_access_key_is_secondary": { + Type: schema.TypeBool, + Optional: true, + }, + + "retention_in_days": { + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntBetween(0, 3285), + }, + }, + }, + } +} + +func ExpandAzureRmMsSqlDBBlobAuditingPolicies(input []interface{}) *sql.ExtendedDatabaseBlobAuditingPolicyProperties { + if len(input) == 0 { + return &sql.ExtendedDatabaseBlobAuditingPolicyProperties{ + State: sql.BlobAuditingPolicyStateDisabled, + } + } + dbBlobAuditingPolicies := input[0].(map[string]interface{}) + + ExtendedDatabaseBlobAuditingPolicyProperties := sql.ExtendedDatabaseBlobAuditingPolicyProperties{ + State: sql.BlobAuditingPolicyStateEnabled, + StorageAccountAccessKey: utils.String(dbBlobAuditingPolicies["storage_account_access_key"].(string)), + StorageEndpoint: utils.String(dbBlobAuditingPolicies["storage_endpoint"].(string)), + } + if v, ok := dbBlobAuditingPolicies["storage_account_access_key_is_secondary"]; ok { + ExtendedDatabaseBlobAuditingPolicyProperties.IsStorageSecondaryKeyInUse = utils.Bool(v.(bool)) + } + if v, ok := dbBlobAuditingPolicies["retention_in_days"]; ok { + ExtendedDatabaseBlobAuditingPolicyProperties.RetentionDays = utils.Int32(int32(v.(int))) + } + + return &ExtendedDatabaseBlobAuditingPolicyProperties +} + +func FlattenAzureRmMsSqlDBBlobAuditingPolicies(extendedDatabaseBlobAuditingPolicy *sql.ExtendedDatabaseBlobAuditingPolicy, d *schema.ResourceData) []interface{} { + if extendedDatabaseBlobAuditingPolicy == nil || extendedDatabaseBlobAuditingPolicy.State == sql.BlobAuditingPolicyStateDisabled { + return []interface{}{} + } + var storageAccessKey, storageEndpoint string + // storage_account_access_key will not be returned, so we transfer the schema value + if v, ok := d.GetOk("extended_auditing_policy.0.storage_account_access_key"); ok { + storageAccessKey = v.(string) + } + + if extendedDatabaseBlobAuditingPolicy.StorageEndpoint != nil { + storageEndpoint = *extendedDatabaseBlobAuditingPolicy.StorageEndpoint + } + var secondKeyInUse bool + if extendedDatabaseBlobAuditingPolicy.IsStorageSecondaryKeyInUse != nil { + secondKeyInUse = *extendedDatabaseBlobAuditingPolicy.IsStorageSecondaryKeyInUse + } + var retentionDays int32 + if extendedDatabaseBlobAuditingPolicy.RetentionDays != nil { + retentionDays = *extendedDatabaseBlobAuditingPolicy.RetentionDays + } + + return []interface{}{ + map[string]interface{}{ + "storage_account_access_key": storageAccessKey, + "storage_endpoint": storageEndpoint, + "storage_account_access_key_is_secondary": secondKeyInUse, + "retention_in_days": retentionDays, + }, + } +} diff --git a/azurerm/internal/services/mssql/resource_arm_mssql_database.go b/azurerm/internal/services/mssql/resource_arm_mssql_database.go index 8f7e8cd92f12a..e679b45fae0ba 100644 --- a/azurerm/internal/services/mssql/resource_arm_mssql_database.go +++ b/azurerm/internal/services/mssql/resource_arm_mssql_database.go @@ -17,6 +17,7 @@ import ( azValidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/mssql/helper" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/mssql/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/mssql/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" @@ -99,6 +100,8 @@ func resourceArmMsSqlDatabase() *schema.Resource { ValidateFunc: validate.MsSqlElasticPoolID, }, + "extended_auditing_policy": helper.ExtendedAuditingSchema(), + "license_type": { Type: schema.TypeString, Optional: true, @@ -270,6 +273,7 @@ func resourceArmMsSqlDatabase() *schema.Resource { func resourceArmMsSqlDatabaseCreateUpdate(d *schema.ResourceData, meta interface{}) error { client := meta.(*clients.Client).MSSQL.DatabasesClient + auditingClient := meta.(*clients.Client).MSSQL.DatabaseExtendedBlobAuditingPoliciesClient serverClient := meta.(*clients.Client).MSSQL.ServersClient threatClient := meta.(*clients.Client).MSSQL.DatabaseThreatDetectionPoliciesClient ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) @@ -321,11 +325,15 @@ func resourceArmMsSqlDatabaseCreateUpdate(d *schema.ResourceData, meta interface Tags: tags.Expand(d.Get("tags").(map[string]interface{})), } - if v, ok := d.GetOk("create_mode"); ok { - if _, ok := d.GetOk("creation_source_database_id"); (v.(string) == string(sql.CreateModeCopy) || v.(string) == string(sql.CreateModePointInTimeRestore) || v.(string) == string(sql.CreateModeRestore) || v.(string) == string(sql.CreateModeSecondary)) && !ok { - return fmt.Errorf("'creation_source_database_id' is required for create_mode %s", v.(string)) - } - params.DatabaseProperties.CreateMode = sql.CreateMode(v.(string)) + createMode, ok := d.GetOk("create_mode") + if _, dbok := d.GetOk("creation_source_database_id"); ok && (createMode.(string) == string(sql.CreateModeCopy) || createMode.(string) == string(sql.CreateModePointInTimeRestore) || createMode.(string) == string(sql.CreateModeRestore) || createMode.(string) == string(sql.CreateModeSecondary)) && !dbok { + return fmt.Errorf("'creation_source_database_id' is required for create_mode %s", createMode.(string)) + } + params.DatabaseProperties.CreateMode = sql.CreateMode(createMode.(string)) + + auditingPolicies := d.Get("extended_auditing_policy").([]interface{}) + if (createMode == string(sql.CreateModeOnlineSecondary) || createMode == string(sql.Secondary)) && len(auditingPolicies) > 0 { + return fmt.Errorf("could not configure auditing policies on SQL Database %q (Resource Group %q, Server %q) in secondary create mode", name, serverId.ResourceGroup, serverId.Name) } if v, ok := d.GetOk("max_size_gb"); ok { @@ -382,12 +390,22 @@ func resourceArmMsSqlDatabaseCreateUpdate(d *schema.ResourceData, meta interface return fmt.Errorf("setting database threat detection policy: %+v", err) } + if createMode != string(sql.CreateModeOnlineSecondary) && createMode != string(sql.CreateModeSecondary) { + auditingProps := sql.ExtendedDatabaseBlobAuditingPolicy{ + ExtendedDatabaseBlobAuditingPolicyProperties: helper.ExpandAzureRmMsSqlDBBlobAuditingPolicies(auditingPolicies), + } + if _, err = auditingClient.CreateOrUpdate(ctx, serverId.ResourceGroup, serverId.Name, name, auditingProps); err != nil { + return fmt.Errorf("failure in issuing create/update request for SQL Database %q Blob Auditing Policies(SQL Server %q/ Resource Group %q): %+v", name, serverId.Name, serverId.ResourceGroup, err) + } + } + return resourceArmMsSqlDatabaseRead(d, meta) } func resourceArmMsSqlDatabaseRead(d *schema.ResourceData, meta interface{}) error { client := meta.(*clients.Client).MSSQL.DatabasesClient threatClient := meta.(*clients.Client).MSSQL.DatabaseThreatDetectionPoliciesClient + auditingClient := meta.(*clients.Client).MSSQL.DatabaseExtendedBlobAuditingPoliciesClient ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() @@ -441,6 +459,16 @@ func resourceArmMsSqlDatabaseRead(d *schema.ResourceData, meta interface{}) erro } } + auditingResp, err := auditingClient.Get(ctx, id.ResourceGroup, id.MsSqlServer, id.Name) + if err != nil { + return fmt.Errorf("failure in reading SQL Database %q: %v Blob Auditing Policies", id.Name, err) + } + + flattenBlobAuditing := helper.FlattenAzureRmMsSqlDBBlobAuditingPolicies(&auditingResp, d) + if err := d.Set("extended_auditing_policy", flattenBlobAuditing); err != nil { + return fmt.Errorf("failure in setting `extended_auditing_policy`: %+v", err) + } + return tags.FlattenAndSet(d, resp.Tags) } diff --git a/azurerm/internal/services/mssql/tests/resource_arm_mssql_database_test.go b/azurerm/internal/services/mssql/tests/resource_arm_mssql_database_test.go index f6b28b315cb7b..462c2d6f3112c 100644 --- a/azurerm/internal/services/mssql/tests/resource_arm_mssql_database_test.go +++ b/azurerm/internal/services/mssql/tests/resource_arm_mssql_database_test.go @@ -327,6 +327,46 @@ func TestAccAzureRMMsSqlDatabase_threatDetectionPolicy(t *testing.T) { }) } +func TestAccAzureRMSqlDatabase_withBlobAuditingPolices(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_mssql_database", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMMsSqlDatabaseDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMMsSqlDatabase_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMMsSqlDatabaseExists(data.ResourceName), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMMsSqlDatabase_withBlobAuditingPolices(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMMsSqlDatabaseExists(data.ResourceName), + ), + }, + data.ImportStep("extended_auditing_policy.0.storage_account_access_key"), + { + Config: testAccAzureRMMsSqlDatabase_withBlobAuditingPolicesUpdated(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMMsSqlDatabaseExists(data.ResourceName), + ), + }, + data.ImportStep("extended_auditing_policy.0.storage_account_access_key"), + { + Config: testAccAzureRMMsSqlDatabase_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMMsSqlDatabaseExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + func testCheckAzureRMMsSqlDatabaseExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { client := acceptance.AzureProvider.Meta().(*clients.Client).MSSQL.DatabasesClient @@ -698,3 +738,71 @@ resource "azurerm_mssql_database" "test" { } `, template, data.RandomInteger, state) } + +func testAccAzureRMMsSqlDatabase_withBlobAuditingPolices(data acceptance.TestData) string { + template := testAccAzureRMMsSqlDatabase_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_storage_account" "test" { + name = "acctest%[2]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" +} + +resource "azurerm_storage_account" "test2" { + name = "acctest2%[2]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" +} + +resource "azurerm_mssql_database" "test" { + name = "acctest-db-%[3]d" + server_id = azurerm_sql_server.test.id + extended_auditing_policy { + storage_endpoint = azurerm_storage_account.test.primary_blob_endpoint + storage_account_access_key = azurerm_storage_account.test.primary_access_key + storage_account_access_key_is_secondary = true + retention_in_days = 6 + } +} +`, template, data.RandomIntOfLength(15), data.RandomInteger) +} + +func testAccAzureRMMsSqlDatabase_withBlobAuditingPolicesUpdated(data acceptance.TestData) string { + template := testAccAzureRMMsSqlDatabase_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_storage_account" "test" { + name = "acctest%[2]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" +} + +resource "azurerm_storage_account" "test2" { + name = "acctest2%[2]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" +} + +resource "azurerm_mssql_database" "test" { + name = "acctest-db-%[3]d" + server_id = azurerm_sql_server.test.id + extended_auditing_policy { + storage_endpoint = azurerm_storage_account.test2.primary_blob_endpoint + storage_account_access_key = azurerm_storage_account.test2.primary_access_key + storage_account_access_key_is_secondary = false + retention_in_days = 3 + } +} +`, template, data.RandomIntOfLength(15), data.RandomInteger) +} diff --git a/azurerm/internal/services/sql/resource_arm_sql_database.go b/azurerm/internal/services/sql/resource_arm_sql_database.go index bd86542e905bb..2f848614d4bba 100644 --- a/azurerm/internal/services/sql/resource_arm_sql_database.go +++ b/azurerm/internal/services/sql/resource_arm_sql_database.go @@ -365,6 +365,12 @@ func resourceArmSqlDatabaseCreateUpdate(d *schema.ResourceData, meta interface{} resourceGroup := d.Get("resource_group_name").(string) location := azure.NormalizeLocation(d.Get("location").(string)) createMode := d.Get("create_mode").(string) + auditingPolicies := d.Get("extended_auditing_policy").([]interface{}) + + if createMode == string(sql.CreateModeOnlineSecondary) && len(auditingPolicies) > 0 { + return fmt.Errorf("could not configure auditing policies on SQL Database %q (Resource Group %q, Server %q) in online secondary create mode", name, resourceGroup, serverName) + } + zoneRedundant := d.Get("zone_redundant").(bool) t := d.Get("tags").(map[string]interface{}) @@ -500,12 +506,14 @@ func resourceArmSqlDatabaseCreateUpdate(d *schema.ResourceData, meta interface{} return fmt.Errorf("Error setting database threat detection policy: %+v", err) } - auditingClient := meta.(*clients.Client).Sql.DatabaseExtendedBlobAuditingPoliciesClient - auditingProps := sql.ExtendedDatabaseBlobAuditingPolicy{ - ExtendedDatabaseBlobAuditingPolicyProperties: helper.ExpandAzureRmSqlDBBlobAuditingPolicies(d.Get("extended_auditing_policy").([]interface{})), - } - if _, err = auditingClient.CreateOrUpdate(ctx, resourceGroup, serverName, name, auditingProps); err != nil { - return fmt.Errorf("Error issuing create/update request for SQL Database %q Blob Auditing Policies(SQL Server %q/ Resource Group %q): %+v", name, serverName, resourceGroup, err) + if createMode != string(sql.CreateModeOnlineSecondary) { + auditingClient := meta.(*clients.Client).Sql.DatabaseExtendedBlobAuditingPoliciesClient + auditingProps := sql.ExtendedDatabaseBlobAuditingPolicy{ + ExtendedDatabaseBlobAuditingPolicyProperties: helper.ExpandAzureRmSqlDBBlobAuditingPolicies(auditingPolicies), + } + if _, err = auditingClient.CreateOrUpdate(ctx, resourceGroup, serverName, name, auditingProps); err != nil { + return fmt.Errorf("failure in issuing create/update request for SQL Database %q Blob Auditing Policies(SQL Server %q/ Resource Group %q): %+v", name, serverName, resourceGroup, err) + } } return resourceArmSqlDatabaseRead(d, meta) @@ -594,12 +602,12 @@ func resourceArmSqlDatabaseRead(d *schema.ResourceData, meta interface{}) error auditingClient := meta.(*clients.Client).Sql.DatabaseExtendedBlobAuditingPoliciesClient auditingResp, err := auditingClient.Get(ctx, resourceGroup, serverName, name) if err != nil { - return fmt.Errorf("Error reading SQL Database %q: %v Blob Auditing Policies", name, err) + return fmt.Errorf("failure in reading SQL Database %q: %v Blob Auditing Policies", name, err) } flattenBlobAuditing := helper.FlattenAzureRmSqlDBBlobAuditingPolicies(&auditingResp, d) if err := d.Set("extended_auditing_policy", flattenBlobAuditing); err != nil { - return fmt.Errorf("Error setting `extended_auditing_policy`: %+v", err) + return fmt.Errorf("failure in setting `extended_auditing_policy`: %+v", err) } return tags.FlattenAndSet(d, resp.Tags) diff --git a/azurerm/internal/services/sql/tests/resource_arm_sql_database_test.go b/azurerm/internal/services/sql/tests/resource_arm_sql_database_test.go index 11ff51d0f7a70..fd7a43e0c99b9 100644 --- a/azurerm/internal/services/sql/tests/resource_arm_sql_database_test.go +++ b/azurerm/internal/services/sql/tests/resource_arm_sql_database_test.go @@ -483,6 +483,25 @@ func TestAccAzureRMSqlDatabase_withBlobAuditingPolicesUpdate(t *testing.T) { }) } +func TestAccAzureRMSqlDatabase_onlineSecondaryMode(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_sql_database", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMSqlDatabaseDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMSqlDatabase_onlineSecondaryMode(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSqlDatabaseExists(data.ResourceName), + ), + }, + data.ImportStep("administrator_login_password", "create_mode"), + }, + }) +} + func testAccAzureRMSqlDatabase_basic(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { @@ -1092,3 +1111,59 @@ resource "azurerm_sql_database" "test" { } `, data.RandomInteger, data.Locations.Primary, data.RandomIntOfLength(15)) } + +func testAccAzureRMSqlDatabase_onlineSecondaryMode(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_sql_server" "test" { + name = "acctestsqlserver%[1]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + version = "12.0" + administrator_login = "mradministrator" + administrator_login_password = "thisIsDog11" +} + +resource "azurerm_sql_database" "test" { + name = "acctestdb%[1]d" + resource_group_name = azurerm_resource_group.test.name + server_name = azurerm_sql_server.test.name + location = azurerm_resource_group.test.location + edition = "Standard" + collation = "SQL_Latin1_General_CP1_CI_AS" + max_size_bytes = "1073741824" + requested_service_objective_name = "S0" +} + +resource "azurerm_resource_group" "test2" { + name = "acctestRG2-%[1]d" + location = "%[3]s" +} + +resource "azurerm_sql_server" "test2" { + name = "acctestsqlserver2%[1]d" + resource_group_name = azurerm_resource_group.test2.name + location = azurerm_resource_group.test2.location + version = "12.0" + administrator_login = "mradministrator" + administrator_login_password = "thisIsDog11" +} + +resource "azurerm_sql_database" "test2" { + name = "acctestdb2%[1]d" + resource_group_name = azurerm_resource_group.test2.name + server_name = azurerm_sql_server.test2.name + location = azurerm_resource_group.test2.location + create_mode = "OnlineSecondary" + source_database_id = azurerm_sql_database.test.id +} +`, data.RandomInteger, data.Locations.Primary, data.Locations.Secondary) +} diff --git a/website/docs/r/mssql_database.html.markdown b/website/docs/r/mssql_database.html.markdown index ad27f10f3605d..ed226c2d1f589 100644 --- a/website/docs/r/mssql_database.html.markdown +++ b/website/docs/r/mssql_database.html.markdown @@ -22,6 +22,14 @@ resource "azurerm_resource_group" "example" { location = "West Europe" } +resource "azurerm_storage_account" "example" { + name = "examplesa" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + account_tier = "Standard" + account_replication_type = "LRS" +} + resource "azurerm_sql_server" "example" { name = "example-sqlserver" resource_group_name = azurerm_resource_group.example.name @@ -40,6 +48,14 @@ resource "azurerm_mssql_database" "test" { sku_name = "BC_Gen5_2" zone_redundant = true + extended_auditing_policy { + storage_endpoint = azurerm_storage_account.example.primary_blob_endpoint + storage_account_access_key = azurerm_storage_account.example.primary_access_key + storage_account_access_key_is_secondary = true + retention_in_days = 6 + } + + tags = { foo = "bar" } @@ -67,6 +83,8 @@ The following arguments are supported: * `elastic_pool_id` - (Optional) Specifies the ID of the elastic pool containing this database. Changing this forces a new resource to be created. +* `extended_auditing_policy` - (Optional) A `extended_auditing_policy` block as defined below. + * `license_type` - (Optional) Specifies the license type applied to this database. Possible values are `LicenseIncluded` and `BasePrice`. * `max_size_gb` - (Optional) The max size of the database in gigabytes. @@ -91,6 +109,7 @@ The following arguments are supported: * `tags` - (Optional) A mapping of tags to assign to the resource. +--- a `threat_detection_policy` block supports the following: * `state` - (Required) The State of the Policy. Possible values are `Enabled`, `Disabled` or `New`. @@ -102,6 +121,14 @@ a `threat_detection_policy` block supports the following: * `storage_endpoint` - (Optional) Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all Threat Detection audit logs. Required if `state` is `Enabled`. * `use_server_default` - (Optional) Should the default server policy be used? Defaults to `Disabled`. +--- + +A `extended_auditing_policy` block supports the following: + +* `storage_account_access_key` - (Required) Specifies the access key to use for the auditing storage account. +* `storage_endpoint` - (Required) Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). +* `storage_account_access_key_is_secondary` - (Optional) Specifies whether `storage_account_access_key` value is the storage's secondary key. +* `retention_in_days` - (Optional) Specifies the number of days to retain logs for in the storage account. ## Attributes Reference From de97065100962f2afd2dec8f218a43775bff5936 Mon Sep 17 00:00:00 2001 From: kt Date: Sat, 25 Apr 2020 19:06:29 -0700 Subject: [PATCH 034/223] update CHANGELOG.md to include #6402 --- CHANGELOG.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b245482ea624..b91aebba83900 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,13 @@ IMPROVEMENTS: -* `azurerm_api_management` - `sku_name` supports Consumption [GH-6602] +* `azurerm_api_management` - `sku_name` supports the `Consumption` value for `sku` [GH-6602] * `azurerm_api_management_api` - support for openapi v3 content formats [GH-6618] +* `azurerm_mssql_database` - support for the `extended_auditing_policy` block [GH-6402] + +BUG FIXES: + +* `azurerm_sql_database` - prevent extended auditing policy for secondary databases [GH-6402] ## 2.7.0 (April 23, 2020) From 1b5a0b36d5c3a756e2efe45a3eff2bda67135997 Mon Sep 17 00:00:00 2001 From: Sune Keller Date: Sun, 26 Apr 2020 04:59:54 +0200 Subject: [PATCH 035/223] azurerm_web_application_firewall_policy - support managed_rules (#6126) --- .../web_application_firewall_policy.go | 40 +++ .../resource_arm_application_gateway.go | 61 ++-- ...rce_arm_web_application_firewall_policy.go | 275 +++++++++++++++++- ...rm_web_application_firewall_policy_test.go | 82 ++++++ ..._application_firewall_policy.html.markdown | 95 +++++- 5 files changed, 495 insertions(+), 58 deletions(-) create mode 100644 azurerm/helpers/validate/web_application_firewall_policy.go diff --git a/azurerm/helpers/validate/web_application_firewall_policy.go b/azurerm/helpers/validate/web_application_firewall_policy.go new file mode 100644 index 0000000000000..da86db47f9523 --- /dev/null +++ b/azurerm/helpers/validate/web_application_firewall_policy.go @@ -0,0 +1,40 @@ +package validate + +import "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + +var ValidateWebApplicationFirewallPolicyRuleGroupName = validation.StringInSlice([]string{ + "crs_20_protocol_violations", + "crs_21_protocol_anomalies", + "crs_23_request_limits", + "crs_30_http_policy", + "crs_35_bad_robots", + "crs_40_generic_attacks", + "crs_41_sql_injection_attacks", + "crs_41_xss_attacks", + "crs_42_tight_security", + "crs_45_trojans", + "General", + "REQUEST-911-METHOD-ENFORCEMENT", + "REQUEST-913-SCANNER-DETECTION", + "REQUEST-920-PROTOCOL-ENFORCEMENT", + "REQUEST-921-PROTOCOL-ATTACK", + "REQUEST-930-APPLICATION-ATTACK-LFI", + "REQUEST-931-APPLICATION-ATTACK-RFI", + "REQUEST-932-APPLICATION-ATTACK-RCE", + "REQUEST-933-APPLICATION-ATTACK-PHP", + "REQUEST-941-APPLICATION-ATTACK-XSS", + "REQUEST-942-APPLICATION-ATTACK-SQLI", + "REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION", +}, false) + +var ValidateWebApplicationFirewallPolicyRuleSetVersion = validation.StringInSlice([]string{ + "1.0", + "2.2.9", + "3.0", + "3.1", +}, false) + +var ValidateWebApplicationFirewallPolicyRuleSetType = validation.StringInSlice([]string{ + "OWASP", + "Microsoft_BotManagerRuleSet", +}, false) diff --git a/azurerm/internal/services/network/resource_arm_application_gateway.go b/azurerm/internal/services/network/resource_arm_application_gateway.go index 8fcdd30c995bf..9e22c7bd6ba4c 100644 --- a/azurerm/internal/services/network/resource_arm_application_gateway.go +++ b/azurerm/internal/services/network/resource_arm_application_gateway.go @@ -1170,19 +1170,16 @@ func resourceArmApplicationGateway() *schema.Resource { }, "rule_set_type": { - Type: schema.TypeString, - Optional: true, - Default: "OWASP", + Type: schema.TypeString, + Optional: true, + Default: "OWASP", + ValidateFunc: validate.ValidateWebApplicationFirewallPolicyRuleSetType, }, "rule_set_version": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - "2.2.9", - "3.0", - "3.1", - }, false), + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.ValidateWebApplicationFirewallPolicyRuleSetVersion, }, "file_upload_limit_mb": { Type: schema.TypeInt, @@ -1207,32 +1204,9 @@ func resourceArmApplicationGateway() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "rule_group_name": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - "crs_20_protocol_violations", - "crs_21_protocol_anomalies", - "crs_23_request_limits", - "crs_30_http_policy", - "crs_35_bad_robots", - "crs_40_generic_attacks", - "crs_41_sql_injection_attacks", - "crs_41_xss_attacks", - "crs_42_tight_security", - "crs_45_trojans", - "General", - "REQUEST-911-METHOD-ENFORCEMENT", - "REQUEST-913-SCANNER-DETECTION", - "REQUEST-920-PROTOCOL-ENFORCEMENT", - "REQUEST-921-PROTOCOL-ATTACK", - "REQUEST-930-APPLICATION-ATTACK-LFI", - "REQUEST-931-APPLICATION-ATTACK-RFI", - "REQUEST-932-APPLICATION-ATTACK-RCE", - "REQUEST-933-APPLICATION-ATTACK-PHP", - "REQUEST-941-APPLICATION-ATTACK-XSS", - "REQUEST-942-APPLICATION-ATTACK-SQLI", - "REQUEST-943-APPLICATION-ATTACK-SESSION-FIXATION", - }, false), + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.ValidateWebApplicationFirewallPolicyRuleGroupName, }, "rules": { @@ -1255,19 +1229,20 @@ func resourceArmApplicationGateway() *schema.Resource { Type: schema.TypeString, Required: true, ValidateFunc: validation.StringInSlice([]string{ - "RequestHeaderNames", - "RequestArgNames", - "RequestCookieNames", + string(network.RequestArgNames), + string(network.RequestCookieNames), + string(network.RequestHeaderNames), }, false), }, "selector_match_operator": { Type: schema.TypeString, ValidateFunc: validation.StringInSlice([]string{ - "Equals", - "StartsWith", - "EndsWith", - "Contains", + string(network.OwaspCrsExclusionEntrySelectorMatchOperatorContains), + string(network.OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), + string(network.OwaspCrsExclusionEntrySelectorMatchOperatorEquals), + string(network.OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny), + string(network.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), }, false), Optional: true, }, diff --git a/azurerm/internal/services/network/resource_arm_web_application_firewall_policy.go b/azurerm/internal/services/network/resource_arm_web_application_firewall_policy.go index 0e11f794324de..a3955c94e88fb 100644 --- a/azurerm/internal/services/network/resource_arm_web_application_firewall_policy.go +++ b/azurerm/internal/services/network/resource_arm_web_application_firewall_policy.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" @@ -143,6 +144,88 @@ func resourceArmWebApplicationFirewallPolicy() *schema.Resource { }, }, + "managed_rules": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "exclusion": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "match_variable": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + string(network.RequestArgNames), + string(network.RequestCookieNames), + string(network.RequestHeaderNames), + }, false), + }, + "selector": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "selector_match_operator": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + string(network.OwaspCrsExclusionEntrySelectorMatchOperatorContains), + string(network.OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), + string(network.OwaspCrsExclusionEntrySelectorMatchOperatorEquals), + string(network.OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny), + string(network.OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), + }, false), + }, + }, + }, + }, + "managed_rule_set": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Optional: true, + Default: "OWASP", + ValidateFunc: validate.ValidateWebApplicationFirewallPolicyRuleSetType, + }, + "version": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.ValidateWebApplicationFirewallPolicyRuleSetVersion, + }, + "rule_group_override": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "rule_group_name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.ValidateWebApplicationFirewallPolicyRuleGroupName, + }, + "disabled_rules": { + Type: schema.TypeList, + Required: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "policy_settings": { Type: schema.TypeList, Optional: true, @@ -195,6 +278,7 @@ func resourceArmWebApplicationFirewallPolicyCreateUpdate(d *schema.ResourceData, location := azure.NormalizeLocation(d.Get("location").(string)) customRules := d.Get("custom_rules").([]interface{}) policySettings := d.Get("policy_settings").([]interface{}) + managedRules := d.Get("managed_rules").([]interface{}) t := d.Get("tags").(map[string]interface{}) parameters := network.WebApplicationFirewallPolicy{ @@ -202,6 +286,7 @@ func resourceArmWebApplicationFirewallPolicyCreateUpdate(d *schema.ResourceData, WebApplicationFirewallPolicyPropertiesFormat: &network.WebApplicationFirewallPolicyPropertiesFormat{ CustomRules: expandArmWebApplicationFirewallPolicyWebApplicationFirewallCustomRule(customRules), PolicySettings: expandArmWebApplicationFirewallPolicyPolicySettings(policySettings), + ManagedRules: expandArmWebApplicationFirewallPolicyManagedRulesDefinition(managedRules), }, Tags: tags.Expand(t), } @@ -256,6 +341,12 @@ func resourceArmWebApplicationFirewallPolicyRead(d *schema.ResourceData, meta in if err := d.Set("policy_settings", flattenArmWebApplicationFirewallPolicyPolicySettings(webApplicationFirewallPolicyPropertiesFormat.PolicySettings)); err != nil { return fmt.Errorf("Error setting `policy_settings`: %+v", err) } + if err := d.Set("managed_rules", flattenArmWebApplicationFirewallPolicyManagedRulesDefinition(webApplicationFirewallPolicyPropertiesFormat.ManagedRules)); err != nil { + return fmt.Errorf("Error setting `managed_rules`: %+v", err) + } + if err := d.Set("managed_rules", flattenArmWebApplicationFirewallPolicyManagedRulesDefinition(webApplicationFirewallPolicyPropertiesFormat.ManagedRules)); err != nil { + return fmt.Errorf("Error setting `managed_rules`: %+v", err) + } } return tags.FlattenAndSet(d, resp.Tags) @@ -320,7 +411,7 @@ func expandArmWebApplicationFirewallPolicyPolicySettings(input []interface{}) *n v := input[0].(map[string]interface{}) enabled := network.WebApplicationFirewallEnabledStateDisabled - if v["enabled"].(bool) { + if value, ok := v["enabled"].(bool); ok && value { enabled = network.WebApplicationFirewallEnabledStateEnabled } mode := v["mode"].(string) @@ -332,6 +423,96 @@ func expandArmWebApplicationFirewallPolicyPolicySettings(input []interface{}) *n return &result } +func expandArmWebApplicationFirewallPolicyManagedRulesDefinition(input []interface{}) *network.ManagedRulesDefinition { + if len(input) == 0 { + return nil + } + v := input[0].(map[string]interface{}) + + exclusions := v["exclusion"].([]interface{}) + managedRuleSets := v["managed_rule_set"].([]interface{}) + + return &network.ManagedRulesDefinition{ + Exclusions: expandArmWebApplicationFirewallPolicyExclusions(exclusions), + ManagedRuleSets: expandArmWebApplicationFirewallPolicyManagedRuleSet(managedRuleSets), + } +} + +func expandArmWebApplicationFirewallPolicyExclusions(input []interface{}) *[]network.OwaspCrsExclusionEntry { + results := make([]network.OwaspCrsExclusionEntry, 0) + for _, item := range input { + v := item.(map[string]interface{}) + + matchVariable := v["match_variable"].(string) + selectorMatchOperator := v["selector_match_operator"].(string) + selector := v["selector"].(string) + + result := network.OwaspCrsExclusionEntry{ + MatchVariable: network.OwaspCrsExclusionEntryMatchVariable(matchVariable), + SelectorMatchOperator: network.OwaspCrsExclusionEntrySelectorMatchOperator(selectorMatchOperator), + Selector: utils.String(selector), + } + + results = append(results, result) + } + return &results +} + +func expandArmWebApplicationFirewallPolicyManagedRuleSet(input []interface{}) *[]network.ManagedRuleSet { + results := make([]network.ManagedRuleSet, 0) + for _, item := range input { + v := item.(map[string]interface{}) + + ruleSetType := v["type"].(string) + ruleSetVersion := v["version"].(string) + ruleGroupOverrides := []interface{}{} + if value, exists := v["rule_group_override"]; exists { + ruleGroupOverrides = value.([]interface{}) + } + result := network.ManagedRuleSet{ + RuleSetType: utils.String(ruleSetType), + RuleSetVersion: utils.String(ruleSetVersion), + RuleGroupOverrides: expandArmWebApplicationFirewallPolicyRuleGroupOverrides(ruleGroupOverrides), + } + + results = append(results, result) + } + return &results +} + +func expandArmWebApplicationFirewallPolicyRuleGroupOverrides(input []interface{}) *[]network.ManagedRuleGroupOverride { + results := make([]network.ManagedRuleGroupOverride, 0) + for _, item := range input { + v := item.(map[string]interface{}) + + ruleGroupName := v["rule_group_name"].(string) + disabledRules := v["disabled_rules"].([]interface{}) + + result := network.ManagedRuleGroupOverride{ + RuleGroupName: utils.String(ruleGroupName), + Rules: expandArmWebApplicationFirewallPolicyRules(disabledRules), + } + + results = append(results, result) + } + return &results +} + +func expandArmWebApplicationFirewallPolicyRules(input []interface{}) *[]network.ManagedRuleOverride { + results := make([]network.ManagedRuleOverride, 0) + for _, item := range input { + ruleID := item.(string) + + result := network.ManagedRuleOverride{ + RuleID: utils.String(ruleID), + State: network.ManagedRuleEnabledStateDisabled, + } + + results = append(results, result) + } + return &results +} + func expandArmWebApplicationFirewallPolicyMatchCondition(input []interface{}) *[]network.MatchCondition { results := make([]network.MatchCondition, 0) for _, item := range input { @@ -402,12 +583,102 @@ func flattenArmWebApplicationFirewallPolicyPolicySettings(input *network.PolicyS result := make(map[string]interface{}) - result["enabled"] = input.State == network.WebApplicationFirewallEnabledStateDisabled + result["enabled"] = input.State == network.WebApplicationFirewallEnabledStateEnabled result["mode"] = string(input.Mode) return []interface{}{result} } +func flattenArmWebApplicationFirewallPolicyManagedRulesDefinition(input *network.ManagedRulesDefinition) []interface{} { + results := make([]interface{}, 0) + if input == nil { + return results + } + + v := make(map[string]interface{}) + + v["exclusion"] = flattenArmWebApplicationFirewallPolicyExclusions(input.Exclusions) + v["managed_rule_set"] = flattenArmWebApplicationFirewallPolicyManagedRuleSets(input.ManagedRuleSets) + + results = append(results, v) + + return results +} + +func flattenArmWebApplicationFirewallPolicyExclusions(input *[]network.OwaspCrsExclusionEntry) []interface{} { + results := make([]interface{}, 0) + if input == nil { + return results + } + + for _, item := range *input { + v := make(map[string]interface{}) + + selector := item.Selector + + v["match_variable"] = string(item.MatchVariable) + if selector != nil { + v["selector"] = *selector + } + v["selector_match_operator"] = string(item.SelectorMatchOperator) + + results = append(results, v) + } + return results +} + +func flattenArmWebApplicationFirewallPolicyManagedRuleSets(input *[]network.ManagedRuleSet) []interface{} { + results := make([]interface{}, 0) + if input == nil { + return results + } + + for _, item := range *input { + v := make(map[string]interface{}) + + v["type"] = item.RuleSetType + v["version"] = item.RuleSetVersion + v["rule_group_override"] = flattenArmWebApplicationFirewallPolicyRuleGroupOverrides(item.RuleGroupOverrides) + + results = append(results, v) + } + return results +} + +func flattenArmWebApplicationFirewallPolicyRuleGroupOverrides(input *[]network.ManagedRuleGroupOverride) []interface{} { + results := make([]interface{}, 0) + if input == nil { + return results + } + + for _, item := range *input { + v := make(map[string]interface{}) + + v["rule_group_name"] = item.RuleGroupName + v["disabled_rules"] = flattenArmWebApplicationFirewallPolicyManagedRuleOverrides(item.Rules) + + results = append(results, v) + } + return results +} + +func flattenArmWebApplicationFirewallPolicyManagedRuleOverrides(input *[]network.ManagedRuleOverride) []string { + results := make([]string, 0) + if input == nil { + return results + } + + for _, item := range *input { + if item.State == "" || item.State == network.ManagedRuleEnabledStateDisabled { + v := *item.RuleID + + results = append(results, v) + } + } + + return results +} + func flattenArmWebApplicationFirewallPolicyMatchCondition(input *[]network.MatchCondition) []interface{} { results := make([]interface{}, 0) if input == nil { diff --git a/azurerm/internal/services/network/tests/resource_arm_web_application_firewall_policy_test.go b/azurerm/internal/services/network/tests/resource_arm_web_application_firewall_policy_test.go index 576c91e87635d..8df8d533dd920 100644 --- a/azurerm/internal/services/network/tests/resource_arm_web_application_firewall_policy_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_web_application_firewall_policy_test.go @@ -73,6 +73,25 @@ func TestAccAzureRMWebApplicationFirewallPolicy_complete(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "custom_rules.1.match_conditions.1.match_values.#", "1"), resource.TestCheckResourceAttr(data.ResourceName, "custom_rules.1.match_conditions.1.match_values.0", "Windows"), resource.TestCheckResourceAttr(data.ResourceName, "custom_rules.1.action", "Block"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.#", "2"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.0.match_variable", "RequestHeaderNames"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.0.selector", "x-shared-secret"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.0.selector_match_operator", "Equals"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.1.match_variable", "RequestCookieNames"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.1.selector", "too-much-fun"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.1.selector_match_operator", "EndsWith"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.type", "OWASP"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.version", "3.1"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.rule_group_override.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.rule_group_override.0.rule_group_name", "REQUEST-920-PROTOCOL-ENFORCEMENT"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.rule_group_override.0.disabled_rules.#", "2"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.rule_group_override.0.disabled_rules.0", "920300"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.rule_group_override.0.disabled_rules.1", "920440"), + resource.TestCheckResourceAttr(data.ResourceName, "policy_settings.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "policy_settings.0.enabled", "true"), + resource.TestCheckResourceAttr(data.ResourceName, "policy_settings.0.mode", "Prevention"), ), }, data.ImportStep(), @@ -129,6 +148,25 @@ func TestAccAzureRMWebApplicationFirewallPolicy_update(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "custom_rules.1.match_conditions.1.match_values.#", "1"), resource.TestCheckResourceAttr(data.ResourceName, "custom_rules.1.match_conditions.1.match_values.0", "Windows"), resource.TestCheckResourceAttr(data.ResourceName, "custom_rules.1.action", "Block"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.#", "2"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.0.match_variable", "RequestHeaderNames"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.0.selector", "x-shared-secret"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.0.selector_match_operator", "Equals"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.1.match_variable", "RequestCookieNames"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.1.selector", "too-much-fun"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.exclusion.1.selector_match_operator", "EndsWith"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.type", "OWASP"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.version", "3.1"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.rule_group_override.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.rule_group_override.0.rule_group_name", "REQUEST-920-PROTOCOL-ENFORCEMENT"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.rule_group_override.0.disabled_rules.#", "2"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.rule_group_override.0.disabled_rules.0", "920300"), + resource.TestCheckResourceAttr(data.ResourceName, "managed_rules.0.managed_rule_set.0.rule_group_override.0.disabled_rules.1", "920440"), + resource.TestCheckResourceAttr(data.ResourceName, "policy_settings.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "policy_settings.0.enabled", "true"), + resource.TestCheckResourceAttr(data.ResourceName, "policy_settings.0.mode", "Prevention"), ), }, data.ImportStep(), @@ -199,6 +237,18 @@ resource "azurerm_web_application_firewall_policy" "test" { name = "acctestwafpolicy-%d" resource_group_name = azurerm_resource_group.test.name location = azurerm_resource_group.test.location + + managed_rules { + managed_rule_set { + type = "OWASP" + version = "3.1" + } + } + + policy_settings { + enabled = true + mode = "Detection" + } } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } @@ -265,6 +315,38 @@ resource "azurerm_web_application_firewall_policy" "test" { action = "Block" } + + managed_rules { + exclusion { + match_variable = "RequestHeaderNames" + selector = "x-shared-secret" + selector_match_operator = "Equals" + } + + exclusion { + match_variable = "RequestCookieNames" + selector = "too-much-fun" + selector_match_operator = "EndsWith" + } + + managed_rule_set { + type = "OWASP" + version = "3.1" + + rule_group_override { + rule_group_name = "REQUEST-920-PROTOCOL-ENFORCEMENT" + disabled_rules = [ + "920300", + "920440", + ] + } + } + } + + policy_settings { + enabled = true + mode = "Prevention" + } } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } diff --git a/website/docs/r/web_application_firewall_policy.html.markdown b/website/docs/r/web_application_firewall_policy.html.markdown index 51a80dcabee06..b1ee28367c723 100644 --- a/website/docs/r/web_application_firewall_policy.html.markdown +++ b/website/docs/r/web_application_firewall_policy.html.markdown @@ -69,6 +69,37 @@ resource "azurerm_web_application_firewall_policy" "example" { action = "Block" } + + policy_settings { + enabled = true + mode = "Prevention" + } + + managed_rules { + exclusion { + match_variable = "RequestHeaderNames" + selector = "x-company-secret-header" + selector_match_operator = "Equals" + } + exclusion { + match_variable = "RequestCookieNames" + selector = "too-tasty" + selector_match_operator = "EndsWith" + } + + managed_rule_set { + rule_set_type = "OWASP" + rule_set_version = "3.1" + rule_group_override { + rule_group_name = "REQUEST-920-PROTOCOL-ENFORCEMENT" + disabled_rules = [ + "920300", + "920440" + ] + } + } + } + } ``` @@ -82,41 +113,43 @@ The following arguments are supported: * `location` - (Optional) Resource location. Changing this forces a new resource to be created. -* `custom_rules` - (Optional) One or more `custom_rule` blocks as defined below. +* `custom_rules` - (Optional) One or more `custom_rules` blocks as defined below. + +* `policy_settings` - (Optional) A `policy_settings` block as defined below. -* `policy_settings` - (Optional) A `policy_setting` block as defined below. +* `managed_rules` - (Optional) A `managed_rules` blocks as defined below. * `tags` - (Optional) A mapping of tags to assign to the Web Application Firewall Policy. --- -The `custom_rule` block supports the following: +The `custom_rules` block supports the following: * `name` - (Optional) Gets name of the resource that is unique within a policy. This name can be used to access the resource. -* `priority` - (Required) Describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value +* `priority` - (Required) Describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value. -* `rule_type` - (Required) Describes the type of rule +* `rule_type` - (Required) Describes the type of rule. -* `match_conditions` - (Required) One or more `match_condition` block defined below. +* `match_conditions` - (Required) One or more `match_conditions` blocks as defined below. -* `action` - (Required) Type of Actions +* `action` - (Required) Type of action. --- -The `match_condition` block supports the following: +The `match_conditions` block supports the following: -* `match_variables` - (Required) One or more `match_variable` block defined below. +* `match_variables` - (Required) One or more `match_variables` blocks as defined below. -* `operator` - (Required) Describes operator to be matched +* `operator` - (Required) Describes operator to be matched. * `negation_condition` - (Optional) Describes if this is negate condition or not -* `match_values` - (Required) Match value +* `match_values` - (Required) A list of match values. --- -The `match_variable` block supports the following: +The `match_variables` block supports the following: * `variable_name` - (Required) The name of the Match Variable @@ -124,12 +157,48 @@ The `match_variable` block supports the following: --- -The `policy_setting` block supports the following: +The `policy_settings` block supports the following: * `enabled` - (Optional) Describes if the policy is in enabled state or disabled state Defaults to `Enabled`. * `mode` - (Optional) Describes if it is in detection mode or prevention mode at the policy level Defaults to `Prevention`. +--- + +The `managed_rules` block supports the following: + +* `exclusion` - (Optional) One or more `exclusion` block defined below. + +* `managed_rule_set` - (Optional) One or more `managed_rule_set` block defined below. + +--- + +The `exclusion` block supports the following: + +* `match_variables` - (Required) The name of the Match Variable. Possible values: `RequestArgNames`, `RequestCookieNames`, `RequestHeaderNames`. + +* `selector` - (Optional) Describes field of the matchVariable collection. + +* `selector_match_operator` - (Required) Describes operator to be matched. Possible values: `Contains`, `EndsWith`, `Equals`, `EqualsAny`, `StartsWith`. + +--- + +The `managed_rule_set` block supports the following: + +* `type` - (Required) The rule set type. + +* `version` - (Required) The rule set version. + +* `rule_group_override` - (Optional) One or more `rule_group_override` block defined below. + +--- + +The `rule_group_override` block supports the following: + +* `rule_group_name` - (Required) The name of the Rule Group + +* `disabled_rules` - (Optional) One or more Rule ID's + ## Attributes Reference The following attributes are exported: From a665b43470e9a9fc072f84832ef8b233178e693f Mon Sep 17 00:00:00 2001 From: kt Date: Sat, 25 Apr 2020 20:01:42 -0700 Subject: [PATCH 036/223] update CHANGELOG.md to include #6126 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b91aebba83900..8396b0a2d2410 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ IMPROVEMENTS: BUG FIXES: * `azurerm_sql_database` - prevent extended auditing policy for secondary databases [GH-6402] +* `azurerm_web_application_firewall_policy` - support for the `managed_rules` property which is required by the new API version [GH-6126] ## 2.7.0 (April 23, 2020) From ffb2046313280305913fc8c6e7fb5db645a0a8b5 Mon Sep 17 00:00:00 2001 From: Neil Ye Date: Sun, 26 Apr 2020 11:23:21 +0800 Subject: [PATCH 037/223] azurerm_virtual_network_gateway_connection - shared_key is optional when type is IPSec (#6565) fixes #5402 --- ..._arm_virtual_network_gateway_connection.go | 10 +-- ...virtual_network_gateway_connection_test.go | 89 +++++++++++++++++++ ...l_network_gateway_connection.html.markdown | 5 +- 3 files changed, 94 insertions(+), 10 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_virtual_network_gateway_connection.go b/azurerm/internal/services/network/resource_arm_virtual_network_gateway_connection.go index 08302929a5fae..6f32eba082f3c 100644 --- a/azurerm/internal/services/network/resource_arm_virtual_network_gateway_connection.go +++ b/azurerm/internal/services/network/resource_arm_virtual_network_gateway_connection.go @@ -510,23 +510,19 @@ func getArmVirtualNetworkGatewayConnectionProperties(d *schema.ResourceData) (*n if props.ConnectionType == network.ExpressRoute { if props.Peer == nil || props.Peer.ID == nil { - return nil, fmt.Errorf("`express_route_circuit_id` must be specified when `type` is set to `ExpressRoute") + return nil, fmt.Errorf("`express_route_circuit_id` must be specified when `type` is set to `ExpressRoute`") } } if props.ConnectionType == network.IPsec { if props.LocalNetworkGateway2 == nil || props.LocalNetworkGateway2.ID == nil { - return nil, fmt.Errorf("`local_network_gateway_id` and `shared_key` must be specified when `type` is set to `IPsec") - } - - if props.SharedKey == nil { - return nil, fmt.Errorf("`local_network_gateway_id` and `shared_key` must be specified when `type` is set to `IPsec") + return nil, fmt.Errorf("`local_network_gateway_id` must be specified when `type` is set to `IPsec`") } } if props.ConnectionType == network.Vnet2Vnet { if props.VirtualNetworkGateway2 == nil || props.VirtualNetworkGateway2.ID == nil { - return nil, fmt.Errorf("`peer_virtual_network_gateway_id` and `shared_key` must be specified when `type` is set to `Vnet2Vnet") + return nil, fmt.Errorf("`peer_virtual_network_gateway_id` must be specified when `type` is set to `Vnet2Vnet`") } } diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_connection_test.go b/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_connection_test.go index 211bc939164a7..4f7d42158cf9f 100644 --- a/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_connection_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_connection_test.go @@ -52,6 +52,25 @@ func TestAccAzureRMVirtualNetworkGatewayConnection_requiresImport(t *testing.T) }) } +func TestAccAzureRMVirtualNetworkGatewayConnection_sitetositeWithoutSharedKey(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_virtual_network_gateway_connection", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMVirtualNetworkGatewayConnectionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMVirtualNetworkGatewayConnection_sitetositeWithoutSharedKey(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMVirtualNetworkGatewayConnectionExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + func TestAccAzureRMVirtualNetworkGatewayConnection_vnettonet(t *testing.T) { data1 := acceptance.BuildTestData(t, "azurerm_virtual_network_gateway_connection", "test_1") data2 := acceptance.BuildTestData(t, "azurerm_virtual_network_gateway_connection", "test_2") @@ -272,6 +291,76 @@ resource "azurerm_virtual_network_gateway_connection" "test" { `, data.RandomInteger, data.Locations.Primary) } +func testAccAzureRMVirtualNetworkGatewayConnection_sitetositeWithoutSharedKey(data acceptance.TestData) string { + return fmt.Sprintf(` +variable "random" { + default = "%d" +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-${var.random}" + location = "%s" +} + +resource "azurerm_virtual_network" "test" { + name = "acctestvn-${var.random}" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + address_space = ["10.0.0.0/16"] +} + +resource "azurerm_subnet" "test" { + name = "GatewaySubnet" + resource_group_name = azurerm_resource_group.test.name + virtual_network_name = azurerm_virtual_network.test.name + address_prefix = "10.0.1.0/24" +} + +resource "azurerm_public_ip" "test" { + name = "acctest-${var.random}" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + allocation_method = "Dynamic" +} + +resource "azurerm_virtual_network_gateway" "test" { + name = "acctest-${var.random}" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + type = "Vpn" + vpn_type = "RouteBased" + sku = "Basic" + + ip_configuration { + name = "vnetGatewayConfig" + public_ip_address_id = azurerm_public_ip.test.id + private_ip_address_allocation = "Dynamic" + subnet_id = azurerm_subnet.test.id + } +} + +resource "azurerm_local_network_gateway" "test" { + name = "acctest-${var.random}" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + gateway_address = "168.62.225.23" + address_space = ["10.1.1.0/24"] +} + +resource "azurerm_virtual_network_gateway_connection" "test" { + name = "acctest-${var.random}" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + type = "IPsec" + virtual_network_gateway_id = azurerm_virtual_network_gateway.test.id + local_network_gateway_id = azurerm_local_network_gateway.test.id +} +`, data.RandomInteger, data.Locations.Primary) +} + func testAccAzureRMVirtualNetworkGatewayConnection_requiresImport(data acceptance.TestData) string { template := testAccAzureRMVirtualNetworkGatewayConnection_sitetosite(data) return fmt.Sprintf(` diff --git a/website/docs/r/virtual_network_gateway_connection.html.markdown b/website/docs/r/virtual_network_gateway_connection.html.markdown index 378f1e0c5931d..e899c13ec5096 100644 --- a/website/docs/r/virtual_network_gateway_connection.html.markdown +++ b/website/docs/r/virtual_network_gateway_connection.html.markdown @@ -240,9 +240,8 @@ The following arguments are supported: * `routing_weight` - (Optional) The routing weight. Defaults to `10`. -* `shared_key` - (Optional) The shared IPSec key. A key must be provided if a - Site-to-Site or VNet-to-VNet connection is created whereas ExpressRoute - connections do not need a shared key. +* `shared_key` - (Optional) The shared IPSec key. A key could be provided if a + Site-to-Site, VNet-to-VNet or ExpressRoute connection is created. * `connection_protocol` - (Optional) The IKE protocol version to use. Possible values are `IKEv1` and `IKEv2`. Defaults to `IKEv2`. From 4002487239c3a38f7cd8aaf8b70bafa159079be8 Mon Sep 17 00:00:00 2001 From: kt Date: Sat, 25 Apr 2020 20:24:18 -0700 Subject: [PATCH 038/223] update CHANGELOG.md to include #6565 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8396b0a2d2410..8b3d69caf7a44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ BUG FIXES: * `azurerm_sql_database` - prevent extended auditing policy for secondary databases [GH-6402] * `azurerm_web_application_firewall_policy` - support for the `managed_rules` property which is required by the new API version [GH-6126] +* `azurerm_virtual_network_gateway_connection` - `shared_key` is now optional when `type` is `IPSec` [GH-6565] ## 2.7.0 (April 23, 2020) From d6d86bf1bb628a7794d4b04a0be4b721200e5552 Mon Sep 17 00:00:00 2001 From: Christian Pearce Date: Sat, 25 Apr 2020 23:27:32 -0400 Subject: [PATCH 039/223] azurerm_express_route_circuit_peering - support customer_asn & routing_registry_name #1084 (#6596) Fixing issue #1084 Microsoft Peering is missing customer_asn and routing_registry_name Test included Website updated (fixes #1084) --- ...ource_arm_express_route_circuit_peering.go | 22 +++++- ..._arm_express_route_circuit_peering_test.go | 72 +++++++++++++++++++ ...resource_arm_express_route_circuit_test.go | 3 +- ...xpress_route_circuit_peering.html.markdown | 2 + 4 files changed, 97 insertions(+), 2 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_express_route_circuit_peering.go b/azurerm/internal/services/network/resource_arm_express_route_circuit_peering.go index e86f5aaca26c1..6ab822eb44591 100644 --- a/azurerm/internal/services/network/resource_arm_express_route_circuit_peering.go +++ b/azurerm/internal/services/network/resource_arm_express_route_circuit_peering.go @@ -95,6 +95,16 @@ func resourceArmExpressRouteCircuitPeering() *schema.Resource { Required: true, Elem: &schema.Schema{Type: schema.TypeString}, }, + "customer_asn": { + Type: schema.TypeInt, + Optional: true, + Default: 0, + }, + "routing_registry_name": { + Type: schema.TypeString, + Optional: true, + Default: "NONE", + }, }, }, }, @@ -276,12 +286,17 @@ func expandExpressRouteCircuitPeeringMicrosoftConfig(input []interface{}) *netwo prefixes := make([]string, 0) inputPrefixes := peering["advertised_public_prefixes"].([]interface{}) + inputCustomerASN := int32(peering["customer_asn"].(int)) + inputRoutingRegistryName := peering["routing_registry_name"].(string) + for _, v := range inputPrefixes { prefixes = append(prefixes, v.(string)) } return &network.ExpressRouteCircuitPeeringConfig{ AdvertisedPublicPrefixes: &prefixes, + CustomerASN: &inputCustomerASN, + RoutingRegistryName: &inputRoutingRegistryName, } } @@ -292,10 +307,15 @@ func flattenExpressRouteCircuitPeeringMicrosoftConfig(input *network.ExpressRout config := make(map[string]interface{}) prefixes := make([]string, 0) + if customerASN := input.CustomerASN; customerASN != nil { + config["customer_asn"] = *customerASN + } + if routingRegistryName := input.RoutingRegistryName; routingRegistryName != nil { + config["routing_registry_name"] = *routingRegistryName + } if ps := input.AdvertisedPublicPrefixes; ps != nil { prefixes = *ps } - config["advertised_public_prefixes"] = prefixes return []interface{}{config} diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go index e307889e05f42..dd669c6fb91d8 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go @@ -73,6 +73,29 @@ func testAccAzureRMExpressRouteCircuitPeering_microsoftPeering(t *testing.T) { }) } +func testAccAzureRMExpressRouteCircuitPeering_microsoftPeeringCustomerRouting(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_express_route_circuit_peering", "test") + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMExpressRouteCircuitPeeringDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMExpressRouteCircuitPeering_msPeeringCustomerRouting(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMExpressRouteCircuitPeeringExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "peering_type", "MicrosoftPeering"), + resource.TestCheckResourceAttr(data.ResourceName, "microsoft_peering_config.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "microsoft_peering_config.0.customer_asn", "64511"), + resource.TestCheckResourceAttr(data.ResourceName, "microsoft_peering_config.0.routing_registry_name", "ARIN"), + ), + }, + data.ImportStep(), + }, + }) +} + func testAccAzureRMExpressRouteCircuitPeering_azurePrivatePeeringWithCircuitUpdate(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_express_route_circuit_peering", "test") @@ -266,6 +289,55 @@ resource "azurerm_express_route_circuit_peering" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } +func testAccAzureRMExpressRouteCircuitPeering_msPeeringCustomerRouting(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_express_route_circuit" "test" { + name = "acctest-erc-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + service_provider_name = "Equinix" + peering_location = "Silicon Valley" + bandwidth_in_mbps = 50 + + sku { + tier = "Premium" + family = "MeteredData" + } + + tags = { + Environment = "production" + Purpose = "AcceptanceTests" + } +} + +resource "azurerm_express_route_circuit_peering" "test" { + peering_type = "MicrosoftPeering" + express_route_circuit_name = azurerm_express_route_circuit.test.name + resource_group_name = azurerm_resource_group.test.name + peer_asn = 100 + primary_peer_address_prefix = "192.168.1.0/30" + secondary_peer_address_prefix = "192.168.2.0/30" + vlan_id = 300 + + microsoft_peering_config { + advertised_public_prefixes = ["123.1.0.0/24"] + // https://tools.ietf.org/html/rfc5398 + customer_asn = 64511 + routing_registry_name = "ARIN" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} + func testAccAzureRMExpressRouteCircuitPeering_privatePeeringWithCircuitUpdate(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go index 33d9c707fa271..ddf27cae41a7d 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go @@ -34,7 +34,8 @@ func TestAccAzureRMExpressRouteCircuit(t *testing.T) { "requiresImport": testAccAzureRMExpressRouteCircuitPeering_requiresImport, }, "MicrosoftPeering": { - "microsoftPeering": testAccAzureRMExpressRouteCircuitPeering_microsoftPeering, + "microsoftPeering": testAccAzureRMExpressRouteCircuitPeering_microsoftPeering, + "microsoftPeeringCustomerRouting": testAccAzureRMExpressRouteCircuitPeering_microsoftPeeringCustomerRouting, }, "authorization": { "basic": testAccAzureRMExpressRouteCircuitAuthorization_basic, diff --git a/website/docs/r/express_route_circuit_peering.html.markdown b/website/docs/r/express_route_circuit_peering.html.markdown index e701810251fa3..3d003c654f864 100644 --- a/website/docs/r/express_route_circuit_peering.html.markdown +++ b/website/docs/r/express_route_circuit_peering.html.markdown @@ -78,6 +78,8 @@ The following arguments are supported: A `microsoft_peering_config` block contains: * `advertised_public_prefixes` - (Required) A list of Advertised Public Prefixes +* `customer_asn` - (Optional) The CustomerASN of the peering +* `routing_registry_name` - (Optional) The RoutingRegistryName of the configuration ## Attributes Reference From 8ecb0ed679dd32c4bf27e8ae4cc575c5601dc7e2 Mon Sep 17 00:00:00 2001 From: kt Date: Sat, 25 Apr 2020 20:28:29 -0700 Subject: [PATCH 040/223] update CHANGELOG.md to include #6596 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b3d69caf7a44..734b168f3cf41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ IMPROVEMENTS: * `azurerm_api_management` - `sku_name` supports the `Consumption` value for `sku` [GH-6602] * `azurerm_api_management_api` - support for openapi v3 content formats [GH-6618] +* `azurerm_express_route_circuit_peering` - support for the `customer_asn` and `routing_registry_name` propeties [GH-6596] * `azurerm_mssql_database` - support for the `extended_auditing_policy` block [GH-6402] BUG FIXES: From 6356c26a9a756306cf90ea55e571a6e89b094127 Mon Sep 17 00:00:00 2001 From: njucz Date: Sun, 26 Apr 2020 15:43:41 +0800 Subject: [PATCH 041/223] update import resource id for `azurerm_network_interface_security_group_association` (#6625) --- ...ork_interface_network_security_group_association_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azurerm/internal/services/network/network_interface_network_security_group_association_resource.go b/azurerm/internal/services/network/network_interface_network_security_group_association_resource.go index b71f335adb043..9ce70203db070 100644 --- a/azurerm/internal/services/network/network_interface_network_security_group_association_resource.go +++ b/azurerm/internal/services/network/network_interface_network_security_group_association_resource.go @@ -100,7 +100,7 @@ func resourceArmNetworkInterfaceSecurityGroupAssociationCreate(d *schema.Resourc resourceId := fmt.Sprintf("%s|%s", networkInterfaceId, networkSecurityGroupId) if features.ShouldResourcesBeImported() { if props.NetworkSecurityGroup != nil { - return tf.ImportAsExistsError("azurerm_network_interface_security_group_association", resourceGroup) + return tf.ImportAsExistsError("azurerm_network_interface_security_group_association", resourceId) } } From 691f8884b68e364bd8785487ef92b0b725f67cd9 Mon Sep 17 00:00:00 2001 From: Nicolas Yuen Date: Sun, 26 Apr 2020 15:44:06 +0800 Subject: [PATCH 042/223] azurerm_monitor_diagnostic_setting - mark retention_policy & retention_policy as optional (#6603) --- ...resource_arm_monitor_diagnostic_setting.go | 49 ++++++++------ ...rce_arm_monitor_diagnostic_setting_test.go | 67 +++++++++++++++++-- .../monitor_diagnostic_setting.html.markdown | 4 +- 3 files changed, 92 insertions(+), 28 deletions(-) diff --git a/azurerm/internal/services/monitor/resource_arm_monitor_diagnostic_setting.go b/azurerm/internal/services/monitor/resource_arm_monitor_diagnostic_setting.go index f8681aa328c1f..d075b3bab471a 100644 --- a/azurerm/internal/services/monitor/resource_arm_monitor_diagnostic_setting.go +++ b/azurerm/internal/services/monitor/resource_arm_monitor_diagnostic_setting.go @@ -107,7 +107,7 @@ func resourceArmMonitorDiagnosticSetting() *schema.Resource { "retention_policy": { Type: schema.TypeList, - Required: true, + Optional: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -146,7 +146,7 @@ func resourceArmMonitorDiagnosticSetting() *schema.Resource { "retention_policy": { Type: schema.TypeList, - Required: true, + Optional: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -384,19 +384,22 @@ func expandMonitorDiagnosticsSettingsLogs(input []interface{}) []insights.LogSet category := v["category"].(string) enabled := v["enabled"].(bool) - policiesRaw := v["retention_policy"].([]interface{}) - policyRaw := policiesRaw[0].(map[string]interface{}) - retentionDays := policyRaw["days"].(int) - retentionEnabled := policyRaw["enabled"].(bool) - - output := insights.LogSettings{ - Category: utils.String(category), - Enabled: utils.Bool(enabled), - RetentionPolicy: &insights.RetentionPolicy{ + var retentionPolicy *insights.RetentionPolicy + if len(policiesRaw) != 0 { + policyRaw := policiesRaw[0].(map[string]interface{}) + retentionDays := policyRaw["days"].(int) + retentionEnabled := policyRaw["enabled"].(bool) + retentionPolicy = &insights.RetentionPolicy{ Days: utils.Int32(int32(retentionDays)), Enabled: utils.Bool(retentionEnabled), - }, + } + } + + output := insights.LogSettings{ + Category: utils.String(category), + Enabled: utils.Bool(enabled), + RetentionPolicy: retentionPolicy, } results = append(results, output) @@ -456,18 +459,20 @@ func expandMonitorDiagnosticsSettingsMetrics(input []interface{}) []insights.Met enabled := v["enabled"].(bool) policiesRaw := v["retention_policy"].([]interface{}) - policyRaw := policiesRaw[0].(map[string]interface{}) - - retentionDays := policyRaw["days"].(int) - retentionEnabled := policyRaw["enabled"].(bool) - - output := insights.MetricSettings{ - Category: utils.String(category), - Enabled: utils.Bool(enabled), - RetentionPolicy: &insights.RetentionPolicy{ + var retentionPolicy *insights.RetentionPolicy + if policiesRaw != nil { + policyRaw := policiesRaw[0].(map[string]interface{}) + retentionDays := policyRaw["days"].(int) + retentionEnabled := policyRaw["enabled"].(bool) + retentionPolicy = &insights.RetentionPolicy{ Days: utils.Int32(int32(retentionDays)), Enabled: utils.Bool(retentionEnabled), - }, + } + } + output := insights.MetricSettings{ + Category: utils.String(category), + Enabled: utils.Bool(enabled), + RetentionPolicy: retentionPolicy, } results = append(results, output) diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_diagnostic_setting_test.go b/azurerm/internal/services/monitor/tests/resource_arm_monitor_diagnostic_setting_test.go index cd3b5e9b8b493..e080649a984c9 100644 --- a/azurerm/internal/services/monitor/tests/resource_arm_monitor_diagnostic_setting_test.go +++ b/azurerm/internal/services/monitor/tests/resource_arm_monitor_diagnostic_setting_test.go @@ -14,7 +14,6 @@ import ( func TestAccAzureRMMonitorDiagnosticSetting_eventhub(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_monitor_diagnostic_setting", "test") - resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, Providers: acceptance.SupportedProviders, @@ -98,9 +97,6 @@ func TestAccAzureRMMonitorDiagnosticSetting_logAnalyticsWorkspaceDedicated(t *te resource.TestCheckResourceAttrSet(data.ResourceName, "log_analytics_workspace_id"), resource.TestCheckResourceAttr(data.ResourceName, "log_analytics_destination_type", "Dedicated"), resource.TestCheckResourceAttr(data.ResourceName, "log.#", "3"), - resource.TestCheckResourceAttr(data.ResourceName, "log.3188484811.category", "ActivityRuns"), - resource.TestCheckResourceAttr(data.ResourceName, "log.595859111.category", "PipelineRuns"), - resource.TestCheckResourceAttr(data.ResourceName, "log.2542277390.category", "TriggerRuns"), resource.TestCheckResourceAttr(data.ResourceName, "metric.#", "1"), resource.TestCheckResourceAttr(data.ResourceName, "metric.4109484471.category", "AllMetrics"), ), @@ -134,6 +130,28 @@ func TestAccAzureRMMonitorDiagnosticSetting_storageAccount(t *testing.T) { }) } +func TestAccAzureRMMonitorDiagnosticSetting_activityLog(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_monitor_diagnostic_setting", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMMonitorDiagnosticSettingDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMMonitorDiagnosticSetting_activityLog(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMMonitorDiagnosticSettingExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "storage_account_id"), + resource.TestCheckResourceAttr(data.ResourceName, "log.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "log.782743152.category", "Administrative"), + ), + }, + data.ImportStep(), + }, + }) +} + func testCheckAzureRMMonitorDiagnosticSettingExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { client := acceptance.AzureProvider.Meta().(*clients.Client).Monitor.DiagnosticSettingsClient @@ -473,3 +491,44 @@ resource "azurerm_monitor_diagnostic_setting" "test" { } `, data.RandomInteger, data.Locations.Primary, data.RandomIntOfLength(17)) } + +func testAccAzureRMMonitorDiagnosticSetting_activityLog(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +data "azurerm_client_config" "current" { +} + + +data "azurerm_subscription" "current" { +} + + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%[1]d" + location = "%[2]s" +} + +resource "azurerm_storage_account" "test" { + name = "acctest%[3]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + account_replication_type = "LRS" + account_tier = "Standard" +} + + +resource "azurerm_monitor_diagnostic_setting" "test" { + name = "acctest-DS-%[1]d" + target_resource_id = data.azurerm_subscription.current.id + storage_account_id = azurerm_storage_account.test.id + + log { + category = "Administrative" + enabled = true + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomIntOfLength(17)) +} diff --git a/website/docs/r/monitor_diagnostic_setting.html.markdown b/website/docs/r/monitor_diagnostic_setting.html.markdown index eb474ca5d3596..7c8a69994c206 100644 --- a/website/docs/r/monitor_diagnostic_setting.html.markdown +++ b/website/docs/r/monitor_diagnostic_setting.html.markdown @@ -99,7 +99,7 @@ A `log` block supports the following: -> **NOTE:** The Log Categories available vary depending on the Resource being used. You may wish to use [the `azurerm_monitor_diagnostic_categories` Data Source](../d/monitor_diagnostic_categories.html) to identify which categories are available for a given Resource. -* `retention_policy` - (Required) A `retention_policy` block as defined below. +* `retention_policy` - (Optional) A `retention_policy` block as defined below. * `enabled` - (Optional) Is this Diagnostic Log enabled? Defaults to `true`. @@ -111,7 +111,7 @@ A `metric` block supports the following: -> **NOTE:** The Metric Categories available vary depending on the Resource being used. You may wish to use [the `azurerm_monitor_diagnostic_categories` Data Source](../d/monitor_diagnostic_categories.html) to identify which categories are available for a given Resource. -* `retention_policy` - (Required) A `retention_policy` block as defined below. +* `retention_policy` - (Optional) A `retention_policy` block as defined below. * `enabled` - (Optional) Is this Diagnostic Metric enabled? Defaults to `true`. From 3257a1967c3b77f077823fca7556fb37811e469d Mon Sep 17 00:00:00 2001 From: kt Date: Sun, 26 Apr 2020 00:45:06 -0700 Subject: [PATCH 043/223] update CHANGELOG.md to include #6603 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 734b168f3cf41..6e6155a3cd107 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ BUG FIXES: * `azurerm_sql_database` - prevent extended auditing policy for secondary databases [GH-6402] * `azurerm_web_application_firewall_policy` - support for the `managed_rules` property which is required by the new API version [GH-6126] * `azurerm_virtual_network_gateway_connection` - `shared_key` is now optional when `type` is `IPSec` [GH-6565] +* `azurerm_monitor_diagnostic_setting` - make `retention_policy` and `retention_policy` optional [GH-6603] ## 2.7.0 (April 23, 2020) From cf9d8ae973f0f3e8121f86399acdd271bb6c1097 Mon Sep 17 00:00:00 2001 From: Christian Pearce Date: Mon, 27 Apr 2020 00:22:48 -0400 Subject: [PATCH 044/223] Adding acctest for #3996 (#6600) --- ...resource_arm_express_route_circuit_test.go | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go index ddf27cae41a7d..ee227c178bd4c 100644 --- a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go @@ -21,6 +21,7 @@ func TestAccAzureRMExpressRouteCircuit(t *testing.T) { "metered": testAccAzureRMExpressRouteCircuit_basicMetered, "unlimited": testAccAzureRMExpressRouteCircuit_basicUnlimited, "update": testAccAzureRMExpressRouteCircuit_update, + "updateTags": testAccAzureRMExpressRouteCircuit_updateTags, "tierUpdate": testAccAzureRMExpressRouteCircuit_tierUpdate, "premiumMetered": testAccAzureRMExpressRouteCircuit_premiumMetered, "premiumUnlimited": testAccAzureRMExpressRouteCircuit_premiumUnlimited, @@ -147,6 +148,33 @@ func testAccAzureRMExpressRouteCircuit_update(t *testing.T) { }) } +func testAccAzureRMExpressRouteCircuit_updateTags(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_express_route_circuit", "test") + var erc network.ExpressRouteCircuit + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMExpressRouteCircuitDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMExpressRouteCircuit_basicMeteredConfig(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMExpressRouteCircuitExists(data.ResourceName, &erc), + resource.TestCheckResourceAttr(data.ResourceName, "tags.Environment", "production"), + ), + }, + { + Config: testAccAzureRMExpressRouteCircuit_basicMeteredConfigUpdatedTags(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMExpressRouteCircuitExists(data.ResourceName, &erc), + resource.TestCheckResourceAttr(data.ResourceName, "tags.Environment", "test"), + ), + }, + }, + }) +} + func testAccAzureRMExpressRouteCircuit_tierUpdate(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_express_route_circuit", "test") var erc network.ExpressRouteCircuit @@ -336,6 +364,41 @@ resource "azurerm_express_route_circuit" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } +func testAccAzureRMExpressRouteCircuit_basicMeteredConfigUpdatedTags(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_express_route_circuit" "test" { + name = "acctest-erc-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + service_provider_name = "Equinix" + peering_location = "Silicon Valley" + bandwidth_in_mbps = 50 + + sku { + tier = "Standard" + family = "MeteredData" + } + + allow_classic_operations = false + + tags = { + Environment = "test" + Purpose = "UpdatedAcceptanceTests" + Caller = "Additional Value" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} + func testAccAzureRMExpressRouteCircuit_requiresImportConfig(data acceptance.TestData) string { template := testAccAzureRMExpressRouteCircuit_basicMeteredConfig(data) return fmt.Sprintf(` From e9e1fa90e908b0ddd66a63c6ebb6b53d5649ff6c Mon Sep 17 00:00:00 2001 From: Neil Ye Date: Mon, 27 Apr 2020 12:54:17 +0800 Subject: [PATCH 045/223] azurerm_application_gateway - support `host_names` property (#6630) fixes #6579 --- .../resource_arm_application_gateway.go | 37 ++++++- .../resource_arm_application_gateway_test.go | 100 ++++++++++++++++++ .../docs/r/application_gateway.html.markdown | 4 + 3 files changed, 137 insertions(+), 4 deletions(-) diff --git a/azurerm/internal/services/network/resource_arm_application_gateway.go b/azurerm/internal/services/network/resource_arm_application_gateway.go index 9e22c7bd6ba4c..762076f17eef1 100644 --- a/azurerm/internal/services/network/resource_arm_application_gateway.go +++ b/azurerm/internal/services/network/resource_arm_application_gateway.go @@ -401,6 +401,15 @@ func resourceArmApplicationGateway() *schema.Resource { Optional: true, }, + "host_names": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringIsNotEmpty, + }, + }, + "ssl_certificate_name": { Type: schema.TypeString, Optional: true, @@ -1348,6 +1357,11 @@ func resourceArmApplicationGatewayCreateUpdate(d *schema.ResourceData, meta inte gatewayIPConfigurations, stopApplicationGateway := expandApplicationGatewayIPConfigurations(d) + httpListeners, err := expandApplicationGatewayHTTPListeners(d, gatewayID) + if err != nil { + return fmt.Errorf("fail to expand `http_listener`: %+v", err) + } + gateway := network.ApplicationGateway{ Location: utils.String(location), Zones: azure.ExpandZones(d.Get("zones").([]interface{})), @@ -1364,7 +1378,7 @@ func resourceArmApplicationGatewayCreateUpdate(d *schema.ResourceData, meta inte FrontendIPConfigurations: expandApplicationGatewayFrontendIPConfigurations(d), FrontendPorts: expandApplicationGatewayFrontendPorts(d), GatewayIPConfigurations: gatewayIPConfigurations, - HTTPListeners: expandApplicationGatewayHTTPListeners(d, gatewayID), + HTTPListeners: httpListeners, Probes: expandApplicationGatewayProbes(d), RequestRoutingRules: requestRoutingRules, RedirectConfigurations: redirectConfigurations, @@ -2171,7 +2185,7 @@ func flattenApplicationGatewaySslPolicy(input *network.ApplicationGatewaySslPoli return results } -func expandApplicationGatewayHTTPListeners(d *schema.ResourceData, gatewayID string) *[]network.ApplicationGatewayHTTPListener { +func expandApplicationGatewayHTTPListeners(d *schema.ResourceData, gatewayID string) (*[]network.ApplicationGatewayHTTPListener, error) { vs := d.Get("http_listener").([]interface{}) results := make([]network.ApplicationGatewayHTTPListener, 0) @@ -2204,10 +2218,21 @@ func expandApplicationGatewayHTTPListeners(d *schema.ResourceData, gatewayID str }, } - if host := v["host_name"].(string); host != "" { + host := v["host_name"].(string) + hosts := v["host_names"].(*schema.Set).List() + + if host != "" && len(hosts) > 0 { + return nil, fmt.Errorf("`host_name` and `host_names` cannot be specified together") + } + + if host != "" { listener.ApplicationGatewayHTTPListenerPropertiesFormat.HostName = &host } + if len(hosts) > 0 { + listener.ApplicationGatewayHTTPListenerPropertiesFormat.Hostnames = utils.ExpandStringSlice(hosts) + } + if sslCertName := v["ssl_certificate_name"].(string); sslCertName != "" { certID := fmt.Sprintf("%s/sslCertificates/%s", gatewayID, sslCertName) listener.ApplicationGatewayHTTPListenerPropertiesFormat.SslCertificate = &network.SubResource{ @@ -2218,7 +2243,7 @@ func expandApplicationGatewayHTTPListeners(d *schema.ResourceData, gatewayID str results = append(results, listener) } - return &results + return &results, nil } func flattenApplicationGatewayHTTPListeners(input *[]network.ApplicationGatewayHTTPListener) ([]interface{}, error) { @@ -2267,6 +2292,10 @@ func flattenApplicationGatewayHTTPListeners(input *[]network.ApplicationGatewayH output["host_name"] = *hostname } + if hostnames := props.Hostnames; hostnames != nil { + output["host_names"] = utils.FlattenStringSlice(hostnames) + } + output["protocol"] = string(props.Protocol) if cert := props.SslCertificate; cert != nil { diff --git a/azurerm/internal/services/network/tests/resource_arm_application_gateway_test.go b/azurerm/internal/services/network/tests/resource_arm_application_gateway_test.go index 5db72587bdb48..d4cbd5072ba99 100644 --- a/azurerm/internal/services/network/tests/resource_arm_application_gateway_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_application_gateway_test.go @@ -497,6 +497,25 @@ func TestAccAzureRMApplicationGateway_backendHttpSettingsHostName(t *testing.T) }) } +func TestAccAzureRMApplicationGateway_withHttpListenerHostNames(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_application_gateway", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMApplicationGatewayDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMApplicationGateway_withHttpListenerHostNames(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMApplicationGatewayExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + func TestAccAzureRMApplicationGateway_backendHttpSettingsHostNameAndPick(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_application_gateway", "test") hostName := "example.com" @@ -2880,6 +2899,87 @@ resource "azurerm_application_gateway" "test" { `, template, data.RandomInteger, hostName, pick) } +func testAccAzureRMApplicationGateway_withHttpListenerHostNames(data acceptance.TestData) string { + template := testAccAzureRMApplicationGateway_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_public_ip" "test2" { + name = "acctest-pubip2-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + allocation_method = "Static" + sku = "Standard" + domain_name_label = "testdns-123" +} + +# since these variables are re-used - a locals block makes this more maintainable +locals { + backend_address_pool_name = "${azurerm_virtual_network.test.name}-beap" + frontend_port_name = "${azurerm_virtual_network.test.name}-feport" + frontend_ip_configuration_name = "${azurerm_virtual_network.test.name}-feip" + http_setting_name = "${azurerm_virtual_network.test.name}-be-htst" + listener_name = "${azurerm_virtual_network.test.name}-httplstn" + request_routing_rule_name = "${azurerm_virtual_network.test.name}-rqrt" +} + +resource "azurerm_application_gateway" "test" { + name = "acctestag-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + + sku { + name = "Standard_v2" + tier = "Standard_v2" + capacity = 2 + } + + gateway_ip_configuration { + name = "my-gateway-ip-configuration" + subnet_id = azurerm_subnet.test.id + } + + frontend_port { + name = local.frontend_port_name + port = 80 + } + + frontend_ip_configuration { + name = local.frontend_ip_configuration_name + public_ip_address_id = azurerm_public_ip.test2.id + } + + backend_address_pool { + name = local.backend_address_pool_name + } + + backend_http_settings { + name = local.http_setting_name + cookie_based_affinity = "Disabled" + port = 80 + protocol = "Http" + request_timeout = 1 + } + + http_listener { + name = local.listener_name + frontend_ip_configuration_name = local.frontend_ip_configuration_name + frontend_port_name = local.frontend_port_name + protocol = "Http" + host_names = ["testdns-123"] + } + + request_routing_rule { + name = local.request_routing_rule_name + rule_type = "Basic" + http_listener_name = local.listener_name + backend_address_pool_name = local.backend_address_pool_name + backend_http_settings_name = local.http_setting_name + } +} +`, template, data.RandomInteger, data.RandomInteger) +} + func testAccAzureRMApplicationGateway_settingsPickHostNameFromBackendAddress(data acceptance.TestData) string { template := testAccAzureRMApplicationGateway_template(data) return fmt.Sprintf(` diff --git a/website/docs/r/application_gateway.html.markdown b/website/docs/r/application_gateway.html.markdown index 2c0b894f5754b..5c6f4b5904a6e 100644 --- a/website/docs/r/application_gateway.html.markdown +++ b/website/docs/r/application_gateway.html.markdown @@ -288,6 +288,10 @@ A `http_listener` block supports the following: * `host_name` - (Optional) The Hostname which should be used for this HTTP Listener. +* `host_names` - (Optional) A list of Hostname(s) should be used for this HTTP Listener. It allows special wildcard characters. + +-> **NOTE** The `host_names` and `host_name` are mutually exclusive and cannot both be set. + * `protocol` - (Required) The Protocol to use for this HTTP Listener. Possible values are `Http` and `Https`. * `require_sni` - (Optional) Should Server Name Indication be Required? Defaults to `false`. From 8e318291d85d731e2045f377c89bb267c079bd5b Mon Sep 17 00:00:00 2001 From: kt Date: Sun, 26 Apr 2020 21:55:12 -0700 Subject: [PATCH 046/223] update CHANGELOG.md to include #6630 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e6155a3cd107..87ba9912d29f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ IMPROVEMENTS: * `azurerm_api_management` - `sku_name` supports the `Consumption` value for `sku` [GH-6602] * `azurerm_api_management_api` - support for openapi v3 content formats [GH-6618] +* `azurerm_application_gateway` - support `host_names` property [GH-6630] * `azurerm_express_route_circuit_peering` - support for the `customer_asn` and `routing_registry_name` propeties [GH-6596] * `azurerm_mssql_database` - support for the `extended_auditing_policy` block [GH-6402] From c1d8f52820899a20432c7fe4949c135adffbf414 Mon Sep 17 00:00:00 2001 From: Fabiano Franz Date: Mon, 27 Apr 2020 17:17:36 -0300 Subject: [PATCH 047/223] `azurerm_subnet`: Support for multiple prefixes with `address_prefixes` #6493 --- .../services/network/data_source_subnet.go | 15 ++++ .../services/network/resource_arm_subnet.go | 68 +++++++++++++++---- .../network/resource_arm_virtual_network.go | 5 +- .../network/tests/data_source_subnet_test.go | 51 ++++++++++++++ .../network/tests/resource_arm_subnet_test.go | 40 +++++++++++ website/docs/d/subnet.html.markdown | 3 +- website/docs/r/subnet.html.markdown | 11 ++- 7 files changed, 175 insertions(+), 18 deletions(-) diff --git a/azurerm/internal/services/network/data_source_subnet.go b/azurerm/internal/services/network/data_source_subnet.go index 752579d715852..fdf1560e96b34 100644 --- a/azurerm/internal/services/network/data_source_subnet.go +++ b/azurerm/internal/services/network/data_source_subnet.go @@ -40,6 +40,12 @@ func dataSourceArmSubnet() *schema.Resource { Computed: true, }, + "address_prefixes": { + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + Computed: true, + }, + "network_security_group_id": { Type: schema.TypeString, Computed: true, @@ -95,6 +101,15 @@ func dataSourceArmSubnetRead(d *schema.ResourceData, meta interface{}) error { if props := resp.SubnetPropertiesFormat; props != nil { d.Set("address_prefix", props.AddressPrefix) + if props.AddressPrefixes == nil { + if props.AddressPrefix != nil && len(*props.AddressPrefix) > 0 { + d.Set("address_prefixes", []string{*props.AddressPrefix}) + } else { + d.Set("address_prefixes", []string{}) + } + } else { + d.Set("address_prefixes", utils.FlattenStringSlice(props.AddressPrefixes)) + } d.Set("enforce_private_link_endpoint_network_policies", flattenSubnetPrivateLinkNetworkPolicy(props.PrivateEndpointNetworkPolicies)) d.Set("enforce_private_link_service_network_policies", flattenSubnetPrivateLinkNetworkPolicy(props.PrivateLinkServiceNetworkPolicies)) diff --git a/azurerm/internal/services/network/resource_arm_subnet.go b/azurerm/internal/services/network/resource_arm_subnet.go index d7d38b7e309b9..0a1994b72064c 100644 --- a/azurerm/internal/services/network/resource_arm_subnet.go +++ b/azurerm/internal/services/network/resource_arm_subnet.go @@ -54,7 +54,22 @@ func resourceArmSubnet() *schema.Resource { "address_prefix": { Type: schema.TypeString, - Required: true, + Optional: true, + Computed: true, + // TODO Remove this in the next major version release + Deprecated: "Use the `address_prefixes` property instead.", + ExactlyOneOf: []string{"address_prefix", "address_prefixes"}, + }, + + "address_prefixes": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringIsNotEmpty, + }, + ExactlyOneOf: []string{"address_prefix", "address_prefixes"}, }, "service_endpoints": { @@ -162,24 +177,35 @@ func resourceArmSubnetCreate(d *schema.ResourceData, meta interface{}) error { } } - addressPrefix := d.Get("address_prefix").(string) - locks.ByName(vnetName, VirtualNetworkResourceName) defer locks.UnlockByName(vnetName, VirtualNetworkResourceName) + properties := network.SubnetPropertiesFormat{} + if value, ok := d.GetOk("address_prefixes"); ok { + var addressPrefixes []string + for _, item := range value.([]interface{}) { + addressPrefixes = append(addressPrefixes, item.(string)) + } + properties.AddressPrefixes = &addressPrefixes + } + if value, ok := d.GetOk("address_prefix"); ok { + addressPrefix := value.(string) + properties.AddressPrefix = &addressPrefix + } + if properties.AddressPrefixes != nil && len(*properties.AddressPrefixes) == 1 { + properties.AddressPrefix = &(*properties.AddressPrefixes)[0] + properties.AddressPrefixes = nil + } + + // To enable private endpoints you must disable the network policies for the subnet because + // Network policies like network security groups are not supported by private endpoints. privateEndpointNetworkPolicies := d.Get("enforce_private_link_endpoint_network_policies").(bool) privateLinkServiceNetworkPolicies := d.Get("enforce_private_link_service_network_policies").(bool) + properties.PrivateEndpointNetworkPolicies = expandSubnetPrivateLinkNetworkPolicy(privateEndpointNetworkPolicies) + properties.PrivateLinkServiceNetworkPolicies = expandSubnetPrivateLinkNetworkPolicy(privateLinkServiceNetworkPolicies) serviceEndpointsRaw := d.Get("service_endpoints").([]interface{}) - properties := network.SubnetPropertiesFormat{ - AddressPrefix: &addressPrefix, - ServiceEndpoints: expandSubnetServiceEndpoints(serviceEndpointsRaw), - - // To enable private endpoints you must disable the network policies for the subnet because - // Network policies like network security groups are not supported by private endpoints. - PrivateEndpointNetworkPolicies: expandSubnetPrivateLinkNetworkPolicy(privateEndpointNetworkPolicies), - PrivateLinkServiceNetworkPolicies: expandSubnetPrivateLinkNetworkPolicy(privateLinkServiceNetworkPolicies), - } + properties.ServiceEndpoints = expandSubnetServiceEndpoints(serviceEndpointsRaw) delegationsRaw := d.Get("delegation").([]interface{}) properties.Delegations = expandSubnetDelegation(delegationsRaw) @@ -241,6 +267,15 @@ func resourceArmSubnetUpdate(d *schema.ResourceData, meta interface{}) error { props.AddressPrefix = utils.String(d.Get("address_prefix").(string)) } + if d.HasChange("address_prefixes") { + addressPrefixesRaw := d.Get("address_prefixes").([]interface{}) + props.AddressPrefixes = utils.ExpandStringSlice(addressPrefixesRaw) + if props.AddressPrefixes != nil && len(*props.AddressPrefixes) == 1 { + props.AddressPrefix = &(*props.AddressPrefixes)[0] + props.AddressPrefixes = nil + } + } + if d.HasChange("delegation") { delegationsRaw := d.Get("delegation").([]interface{}) props.Delegations = expandSubnetDelegation(delegationsRaw) @@ -307,6 +342,15 @@ func resourceArmSubnetRead(d *schema.ResourceData, meta interface{}) error { if props := resp.SubnetPropertiesFormat; props != nil { d.Set("address_prefix", props.AddressPrefix) + if props.AddressPrefixes == nil { + if props.AddressPrefix != nil && len(*props.AddressPrefix) > 0 { + d.Set("address_prefixes", []string{*props.AddressPrefix}) + } else { + d.Set("address_prefixes", []string{}) + } + } else { + d.Set("address_prefixes", props.AddressPrefixes) + } delegation := flattenSubnetDelegation(props.Delegations) if err := d.Set("delegation", delegation); err != nil { diff --git a/azurerm/internal/services/network/resource_arm_virtual_network.go b/azurerm/internal/services/network/resource_arm_virtual_network.go index c874dbc4461cb..a1761c5101cad 100644 --- a/azurerm/internal/services/network/resource_arm_virtual_network.go +++ b/azurerm/internal/services/network/resource_arm_virtual_network.go @@ -442,8 +442,9 @@ func resourceAzureSubnetHash(v interface{}) int { if m, ok := v.(map[string]interface{}); ok { buf.WriteString(m["name"].(string)) - buf.WriteString(m["address_prefix"].(string)) - + if v, ok := m["address_prefix"]; ok { + buf.WriteString(v.(string)) + } if v, ok := m["security_group"]; ok { buf.WriteString(v.(string)) } diff --git a/azurerm/internal/services/network/tests/data_source_subnet_test.go b/azurerm/internal/services/network/tests/data_source_subnet_test.go index be4dc9c0ab5b9..cbd4d88e2b5cf 100644 --- a/azurerm/internal/services/network/tests/data_source_subnet_test.go +++ b/azurerm/internal/services/network/tests/data_source_subnet_test.go @@ -30,6 +30,28 @@ func TestAccDataSourceSubnet_basic(t *testing.T) { }) } +func TestAccDataSourceAzureRMSubnet_basic_addressPrefixes(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_subnet", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceSubnet_basic_addressPrefixes(data), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(data.ResourceName, "name"), + resource.TestCheckResourceAttrSet(data.ResourceName, "resource_group_name"), + resource.TestCheckResourceAttrSet(data.ResourceName, "virtual_network_name"), + resource.TestCheckResourceAttrSet(data.ResourceName, "address_prefixes.#"), + resource.TestCheckResourceAttr(data.ResourceName, "network_security_group_id", ""), + resource.TestCheckResourceAttr(data.ResourceName, "route_table_id", ""), + ), + }, + }, + }) +} + func TestAccDataSourceSubnet_networkSecurityGroup(t *testing.T) { data := acceptance.BuildTestData(t, "data.azurerm_subnet", "test") @@ -127,6 +149,35 @@ data "azurerm_subnet" "test" { `, template) } +func testAccDataSourceSubnet_basic_addressPrefixes(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} +resource "azurerm_resource_group" "test" { + name = "acctest%d-rg" + location = "%s" +} +resource "azurerm_virtual_network" "test" { + name = "acctest%d-vn" + address_space = ["10.0.0.0/16", "ace:cab:deca::/48"] + location = "${azurerm_resource_group.test.location}" + resource_group_name = "${azurerm_resource_group.test.name}" +} +resource "azurerm_subnet" "test" { + name = "acctest%d-private" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" + address_prefixes = ["10.0.0.0/24", "ace:cab:deca:deed::/64"] +} +data "azurerm_subnet" "test" { + name = "${azurerm_subnet.test.name}" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} + func testAccDataSourceSubnet_networkSecurityGroupDependencies(data acceptance.TestData) string { template := testAccDataSourceSubnet_template(data) return fmt.Sprintf(` diff --git a/azurerm/internal/services/network/tests/resource_arm_subnet_test.go b/azurerm/internal/services/network/tests/resource_arm_subnet_test.go index ed484a655deb1..095912aab2b5e 100644 --- a/azurerm/internal/services/network/tests/resource_arm_subnet_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_subnet_test.go @@ -32,6 +32,25 @@ func TestAccAzureRMSubnet_basic(t *testing.T) { }) } +func TestAccAzureRMSubnet_basic_addressPrefixes(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_subnet", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMSubnetDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMSubnet_basic_addressPrefixes(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSubnetExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + func TestAccAzureRMSubnet_requiresImport(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_subnet", "test") @@ -436,6 +455,27 @@ resource "azurerm_subnet" "test" { `, template, enabled) } +func testAccAzureRMSubnet_basic_addressPrefixes(data acceptance.TestData) string { + return fmt.Sprintf(` +resource "azurerm_resource_group" "test" { + name = "acctestRG-n-%d" + location = "%s" +} +resource "azurerm_virtual_network" "test" { + name = "acctestvirtnet%d" + address_space = ["10.0.0.0/16", "ace:cab:deca::/48"] + location = "${azurerm_resource_group.test.location}" + resource_group_name = "${azurerm_resource_group.test.name}" +} +resource "azurerm_subnet" "test" { + name = "acctestsubnet%d" + resource_group_name = "${azurerm_resource_group.test.name}" + virtual_network_name = "${azurerm_virtual_network.test.name}" + address_prefixes = ["10.0.0.0/24", "ace:cab:deca:deed::/64"] +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} + func testAccAzureRMSubnet_requiresImport(data acceptance.TestData) string { template := testAccAzureRMSubnet_basic(data) return fmt.Sprintf(` diff --git a/website/docs/d/subnet.html.markdown b/website/docs/d/subnet.html.markdown index 73ea02db1300d..6f397f979e2c4 100644 --- a/website/docs/d/subnet.html.markdown +++ b/website/docs/d/subnet.html.markdown @@ -33,7 +33,8 @@ output "subnet_id" { ## Attributes Reference * `id` - The ID of the Subnet. -* `address_prefix` - The address prefix used for the subnet. +* `address_prefix` - (Deprecated) The address prefix used for the subnet. +* `address_prefixes` - The address prefixes for the subnet. * `enforce_private_link_service_network_policies` - Enable or Disable network policies on private link service in the subnet. * `network_security_group_id` - The ID of the Network Security Group associated with the subnet. * `route_table_id` - The ID of the Route Table associated with this subnet. diff --git a/website/docs/r/subnet.html.markdown b/website/docs/r/subnet.html.markdown index f7558527fe9bd..1fcd1db16318d 100644 --- a/website/docs/r/subnet.html.markdown +++ b/website/docs/r/subnet.html.markdown @@ -34,7 +34,7 @@ resource "azurerm_subnet" "example" { name = "testsubnet" resource_group_name = azurerm_resource_group.example.name virtual_network_name = azurerm_virtual_network.example.name - address_prefix = "10.0.1.0/24" + address_prefixes = ["10.0.1.0/24"] delegation { name = "acctestdelegation" @@ -57,7 +57,11 @@ The following arguments are supported: * `virtual_network_name` - (Required) The name of the virtual network to which to attach the subnet. Changing this forces a new resource to be created. -* `address_prefix` - (Required) The address prefix to use for the subnet. +* `address_prefix` - (Optional / **Deprecated in favour of `address_prefixes`**) The address prefix to use for the subnet. + +* `address_prefixes` - (Optional) The address prefixes to use for the subnet. + +-> **NOTE:** One of `address_prefix` or `address_prefixes` is required. --- @@ -101,7 +105,8 @@ The following attributes are exported: * `name` - The name of the subnet. * `resource_group_name` - The name of the resource group in which the subnet is created in. * `virtual_network_name` - The name of the virtual network in which the subnet is created in -* `address_prefix` - The address prefix for the subnet +* `address_prefix` - (Deprecated) The address prefix for the subnet +* `address_prefixes` - The address prefixes for the subnet ## Timeouts From d269242fe454b76020e1e59b5df226f405fb2d2c Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Mon, 27 Apr 2020 13:18:12 -0700 Subject: [PATCH 048/223] Update changelog for #6493 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87ba9912d29f4..9f730a3b817cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ IMPROVEMENTS: * `azurerm_application_gateway` - support `host_names` property [GH-6630] * `azurerm_express_route_circuit_peering` - support for the `customer_asn` and `routing_registry_name` propeties [GH-6596] * `azurerm_mssql_database` - support for the `extended_auditing_policy` block [GH-6402] +* `azurerm_subnet`: Support for multiple prefixes with `address_prefixes` [GH-6493] BUG FIXES: From 232b14ec5cbcd87712412af9784357e63d293004 Mon Sep 17 00:00:00 2001 From: magodo Date: Tue, 28 Apr 2020 05:06:00 +0800 Subject: [PATCH 049/223] New resource/data source: `azurerm_sentinel_alert_rule_ms_security_incident` (#6606) --- azurerm/internal/clients/client.go | 3 + .../provider/required_resource_providers.go | 1 + azurerm/internal/provider/services.go | 2 + .../parse/log_analytics_workspace.go | 33 + .../parse/log_analytics_workspace_test.go | 70 + .../resource_arm_log_analytics_workspace.go | 24 +- ...source_arm_log_analytics_workspace_test.go | 20 +- .../validate/log_analytics_workspace.go | 22 + .../services/sentinel/client/client.go | 19 + .../data_source_sentinel_alert_rule.go | 67 + .../sentinel/parse/sentinel_alert_rules.go | 34 + .../parse/sentinel_alert_rules_test.go | 84 + .../services/sentinel/registration.go | 33 + ...entinel_alert_rule_ms_security_incident.go | 273 + .../services/sentinel/sentinel_alert_rule.go | 66 + .../data_source_sentinel_alert_rule_test.go | 38 + ...el_alert_rule_ms_security_incident_test.go | 222 + .../securityinsight/actions.go | 173 + .../securityinsight/alertrules.go | 733 +++ .../securityinsight/client.go | 52 + .../securityinsight/dataconnectors.go | 449 ++ .../securityinsight/models.go | 4450 +++++++++++++++++ .../securityinsight/operations.go | 147 + .../securityinsight/version.go | 30 + vendor/modules.txt | 1 + website/allowed-subcategories | 1 + website/azurerm.erb | 13 + .../docs/d/sentinel_alert_rule.html.markdown | 53 + ...rt_rule_ms_security_incident.html.markdown | 86 + 29 files changed, 7176 insertions(+), 23 deletions(-) create mode 100644 azurerm/internal/services/loganalytics/parse/log_analytics_workspace.go create mode 100644 azurerm/internal/services/loganalytics/parse/log_analytics_workspace_test.go create mode 100644 azurerm/internal/services/loganalytics/validate/log_analytics_workspace.go create mode 100644 azurerm/internal/services/sentinel/client/client.go create mode 100644 azurerm/internal/services/sentinel/data_source_sentinel_alert_rule.go create mode 100644 azurerm/internal/services/sentinel/parse/sentinel_alert_rules.go create mode 100644 azurerm/internal/services/sentinel/parse/sentinel_alert_rules_test.go create mode 100644 azurerm/internal/services/sentinel/registration.go create mode 100644 azurerm/internal/services/sentinel/resource_arm_sentinel_alert_rule_ms_security_incident.go create mode 100644 azurerm/internal/services/sentinel/sentinel_alert_rule.go create mode 100644 azurerm/internal/services/sentinel/tests/data_source_sentinel_alert_rule_test.go create mode 100644 azurerm/internal/services/sentinel/tests/resource_arm_sentinel_alert_rule_ms_security_incident_test.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/actions.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/alertrules.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/dataconnectors.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/operations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/version.go create mode 100644 website/docs/d/sentinel_alert_rule.html.markdown create mode 100644 website/docs/r/sentinel_alert_rule_ms_security_incident.html.markdown diff --git a/azurerm/internal/clients/client.go b/azurerm/internal/clients/client.go index 0d7e6c005896e..091e8abbbe142 100644 --- a/azurerm/internal/clients/client.go +++ b/azurerm/internal/clients/client.go @@ -66,6 +66,7 @@ import ( resource "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/resource/client" search "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/search/client" securityCenter "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/securitycenter/client" + sentinel "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/sentinel/client" serviceBus "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus/client" serviceFabric "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicefabric/client" signalr "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/signalr/client" @@ -144,6 +145,7 @@ type Client struct { Resource *resource.Client Search *search.Client SecurityCenter *securityCenter.Client + Sentinel *sentinel.Client ServiceBus *serviceBus.Client ServiceFabric *serviceFabric.Client SignalR *signalr.Client @@ -223,6 +225,7 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error client.Resource = resource.NewClient(o) client.Search = search.NewClient(o) client.SecurityCenter = securityCenter.NewClient(o) + client.Sentinel = sentinel.NewClient(o) client.ServiceBus = serviceBus.NewClient(o) client.ServiceFabric = serviceFabric.NewClient(o) client.SignalR = signalr.NewClient(o) diff --git a/azurerm/internal/provider/required_resource_providers.go b/azurerm/internal/provider/required_resource_providers.go index a4ea62c40c91f..9ef9c682c85ee 100644 --- a/azurerm/internal/provider/required_resource_providers.go +++ b/azurerm/internal/provider/required_resource_providers.go @@ -67,6 +67,7 @@ func RequiredResourceProviders() map[string]struct{} { "Microsoft.Resources": {}, "Microsoft.Search": {}, "Microsoft.Security": {}, + "Microsoft.SecurityInsights": {}, "Microsoft.ServiceBus": {}, "Microsoft.ServiceFabric": {}, "Microsoft.Sql": {}, diff --git a/azurerm/internal/provider/services.go b/azurerm/internal/provider/services.go index a98bfb872a989..65e2243ec358e 100644 --- a/azurerm/internal/provider/services.go +++ b/azurerm/internal/provider/services.go @@ -62,6 +62,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/resource" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/search" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/securitycenter" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/sentinel" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicebus" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/servicefabric" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/signalr" @@ -137,6 +138,7 @@ func SupportedServices() []common.ServiceRegistration { resource.Registration{}, search.Registration{}, securitycenter.Registration{}, + sentinel.Registration{}, servicebus.Registration{}, servicefabric.Registration{}, signalr.Registration{}, diff --git a/azurerm/internal/services/loganalytics/parse/log_analytics_workspace.go b/azurerm/internal/services/loganalytics/parse/log_analytics_workspace.go new file mode 100644 index 0000000000000..d02b8cdd58875 --- /dev/null +++ b/azurerm/internal/services/loganalytics/parse/log_analytics_workspace.go @@ -0,0 +1,33 @@ +package parse + +import ( + "fmt" + + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" +) + +type LogAnalyticsWorkspaceId struct { + ResourceGroup string + Name string +} + +func LogAnalyticsWorkspaceID(input string) (*LogAnalyticsWorkspaceId, error) { + id, err := azure.ParseAzureResourceID(input) + if err != nil { + return nil, fmt.Errorf("parsing Log Analytics Workspace ID %q: %+v", input, err) + } + + server := LogAnalyticsWorkspaceId{ + ResourceGroup: id.ResourceGroup, + } + + if server.Name, err = id.PopSegment("workspaces"); err != nil { + return nil, err + } + + if err := id.ValidateNoEmptySegments(input); err != nil { + return nil, err + } + + return &server, nil +} diff --git a/azurerm/internal/services/loganalytics/parse/log_analytics_workspace_test.go b/azurerm/internal/services/loganalytics/parse/log_analytics_workspace_test.go new file mode 100644 index 0000000000000..5e3b113394c9f --- /dev/null +++ b/azurerm/internal/services/loganalytics/parse/log_analytics_workspace_test.go @@ -0,0 +1,70 @@ +package parse + +import ( + "testing" +) + +func TestLogAnalyticsWorkspaceID(t *testing.T) { + testData := []struct { + Name string + Input string + Error bool + Expect *LogAnalyticsWorkspaceId + }{ + { + Name: "Empty", + Input: "", + Error: true, + }, + { + Name: "No Resource Groups Segment", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000", + Error: true, + }, + { + Name: "No Resource Groups Value", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/", + Error: true, + }, + { + Name: "Resource Group ID", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/", + Error: true, + }, + { + Name: "Missing Workspace Value", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces", + Error: true, + }, + { + Name: "Workspace Value", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/workspace1", + Error: true, + Expect: &LogAnalyticsWorkspaceId{ + ResourceGroup: "resGroup1", + Name: "workspace1", + }, + }, + } + + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Name) + + actual, err := LogAnalyticsWorkspaceID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expected a value but got an error: %s", err) + } + + if actual.ResourceGroup != v.Expect.ResourceGroup { + t.Fatalf("Expected %q but got %q for Resource Group", v.Expect.ResourceGroup, actual.ResourceGroup) + } + + if actual.Name != v.Expect.Name { + t.Fatalf("Expected %q but got %q for Name", v.Expect.Name, actual.Name) + } + } +} diff --git a/azurerm/internal/services/loganalytics/resource_arm_log_analytics_workspace.go b/azurerm/internal/services/loganalytics/resource_arm_log_analytics_workspace.go index 42805b46505e1..f790515a4c551 100644 --- a/azurerm/internal/services/loganalytics/resource_arm_log_analytics_workspace.go +++ b/azurerm/internal/services/loganalytics/resource_arm_log_analytics_workspace.go @@ -14,6 +14,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loganalytics/parse" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" @@ -167,24 +168,22 @@ func resourceArmLogAnalyticsWorkspaceRead(d *schema.ResourceData, meta interface client := meta.(*clients.Client).LogAnalytics.WorkspacesClient ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := azure.ParseAzureResourceID(d.Id()) + id, err := parse.LogAnalyticsWorkspaceID(d.Id()) if err != nil { return err } - resGroup := id.ResourceGroup - name := id.Path["workspaces"] - resp, err := client.Get(ctx, resGroup, name) + resp, err := client.Get(ctx, id.ResourceGroup, id.Name) if err != nil { if utils.ResponseWasNotFound(resp.Response) { d.SetId("") return nil } - return fmt.Errorf("Error making Read request on AzureRM Log Analytics workspaces '%s': %+v", name, err) + return fmt.Errorf("Error making Read request on AzureRM Log Analytics workspaces '%s': %+v", id.Name, err) } d.Set("name", resp.Name) - d.Set("resource_group_name", resGroup) + d.Set("resource_group_name", id.ResourceGroup) if location := resp.Location; location != nil { d.Set("location", azure.NormalizeLocation(*location)) } @@ -196,9 +195,9 @@ func resourceArmLogAnalyticsWorkspaceRead(d *schema.ResourceData, meta interface } d.Set("retention_in_days", resp.RetentionInDays) - sharedKeys, err := client.GetSharedKeys(ctx, resGroup, name) + sharedKeys, err := client.GetSharedKeys(ctx, id.ResourceGroup, id.Name) if err != nil { - log.Printf("[ERROR] Unable to List Shared keys for Log Analytics workspaces %s: %+v", name, err) + log.Printf("[ERROR] Unable to List Shared keys for Log Analytics workspaces %s: %+v", id.Name, err) } else { d.Set("primary_shared_key", sharedKeys.PrimarySharedKey) d.Set("secondary_shared_key", sharedKeys.SecondarySharedKey) @@ -211,21 +210,18 @@ func resourceArmLogAnalyticsWorkspaceDelete(d *schema.ResourceData, meta interfa client := meta.(*clients.Client).LogAnalytics.WorkspacesClient ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := azure.ParseAzureResourceID(d.Id()) + id, err := parse.LogAnalyticsWorkspaceID(d.Id()) if err != nil { return err } - resGroup := id.ResourceGroup - name := id.Path["workspaces"] - - resp, err := client.Delete(ctx, resGroup, name) + resp, err := client.Delete(ctx, id.ResourceGroup, id.Name) if err != nil { if utils.ResponseWasNotFound(resp) { return nil } - return fmt.Errorf("Error issuing AzureRM delete request for Log Analytics Workspaces '%s': %+v", name, err) + return fmt.Errorf("Error issuing AzureRM delete request for Log Analytics Workspaces '%s': %+v", id.Name, err) } return nil diff --git a/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_workspace_test.go b/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_workspace_test.go index 1ae5bdf529747..88687d1752c64 100644 --- a/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_workspace_test.go +++ b/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_workspace_test.go @@ -11,6 +11,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loganalytics" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loganalytics/parse" ) func TestAccAzureRmLogAnalyticsWorkspaceName_validation(t *testing.T) { @@ -123,10 +124,12 @@ func testCheckAzureRMLogAnalyticsWorkspaceDestroy(s *terraform.State) error { continue } - name := rs.Primary.Attributes["name"] - resourceGroup := rs.Primary.Attributes["resource_group_name"] + id, err := parse.LogAnalyticsWorkspaceID(rs.Primary.ID) + if err != nil { + return err + } - resp, err := conn.Get(ctx, resourceGroup, name) + resp, err := conn.Get(ctx, id.ResourceGroup, id.Name) if err != nil { return nil @@ -151,19 +154,18 @@ func testCheckAzureRMLogAnalyticsWorkspaceExists(resourceName string) resource.T return fmt.Errorf("Not found: %s", resourceName) } - name := rs.Primary.Attributes["name"] - resourceGroup, hasResourceGroup := rs.Primary.Attributes["resource_group_name"] - if !hasResourceGroup { - return fmt.Errorf("Bad: no resource group found in state for Log Analytics Workspace: '%s'", name) + id, err := parse.LogAnalyticsWorkspaceID(rs.Primary.ID) + if err != nil { + return err } - resp, err := conn.Get(ctx, resourceGroup, name) + resp, err := conn.Get(ctx, id.ResourceGroup, id.Name) if err != nil { return fmt.Errorf("Bad: Get on Log Analytics Workspace Client: %+v", err) } if resp.StatusCode == http.StatusNotFound { - return fmt.Errorf("Bad: Log Analytics Workspace '%s' (resource group: '%s') does not exist", name, resourceGroup) + return fmt.Errorf("Bad: Log Analytics Workspace '%s' (resource group: '%s') does not exist", id.Name, id.ResourceGroup) } return nil diff --git a/azurerm/internal/services/loganalytics/validate/log_analytics_workspace.go b/azurerm/internal/services/loganalytics/validate/log_analytics_workspace.go new file mode 100644 index 0000000000000..f40d4b02f4245 --- /dev/null +++ b/azurerm/internal/services/loganalytics/validate/log_analytics_workspace.go @@ -0,0 +1,22 @@ +package validate + +import ( + "fmt" + + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loganalytics/parse" +) + +func LogAnalyticsWorkspaceID(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %q to be string", k)) + return + } + + if _, err := parse.LogAnalyticsWorkspaceID(v); err != nil { + errors = append(errors, fmt.Errorf("parsing %q as a resource id: %v", k, err)) + return + } + + return warnings, errors +} diff --git a/azurerm/internal/services/sentinel/client/client.go b/azurerm/internal/services/sentinel/client/client.go new file mode 100644 index 0000000000000..a5e32da447d18 --- /dev/null +++ b/azurerm/internal/services/sentinel/client/client.go @@ -0,0 +1,19 @@ +package client + +import ( + "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" +) + +type Client struct { + AlertRulesClient *securityinsight.AlertRulesClient +} + +func NewClient(o *common.ClientOptions) *Client { + alertRulesClient := securityinsight.NewAlertRulesClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + o.ConfigureClient(&alertRulesClient.Client, o.ResourceManagerAuthorizer) + + return &Client{ + AlertRulesClient: &alertRulesClient, + } +} diff --git a/azurerm/internal/services/sentinel/data_source_sentinel_alert_rule.go b/azurerm/internal/services/sentinel/data_source_sentinel_alert_rule.go new file mode 100644 index 0000000000000..601cf986d4117 --- /dev/null +++ b/azurerm/internal/services/sentinel/data_source_sentinel_alert_rule.go @@ -0,0 +1,67 @@ +package sentinel + +import ( + "fmt" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + loganalyticsParse "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loganalytics/parse" + loganalyticsValidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loganalytics/validate" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func dataSourceArmSentinelAlertRule() *schema.Resource { + return &schema.Resource{ + Read: dataSourceArmSentinelAlertRuleRead, + + Timeouts: &schema.ResourceTimeout{ + Read: schema.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "log_analytics_workspace_id": { + Type: schema.TypeString, + Required: true, + ValidateFunc: loganalyticsValidate.LogAnalyticsWorkspaceID, + }, + }, + } +} + +func dataSourceArmSentinelAlertRuleRead(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Sentinel.AlertRulesClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + name := d.Get("name").(string) + workspaceID, err := loganalyticsParse.LogAnalyticsWorkspaceID(d.Get("log_analytics_workspace_id").(string)) + if err != nil { + return err + } + + resp, err := client.Get(ctx, workspaceID.ResourceGroup, workspaceID.Name, name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Sentinel Alert Rule %q (Resource Group %q / Workspace: %q) was not found", name, workspaceID.ResourceGroup, workspaceID.Name) + } + + return fmt.Errorf("retrieving Sentinel Alert Rule %q (Resource Group %q / Workspace: %q): %+v", name, workspaceID.ResourceGroup, workspaceID.Name, err) + } + + id := alertRuleID(resp.Value) + if id == nil || *id == "" { + return fmt.Errorf("nil or empty ID of Sentinel Alert Rule %q (Resource Group %q / Workspace: %q)", name, workspaceID.ResourceGroup, workspaceID.Name) + } + d.SetId(*id) + + return nil +} diff --git a/azurerm/internal/services/sentinel/parse/sentinel_alert_rules.go b/azurerm/internal/services/sentinel/parse/sentinel_alert_rules.go new file mode 100644 index 0000000000000..adc5b576015b2 --- /dev/null +++ b/azurerm/internal/services/sentinel/parse/sentinel_alert_rules.go @@ -0,0 +1,34 @@ +package parse + +import ( + "fmt" + "regexp" + + loganalyticsParse "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loganalytics/parse" +) + +type SentinelAlertRuleId struct { + ResourceGroup string + Workspace string + Name string +} + +func SentinelAlertRuleID(input string) (*SentinelAlertRuleId, error) { + // Example ID: /subscriptions//resourceGroups//providers/Microsoft.OperationalInsights/workspaces//providers/Microsoft.SecurityInsights/alertRules/ + groups := regexp.MustCompile(`^(.+)/providers/Microsoft\.SecurityInsights/alertRules/(.+)$`).FindStringSubmatch(input) + if len(groups) != 3 { + return nil, fmt.Errorf("failed to parse Sentinel Alert Rule ID: %q", input) + } + + workspace, name := groups[1], groups[2] + + workspaceId, err := loganalyticsParse.LogAnalyticsWorkspaceID(workspace) + if err != nil { + return nil, fmt.Errorf("parsing workspace part of Sentinel Alert Rule ID %q: %+v", input, err) + } + return &SentinelAlertRuleId{ + ResourceGroup: workspaceId.ResourceGroup, + Workspace: workspaceId.Name, + Name: name, + }, nil +} diff --git a/azurerm/internal/services/sentinel/parse/sentinel_alert_rules_test.go b/azurerm/internal/services/sentinel/parse/sentinel_alert_rules_test.go new file mode 100644 index 0000000000000..eff21877f2f97 --- /dev/null +++ b/azurerm/internal/services/sentinel/parse/sentinel_alert_rules_test.go @@ -0,0 +1,84 @@ +package parse + +import ( + "testing" +) + +func TestSentinelAlertRuleID(t *testing.T) { + testData := []struct { + Name string + Input string + Error bool + Expect *SentinelAlertRuleId + }{ + { + Name: "Empty", + Input: "", + Error: true, + }, + { + Name: "No Resource Groups Segment", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000", + Error: true, + }, + { + Name: "No Resource Groups Value", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/", + Error: true, + }, + { + Name: "No Workspace ID", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights", + Error: true, + }, + { + Name: "No Alert Rule Name", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/space1/providers/Microsoft.SecurityInsights/alertRules/", + Error: true, + }, + { + Name: "Incorrect Provider for Alert Rules", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/space1/providers/Foo.Bar/alertRules/rule1", + Error: true, + }, + { + Name: "Incorrect Caseing", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/space1/providers/Microsoft.SecurityInsights/AlertRules/rule1", + Error: true, + }, + { + Name: "Correct Case", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.OperationalInsights/workspaces/space1/providers/Microsoft.SecurityInsights/alertRules/rule1", + Expect: &SentinelAlertRuleId{ + ResourceGroup: "resGroup1", + Workspace: "space1", + Name: "rule1", + }, + }, + } + + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Name) + + actual, err := SentinelAlertRuleID(v.Input) + if err != nil { + if v.Error { + continue + } + + t.Fatalf("Expected a value but got an error: %s", err) + } + + if actual.ResourceGroup != v.Expect.ResourceGroup { + t.Fatalf("Expected %q but got %q for Resource Group", v.Expect.ResourceGroup, actual.ResourceGroup) + } + + if actual.Workspace != v.Expect.Workspace { + t.Fatalf("Expected %q but got %q for Workspace", v.Expect.Name, actual.Name) + } + + if actual.Name != v.Expect.Name { + t.Fatalf("Expected %q but got %q for Name", v.Expect.Name, actual.Name) + } + } +} diff --git a/azurerm/internal/services/sentinel/registration.go b/azurerm/internal/services/sentinel/registration.go new file mode 100644 index 0000000000000..9bcdea16837ac --- /dev/null +++ b/azurerm/internal/services/sentinel/registration.go @@ -0,0 +1,33 @@ +package sentinel + +import ( + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +type Registration struct{} + +// Name is the name of this Service +func (r Registration) Name() string { + return "Sentinel" +} + +// WebsiteCategories returns a list of categories which can be used for the sidebar +func (r Registration) WebsiteCategories() []string { + return []string{ + "Sentinel", + } +} + +// SupportedDataSources returns the supported Data Sources supported by this Service +func (r Registration) SupportedDataSources() map[string]*schema.Resource { + return map[string]*schema.Resource{ + "azurerm_sentinel_alert_rule": dataSourceArmSentinelAlertRule(), + } +} + +// SupportedResources returns the supported Resources supported by this Service +func (r Registration) SupportedResources() map[string]*schema.Resource { + return map[string]*schema.Resource{ + "azurerm_sentinel_alert_rule_ms_security_incident": resourceArmSentinelAlertRuleMsSecurityIncident(), + } +} diff --git a/azurerm/internal/services/sentinel/resource_arm_sentinel_alert_rule_ms_security_incident.go b/azurerm/internal/services/sentinel/resource_arm_sentinel_alert_rule_ms_security_incident.go new file mode 100644 index 0000000000000..18321eedae103 --- /dev/null +++ b/azurerm/internal/services/sentinel/resource_arm_sentinel_alert_rule_ms_security_incident.go @@ -0,0 +1,273 @@ +package sentinel + +import ( + "fmt" + "log" + "time" + + "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + loganalyticsParse "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loganalytics/parse" + loganalyticsValidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loganalytics/validate" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/sentinel/parse" + azSchema "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/schema" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func resourceArmSentinelAlertRuleMsSecurityIncident() *schema.Resource { + return &schema.Resource{ + Create: resourceArmSentinelAlertRuleMsSecurityIncidentCreateUpdate, + Read: resourceArmSentinelAlertRuleMsSecurityIncidentRead, + Update: resourceArmSentinelAlertRuleMsSecurityIncidentCreateUpdate, + Delete: resourceArmSentinelAlertRuleMsSecurityIncidentDelete, + + Importer: azSchema.ValidateResourceIDPriorToImportThen(func(id string) error { + _, err := parse.SentinelAlertRuleID(id) + return err + }, importSentinelAlertRule(securityinsight.MicrosoftSecurityIncidentCreation)), + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(30 * time.Minute), + Read: schema.DefaultTimeout(5 * time.Minute), + Update: schema.DefaultTimeout(30 * time.Minute), + Delete: schema.DefaultTimeout(30 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "log_analytics_workspace_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: loganalyticsValidate.LogAnalyticsWorkspaceID, + }, + + "display_name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "product_filter": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + string(securityinsight.MicrosoftCloudAppSecurity), + string(securityinsight.AzureSecurityCenter), + string(securityinsight.AzureActiveDirectoryIdentityProtection), + string(securityinsight.AzureSecurityCenterforIoT), + string(securityinsight.AzureAdvancedThreatProtection), + }, false), + }, + + "severity_filter": { + Type: schema.TypeSet, + Required: true, + MinItems: 1, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + string(securityinsight.High), + string(securityinsight.Medium), + string(securityinsight.Low), + string(securityinsight.Informational), + }, false), + }, + }, + + "description": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: true, + }, + + "text_whitelist": { + Type: schema.TypeSet, + Optional: true, + MinItems: 1, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringIsNotEmpty, + }, + }, + }, + } +} + +func resourceArmSentinelAlertRuleMsSecurityIncidentCreateUpdate(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Sentinel.AlertRulesClient + ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) + defer cancel() + + name := d.Get("name").(string) + workspaceID, err := loganalyticsParse.LogAnalyticsWorkspaceID(d.Get("log_analytics_workspace_id").(string)) + if err != nil { + return err + } + + if d.IsNewResource() { + resp, err := client.Get(ctx, workspaceID.ResourceGroup, workspaceID.Name, name) + if err != nil { + if !utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("checking for existing Sentinel Alert Rule Ms Security Incident %q (Resource Group %q): %+v", name, workspaceID.ResourceGroup, err) + } + } + + id := alertRuleID(resp.Value) + if id != nil && *id != "" { + return tf.ImportAsExistsError("azurerm_sentinel_alert_rule_ms_security_incident", *id) + } + } + + param := securityinsight.MicrosoftSecurityIncidentCreationAlertRule{ + Kind: securityinsight.KindMicrosoftSecurityIncidentCreation, + MicrosoftSecurityIncidentCreationAlertRuleProperties: &securityinsight.MicrosoftSecurityIncidentCreationAlertRuleProperties{ + ProductFilter: securityinsight.MicrosoftSecurityProductName(d.Get("product_filter").(string)), + DisplayName: utils.String(d.Get("display_name").(string)), + Description: utils.String(d.Get("description").(string)), + Enabled: utils.Bool(d.Get("enabled").(bool)), + SeveritiesFilter: expandAlertRuleMsSecurityIncidentSeverityFilter(d.Get("severity_filter").(*schema.Set).List()), + }, + } + + if whitelist, ok := d.GetOk("text_whitelist"); ok { + param.DisplayNamesFilter = utils.ExpandStringSlice(whitelist.(*schema.Set).List()) + } + + // Service avoid concurrent update of this resource via checking the "etag" to guarantee it is the same value as last Read. + if !d.IsNewResource() { + resp, err := client.Get(ctx, workspaceID.ResourceGroup, workspaceID.Name, name) + if err != nil { + return fmt.Errorf("retrieving Sentinel Alert Rule Ms Security Incident %q (Resource Group %q / Workspace: %q): %+v", name, workspaceID.ResourceGroup, workspaceID.Name, err) + } + + if err := assertAlertRuleKind(resp.Value, securityinsight.MicrosoftSecurityIncidentCreation); err != nil { + return fmt.Errorf("asserting alert rule of %q (Resource Group %q / Workspace: %q): %+v", name, workspaceID.ResourceGroup, workspaceID.Name, err) + } + param.Etag = resp.Value.(securityinsight.MicrosoftSecurityIncidentCreationAlertRule).Etag + } + + if _, err := client.CreateOrUpdate(ctx, workspaceID.ResourceGroup, workspaceID.Name, name, param); err != nil { + return fmt.Errorf("creating Sentinel Alert Rule Ms Security Incident %q (Resource Group %q / Workspace: %q): %+v", name, workspaceID.ResourceGroup, workspaceID.Name, err) + } + + resp, err := client.Get(ctx, workspaceID.ResourceGroup, workspaceID.Name, name) + if err != nil { + return fmt.Errorf("retrieving Sentinel Alert Rule Ms Security Incident %q (Resource Group %q / Workspace: %q): %+v", name, workspaceID.ResourceGroup, workspaceID.Name, err) + } + id := alertRuleID(resp.Value) + if id == nil || *id == "" { + return fmt.Errorf("empty or nil ID returned for Sentinel Alert Rule Ms Security Incident %q (Resource Group %q / Workspace: %q) ID", name, workspaceID.ResourceGroup, workspaceID.Name) + } + d.SetId(*id) + + return resourceArmSentinelAlertRuleMsSecurityIncidentRead(d, meta) +} + +func resourceArmSentinelAlertRuleMsSecurityIncidentRead(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Sentinel.AlertRulesClient + workspaceClient := meta.(*clients.Client).LogAnalytics.WorkspacesClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.SentinelAlertRuleID(d.Id()) + if err != nil { + return err + } + + resp, err := client.Get(ctx, id.ResourceGroup, id.Workspace, id.Name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + log.Printf("[DEBUG] Sentinel Alert Rule Ms Security Incident %q was not found in Workspace: %q in Resource Group %q - removing from state!", id.Name, id.Workspace, id.ResourceGroup) + d.SetId("") + return nil + } + + return fmt.Errorf("retrieving Sentinel Alert Rule Ms Security Incident %q (Resource Group %q / Workspace: %q): %+v", id.Name, id.ResourceGroup, id.Workspace, err) + } + + if err := assertAlertRuleKind(resp.Value, securityinsight.MicrosoftSecurityIncidentCreation); err != nil { + return fmt.Errorf("asserting alert rule of %q (Resource Group %q / Workspace: %q): %+v", id.Name, id.ResourceGroup, id.Workspace, err) + } + rule := resp.Value.(securityinsight.MicrosoftSecurityIncidentCreationAlertRule) + + d.Set("name", id.Name) + + workspaceResp, err := workspaceClient.Get(ctx, id.ResourceGroup, id.Workspace) + if err != nil { + return fmt.Errorf("retrieving Log Analytics Workspace %q (Resource Group: %q) where this Alert Rule belongs to: %+v", id.Workspace, id.ResourceGroup, err) + } + d.Set("log_analytics_workspace_id", workspaceResp.ID) + if prop := rule.MicrosoftSecurityIncidentCreationAlertRuleProperties; prop != nil { + d.Set("product_filter", string(prop.ProductFilter)) + d.Set("display_name", prop.DisplayName) + d.Set("description", prop.Description) + d.Set("enabled", prop.Enabled) + + if err := d.Set("text_whitelist", utils.FlattenStringSlice(prop.DisplayNamesFilter)); err != nil { + return fmt.Errorf(`setting "text_whitelist": %+v`, err) + } + if err := d.Set("severity_filter", flattenAlertRuleMsSecurityIncidentSeverityFilter(prop.SeveritiesFilter)); err != nil { + return fmt.Errorf(`setting "severity_filter": %+v`, err) + } + } + + return nil +} + +func resourceArmSentinelAlertRuleMsSecurityIncidentDelete(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Sentinel.AlertRulesClient + ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.SentinelAlertRuleID(d.Id()) + if err != nil { + return err + } + + if _, err := client.Delete(ctx, id.ResourceGroup, id.Workspace, id.Name); err != nil { + return fmt.Errorf("deleting Sentinel Alert Rule Ms Security Incident %q (Resource Group %q / Workspace: %q): %+v", id.Name, id.ResourceGroup, id.Workspace, err) + } + + return nil +} + +func expandAlertRuleMsSecurityIncidentSeverityFilter(input []interface{}) *[]securityinsight.AlertSeverity { + result := make([]securityinsight.AlertSeverity, 0) + + for _, e := range input { + result = append(result, securityinsight.AlertSeverity(e.(string))) + } + + return &result +} + +func flattenAlertRuleMsSecurityIncidentSeverityFilter(input *[]securityinsight.AlertSeverity) []interface{} { + if input == nil { + return []interface{}{} + } + + output := make([]interface{}, 0) + + for _, e := range *input { + output = append(output, string(e)) + } + + return output +} diff --git a/azurerm/internal/services/sentinel/sentinel_alert_rule.go b/azurerm/internal/services/sentinel/sentinel_alert_rule.go new file mode 100644 index 0000000000000..d8b4009e3b755 --- /dev/null +++ b/azurerm/internal/services/sentinel/sentinel_alert_rule.go @@ -0,0 +1,66 @@ +package sentinel + +import ( + "fmt" + + "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/sentinel/parse" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" +) + +func alertRuleID(rule securityinsight.BasicAlertRule) *string { + if rule == nil { + return nil + } + switch rule := rule.(type) { + case securityinsight.FusionAlertRule: + return rule.ID + case securityinsight.MicrosoftSecurityIncidentCreationAlertRule: + return rule.ID + case securityinsight.ScheduledAlertRule: + return rule.ID + default: + return nil + } +} + +func importSentinelAlertRule(expectKind securityinsight.AlertRuleKind) func(d *schema.ResourceData, meta interface{}) (data []*schema.ResourceData, err error) { + return func(d *schema.ResourceData, meta interface{}) (data []*schema.ResourceData, err error) { + id, err := parse.SentinelAlertRuleID(d.Id()) + if err != nil { + return nil, err + } + + client := meta.(*clients.Client).Sentinel.AlertRulesClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + resp, err := client.Get(ctx, id.ResourceGroup, id.Workspace, id.Name) + if err != nil { + return nil, fmt.Errorf("retrieving Sentinel Alert Rule %q (Resource Group %q / Workspace: %q): %+v", id.Name, id.ResourceGroup, id.Workspace, err) + } + + if err := assertAlertRuleKind(resp.Value, expectKind); err != nil { + return nil, err + } + return []*schema.ResourceData{d}, nil + } +} + +func assertAlertRuleKind(rule securityinsight.BasicAlertRule, expectKind securityinsight.AlertRuleKind) error { + var kind securityinsight.AlertRuleKind + switch rule.(type) { + case securityinsight.FusionAlertRule: + kind = securityinsight.Fusion + case securityinsight.MicrosoftSecurityIncidentCreationAlertRule: + kind = securityinsight.MicrosoftSecurityIncidentCreation + case securityinsight.ScheduledAlertRule: + kind = securityinsight.Scheduled + } + if expectKind != kind { + return fmt.Errorf("Sentinel Alert Rule has mismatched kind, expected: %q, got %q", expectKind, kind) + } + return nil +} diff --git a/azurerm/internal/services/sentinel/tests/data_source_sentinel_alert_rule_test.go b/azurerm/internal/services/sentinel/tests/data_source_sentinel_alert_rule_test.go new file mode 100644 index 0000000000000..db9a1a7d8352f --- /dev/null +++ b/azurerm/internal/services/sentinel/tests/data_source_sentinel_alert_rule_test.go @@ -0,0 +1,38 @@ +package tests + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" +) + +func TestAccDataSourceSentinelAlertRule_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_sentinel_alert_rule", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceSentinelAlertRule_basic(data), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(data.ResourceName, "id"), + ), + }, + }, + }) +} + +func testAccDataSourceSentinelAlertRule_basic(data acceptance.TestData) string { + config := testAccAzureRMSentinelAlertRuleMsSecurityIncident_basic(data) + return fmt.Sprintf(` +%s + +data "azurerm_sentinel_alert_rule" "test" { + name = azurerm_sentinel_alert_rule_ms_security_incident.test.name + log_analytics_workspace_id = azurerm_log_analytics_workspace.test.id +} +`, config) +} diff --git a/azurerm/internal/services/sentinel/tests/resource_arm_sentinel_alert_rule_ms_security_incident_test.go b/azurerm/internal/services/sentinel/tests/resource_arm_sentinel_alert_rule_ms_security_incident_test.go new file mode 100644 index 0000000000000..65399066d1c6c --- /dev/null +++ b/azurerm/internal/services/sentinel/tests/resource_arm_sentinel_alert_rule_ms_security_incident_test.go @@ -0,0 +1,222 @@ +package tests + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/sentinel/parse" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func TestAccAzureRMSentinelAlertRuleMsSecurityIncident_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_sentinel_alert_rule_ms_security_incident", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMSentinelAlertRuleMsSecurityIncidentDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMSentinelAlertRuleMsSecurityIncident_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSentinelAlertRuleMsSecurityIncidentExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + +func TestAccAzureRMSentinelAlertRuleMsSecurityIncident_complete(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_sentinel_alert_rule_ms_security_incident", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMSentinelAlertRuleMsSecurityIncidentDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMSentinelAlertRuleMsSecurityIncident_complete(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSentinelAlertRuleMsSecurityIncidentExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + +func TestAccAzureRMSentinelAlertRuleMsSecurityIncident_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_sentinel_alert_rule_ms_security_incident", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMSentinelAlertRuleMsSecurityIncidentDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMSentinelAlertRuleMsSecurityIncident_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSentinelAlertRuleMsSecurityIncidentExists(data.ResourceName), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMSentinelAlertRuleMsSecurityIncident_complete(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSentinelAlertRuleMsSecurityIncidentExists(data.ResourceName), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMSentinelAlertRuleMsSecurityIncident_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSentinelAlertRuleMsSecurityIncidentExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + +func TestAccAzureRMSentinelAlertRuleMsSecurityIncident_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_sentinel_alert_rule_ms_security_incident", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMSentinelAlertRuleMsSecurityIncidentDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMSentinelAlertRuleMsSecurityIncident_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSentinelAlertRuleMsSecurityIncidentExists(data.ResourceName), + ), + }, + data.RequiresImportErrorStep(testAccAzureRMSentinelAlertRuleMsSecurityIncident_requiresImport), + }, + }) +} + +func testCheckAzureRMSentinelAlertRuleMsSecurityIncidentExists(resourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).Sentinel.AlertRulesClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Sentinel Alert Rule Ms Security Incident not found: %s", resourceName) + } + + id, err := parse.SentinelAlertRuleID(rs.Primary.ID) + if err != nil { + return err + } + + if resp, err := client.Get(ctx, id.ResourceGroup, id.Workspace, id.Name); err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Sentinel Alert Rule Ms Security Incident %q (Resource Group %q / Workspace: %q) does not exist", id.Name, id.ResourceGroup, id.Workspace) + } + return fmt.Errorf("Getting on Sentinel.AlertRules: %+v", err) + } + + return nil + } +} + +func testCheckAzureRMSentinelAlertRuleMsSecurityIncidentDestroy(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).Sentinel.AlertRulesClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + for _, rs := range s.RootModule().Resources { + if rs.Type != "azurerm_sentinel_alert_rule_ms_security_incident" { + continue + } + + id, err := parse.SentinelAlertRuleID(rs.Primary.ID) + if err != nil { + return err + } + + if resp, err := client.Get(ctx, id.ResourceGroup, id.Workspace, id.Name); err != nil { + if !utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Getting on Sentinel.AlertRules: %+v", err) + } + } + + return nil + } + + return nil +} + +func testAccAzureRMSentinelAlertRuleMsSecurityIncident_basic(data acceptance.TestData) string { + template := testAccAzureRMSentinelAlertRuleMsSecurityIncident_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_sentinel_alert_rule_ms_security_incident" "test" { + name = "acctest-SentinelAlertRule-MSI-%d" + log_analytics_workspace_id = azurerm_log_analytics_workspace.test.id + product_filter = "Microsoft Cloud App Security" + display_name = "some rule" + severity_filter = ["High"] +} +`, template, data.RandomInteger) +} + +func testAccAzureRMSentinelAlertRuleMsSecurityIncident_complete(data acceptance.TestData) string { + template := testAccAzureRMSentinelAlertRuleMsSecurityIncident_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_sentinel_alert_rule_ms_security_incident" "test" { + name = "acctest-SentinelAlertRule-MSI-%d" + log_analytics_workspace_id = azurerm_log_analytics_workspace.test.id + product_filter = "Azure Security Center" + display_name = "updated rule" + severity_filter = ["High", "Low"] + description = "this is a alert rule" + text_whitelist = ["alert"] +} +`, template, data.RandomInteger) +} + +func testAccAzureRMSentinelAlertRuleMsSecurityIncident_requiresImport(data acceptance.TestData) string { + template := testAccAzureRMSentinelAlertRuleMsSecurityIncident_basic(data) + return fmt.Sprintf(` +%s + +resource "azurerm_sentinel_alert_rule_ms_security_incident" "import" { + name = azurerm_sentinel_alert_rule_ms_security_incident.test.name + log_analytics_workspace_id = azurerm_sentinel_alert_rule_ms_security_incident.test.log_analytics_workspace_id + product_filter = azurerm_sentinel_alert_rule_ms_security_incident.test.product_filter + display_name = azurerm_sentinel_alert_rule_ms_security_incident.test.display_name + severity_filter = azurerm_sentinel_alert_rule_ms_security_incident.test.severity_filter +} +`, template) +} + +func testAccAzureRMSentinelAlertRuleMsSecurityIncident_template(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-sentinel-%d" + location = "%s" +} + +resource "azurerm_log_analytics_workspace" "test" { + name = "acctestLAW-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku = "PerGB2018" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/actions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/actions.go new file mode 100644 index 0000000000000..ab89e65fa1996 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/actions.go @@ -0,0 +1,173 @@ +package securityinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ActionsClient is the API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider +type ActionsClient struct { + BaseClient +} + +// NewActionsClient creates an instance of the ActionsClient client. +func NewActionsClient(subscriptionID string) ActionsClient { + return NewActionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewActionsClientWithBaseURI creates an instance of the ActionsClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewActionsClientWithBaseURI(baseURI string, subscriptionID string) ActionsClient { + return ActionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByAlertRule gets all actions of alert rule. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// workspaceName - the name of the workspace. +// ruleID - alert rule ID +func (client ActionsClient) ListByAlertRule(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string) (result ActionsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ActionsClient.ListByAlertRule") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.ActionsClient", "ListByAlertRule", err.Error()) + } + + result.fn = client.listByAlertRuleNextResults + req, err := client.ListByAlertRulePreparer(ctx, resourceGroupName, workspaceName, ruleID) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.ActionsClient", "ListByAlertRule", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAlertRuleSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.ActionsClient", "ListByAlertRule", resp, "Failure sending request") + return + } + + result.al, err = client.ListByAlertRuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.ActionsClient", "ListByAlertRule", resp, "Failure responding to request") + } + + return +} + +// ListByAlertRulePreparer prepares the ListByAlertRule request. +func (client ActionsClient) ListByAlertRulePreparer(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleId": autorest.Encode("path", ruleID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAlertRuleSender sends the ListByAlertRule request. The method will close the +// http.Response Body if it receives an error. +func (client ActionsClient) ListByAlertRuleSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAlertRuleResponder handles the response to the ListByAlertRule request. The method always +// closes the http.Response Body. +func (client ActionsClient) ListByAlertRuleResponder(resp *http.Response) (result ActionsList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAlertRuleNextResults retrieves the next set of results, if any. +func (client ActionsClient) listByAlertRuleNextResults(ctx context.Context, lastResults ActionsList) (result ActionsList, err error) { + req, err := lastResults.actionsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "securityinsight.ActionsClient", "listByAlertRuleNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAlertRuleSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "securityinsight.ActionsClient", "listByAlertRuleNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAlertRuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.ActionsClient", "listByAlertRuleNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAlertRuleComplete enumerates all values, automatically crossing page boundaries as required. +func (client ActionsClient) ListByAlertRuleComplete(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string) (result ActionsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ActionsClient.ListByAlertRule") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByAlertRule(ctx, resourceGroupName, workspaceName, ruleID) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/alertrules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/alertrules.go new file mode 100644 index 0000000000000..1d5b29d4d72ce --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/alertrules.go @@ -0,0 +1,733 @@ +package securityinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AlertRulesClient is the API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider +type AlertRulesClient struct { + BaseClient +} + +// NewAlertRulesClient creates an instance of the AlertRulesClient client. +func NewAlertRulesClient(subscriptionID string) AlertRulesClient { + return NewAlertRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAlertRulesClientWithBaseURI creates an instance of the AlertRulesClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewAlertRulesClientWithBaseURI(baseURI string, subscriptionID string) AlertRulesClient { + return AlertRulesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the alert rule. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// workspaceName - the name of the workspace. +// ruleID - alert rule ID +// alertRule - the alert rule +func (client AlertRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string, alertRule BasicAlertRule) (result AlertRuleModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.AlertRulesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, ruleID, alertRule) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AlertRulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string, alertRule BasicAlertRule) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleId": autorest.Encode("path", ruleID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}", pathParameters), + autorest.WithJSON(alertRule), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AlertRulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AlertRulesClient) CreateOrUpdateResponder(resp *http.Response) (result AlertRuleModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateAction creates or updates the action of alert rule. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// workspaceName - the name of the workspace. +// ruleID - alert rule ID +// actionID - action ID +// action - the action +func (client AlertRulesClient) CreateOrUpdateAction(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string, actionID string, action ActionRequest) (result ActionResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.CreateOrUpdateAction") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.AlertRulesClient", "CreateOrUpdateAction", err.Error()) + } + + req, err := client.CreateOrUpdateActionPreparer(ctx, resourceGroupName, workspaceName, ruleID, actionID, action) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "CreateOrUpdateAction", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateActionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "CreateOrUpdateAction", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateActionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "CreateOrUpdateAction", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdateActionPreparer prepares the CreateOrUpdateAction request. +func (client AlertRulesClient) CreateOrUpdateActionPreparer(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string, actionID string, action ActionRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionId": autorest.Encode("path", actionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleId": autorest.Encode("path", ruleID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}", pathParameters), + autorest.WithJSON(action), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateActionSender sends the CreateOrUpdateAction request. The method will close the +// http.Response Body if it receives an error. +func (client AlertRulesClient) CreateOrUpdateActionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateActionResponder handles the response to the CreateOrUpdateAction request. The method always +// closes the http.Response Body. +func (client AlertRulesClient) CreateOrUpdateActionResponder(resp *http.Response) (result ActionResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the alert rule. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// workspaceName - the name of the workspace. +// ruleID - alert rule ID +func (client AlertRulesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.AlertRulesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, ruleID) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AlertRulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleId": autorest.Encode("path", ruleID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AlertRulesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AlertRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteAction delete the action of alert rule. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// workspaceName - the name of the workspace. +// ruleID - alert rule ID +// actionID - action ID +func (client AlertRulesClient) DeleteAction(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string, actionID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.DeleteAction") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.AlertRulesClient", "DeleteAction", err.Error()) + } + + req, err := client.DeleteActionPreparer(ctx, resourceGroupName, workspaceName, ruleID, actionID) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "DeleteAction", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteActionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "DeleteAction", resp, "Failure sending request") + return + } + + result, err = client.DeleteActionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "DeleteAction", resp, "Failure responding to request") + } + + return +} + +// DeleteActionPreparer prepares the DeleteAction request. +func (client AlertRulesClient) DeleteActionPreparer(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string, actionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionId": autorest.Encode("path", actionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleId": autorest.Encode("path", ruleID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteActionSender sends the DeleteAction request. The method will close the +// http.Response Body if it receives an error. +func (client AlertRulesClient) DeleteActionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteActionResponder handles the response to the DeleteAction request. The method always +// closes the http.Response Body. +func (client AlertRulesClient) DeleteActionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the alert rule. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// workspaceName - the name of the workspace. +// ruleID - alert rule ID +func (client AlertRulesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string) (result AlertRuleModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.AlertRulesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, ruleID) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AlertRulesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleId": autorest.Encode("path", ruleID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AlertRulesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AlertRulesClient) GetResponder(resp *http.Response) (result AlertRuleModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAction gets the action of alert rule. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// workspaceName - the name of the workspace. +// ruleID - alert rule ID +// actionID - action ID +func (client AlertRulesClient) GetAction(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string, actionID string) (result ActionResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.GetAction") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.AlertRulesClient", "GetAction", err.Error()) + } + + req, err := client.GetActionPreparer(ctx, resourceGroupName, workspaceName, ruleID, actionID) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "GetAction", nil, "Failure preparing request") + return + } + + resp, err := client.GetActionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "GetAction", resp, "Failure sending request") + return + } + + result, err = client.GetActionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "GetAction", resp, "Failure responding to request") + } + + return +} + +// GetActionPreparer prepares the GetAction request. +func (client AlertRulesClient) GetActionPreparer(ctx context.Context, resourceGroupName string, workspaceName string, ruleID string, actionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "actionId": autorest.Encode("path", actionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "ruleId": autorest.Encode("path", ruleID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules/{ruleId}/actions/{actionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetActionSender sends the GetAction request. The method will close the +// http.Response Body if it receives an error. +func (client AlertRulesClient) GetActionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetActionResponder handles the response to the GetAction request. The method always +// closes the http.Response Body. +func (client AlertRulesClient) GetActionResponder(resp *http.Response) (result ActionResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets all alert rules. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// workspaceName - the name of the workspace. +func (client AlertRulesClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result AlertRulesListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.List") + defer func() { + sc := -1 + if result.arl.Response.Response != nil { + sc = result.arl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.AlertRulesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.arl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "List", resp, "Failure sending request") + return + } + + result.arl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AlertRulesClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/alertRules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AlertRulesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AlertRulesClient) ListResponder(resp *http.Response) (result AlertRulesList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AlertRulesClient) listNextResults(ctx context.Context, lastResults AlertRulesList) (result AlertRulesList, err error) { + req, err := lastResults.alertRulesListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.AlertRulesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AlertRulesClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result AlertRulesListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, workspaceName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/client.go new file mode 100644 index 0000000000000..795d10bb88239 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/client.go @@ -0,0 +1,52 @@ +// Package securityinsight implements the Azure ARM Securityinsight service API version 2020-01-01. +// +// API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider +package securityinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Securityinsight + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Securityinsight. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/dataconnectors.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/dataconnectors.go new file mode 100644 index 0000000000000..254c70e6667bd --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/dataconnectors.go @@ -0,0 +1,449 @@ +package securityinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DataConnectorsClient is the API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider +type DataConnectorsClient struct { + BaseClient +} + +// NewDataConnectorsClient creates an instance of the DataConnectorsClient client. +func NewDataConnectorsClient(subscriptionID string) DataConnectorsClient { + return NewDataConnectorsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataConnectorsClientWithBaseURI creates an instance of the DataConnectorsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDataConnectorsClientWithBaseURI(baseURI string, subscriptionID string) DataConnectorsClient { + return DataConnectorsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates the data connector. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// workspaceName - the name of the workspace. +// dataConnectorID - connector ID +// dataConnector - the data connector +func (client DataConnectorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, dataConnectorID string, dataConnector BasicDataConnector) (result DataConnectorModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectorsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.DataConnectorsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, dataConnectorID, dataConnector) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DataConnectorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, dataConnectorID string, dataConnector BasicDataConnector) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataConnectorId": autorest.Encode("path", dataConnectorID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}", pathParameters), + autorest.WithJSON(dataConnector), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DataConnectorsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DataConnectorsClient) CreateOrUpdateResponder(resp *http.Response) (result DataConnectorModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete the data connector. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// workspaceName - the name of the workspace. +// dataConnectorID - connector ID +func (client DataConnectorsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, dataConnectorID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectorsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.DataConnectorsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, dataConnectorID) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DataConnectorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, dataConnectorID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataConnectorId": autorest.Encode("path", dataConnectorID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DataConnectorsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DataConnectorsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a data connector. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// workspaceName - the name of the workspace. +// dataConnectorID - connector ID +func (client DataConnectorsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, dataConnectorID string) (result DataConnectorModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectorsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.DataConnectorsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, dataConnectorID) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DataConnectorsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, dataConnectorID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataConnectorId": autorest.Encode("path", dataConnectorID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors/{dataConnectorId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DataConnectorsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DataConnectorsClient) GetResponder(resp *http.Response) (result DataConnectorModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets all data connectors. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// workspaceName - the name of the workspace. +func (client DataConnectorsClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result DataConnectorListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectorsClient.List") + defer func() { + sc := -1 + if result.dcl.Response.Response != nil { + sc = result.dcl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.DataConnectorsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.dcl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "List", resp, "Failure sending request") + return + } + + result.dcl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DataConnectorsClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/dataConnectors", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DataConnectorsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DataConnectorsClient) ListResponder(resp *http.Response) (result DataConnectorList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client DataConnectorsClient) listNextResults(ctx context.Context, lastResults DataConnectorList) (result DataConnectorList, err error) { + req, err := lastResults.dataConnectorListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.DataConnectorsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DataConnectorsClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result DataConnectorListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectorsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, workspaceName) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/models.go new file mode 100644 index 0000000000000..e1f7a356ed41f --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/models.go @@ -0,0 +1,4450 @@ +package securityinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "github.com/satori/go.uuid" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight" + +// AlertRuleKind enumerates the values for alert rule kind. +type AlertRuleKind string + +const ( + // Fusion ... + Fusion AlertRuleKind = "Fusion" + // MicrosoftSecurityIncidentCreation ... + MicrosoftSecurityIncidentCreation AlertRuleKind = "MicrosoftSecurityIncidentCreation" + // Scheduled ... + Scheduled AlertRuleKind = "Scheduled" +) + +// PossibleAlertRuleKindValues returns an array of possible values for the AlertRuleKind const type. +func PossibleAlertRuleKindValues() []AlertRuleKind { + return []AlertRuleKind{Fusion, MicrosoftSecurityIncidentCreation, Scheduled} +} + +// AlertSeverity enumerates the values for alert severity. +type AlertSeverity string + +const ( + // High High severity + High AlertSeverity = "High" + // Informational Informational severity + Informational AlertSeverity = "Informational" + // Low Low severity + Low AlertSeverity = "Low" + // Medium Medium severity + Medium AlertSeverity = "Medium" +) + +// PossibleAlertSeverityValues returns an array of possible values for the AlertSeverity const type. +func PossibleAlertSeverityValues() []AlertSeverity { + return []AlertSeverity{High, Informational, Low, Medium} +} + +// AttackTactic enumerates the values for attack tactic. +type AttackTactic string + +const ( + // Collection ... + Collection AttackTactic = "Collection" + // CommandAndControl ... + CommandAndControl AttackTactic = "CommandAndControl" + // CredentialAccess ... + CredentialAccess AttackTactic = "CredentialAccess" + // DefenseEvasion ... + DefenseEvasion AttackTactic = "DefenseEvasion" + // Discovery ... + Discovery AttackTactic = "Discovery" + // Execution ... + Execution AttackTactic = "Execution" + // Exfiltration ... + Exfiltration AttackTactic = "Exfiltration" + // Impact ... + Impact AttackTactic = "Impact" + // InitialAccess ... + InitialAccess AttackTactic = "InitialAccess" + // LateralMovement ... + LateralMovement AttackTactic = "LateralMovement" + // Persistence ... + Persistence AttackTactic = "Persistence" + // PrivilegeEscalation ... + PrivilegeEscalation AttackTactic = "PrivilegeEscalation" +) + +// PossibleAttackTacticValues returns an array of possible values for the AttackTactic const type. +func PossibleAttackTacticValues() []AttackTactic { + return []AttackTactic{Collection, CommandAndControl, CredentialAccess, DefenseEvasion, Discovery, Execution, Exfiltration, Impact, InitialAccess, LateralMovement, Persistence, PrivilegeEscalation} +} + +// DataConnectorKind enumerates the values for data connector kind. +type DataConnectorKind string + +const ( + // DataConnectorKindAmazonWebServicesCloudTrail ... + DataConnectorKindAmazonWebServicesCloudTrail DataConnectorKind = "AmazonWebServicesCloudTrail" + // DataConnectorKindAzureActiveDirectory ... + DataConnectorKindAzureActiveDirectory DataConnectorKind = "AzureActiveDirectory" + // DataConnectorKindAzureAdvancedThreatProtection ... + DataConnectorKindAzureAdvancedThreatProtection DataConnectorKind = "AzureAdvancedThreatProtection" + // DataConnectorKindAzureSecurityCenter ... + DataConnectorKindAzureSecurityCenter DataConnectorKind = "AzureSecurityCenter" + // DataConnectorKindMicrosoftCloudAppSecurity ... + DataConnectorKindMicrosoftCloudAppSecurity DataConnectorKind = "MicrosoftCloudAppSecurity" + // DataConnectorKindMicrosoftDefenderAdvancedThreatProtection ... + DataConnectorKindMicrosoftDefenderAdvancedThreatProtection DataConnectorKind = "MicrosoftDefenderAdvancedThreatProtection" + // DataConnectorKindOffice365 ... + DataConnectorKindOffice365 DataConnectorKind = "Office365" + // DataConnectorKindThreatIntelligence ... + DataConnectorKindThreatIntelligence DataConnectorKind = "ThreatIntelligence" +) + +// PossibleDataConnectorKindValues returns an array of possible values for the DataConnectorKind const type. +func PossibleDataConnectorKindValues() []DataConnectorKind { + return []DataConnectorKind{DataConnectorKindAmazonWebServicesCloudTrail, DataConnectorKindAzureActiveDirectory, DataConnectorKindAzureAdvancedThreatProtection, DataConnectorKindAzureSecurityCenter, DataConnectorKindMicrosoftCloudAppSecurity, DataConnectorKindMicrosoftDefenderAdvancedThreatProtection, DataConnectorKindOffice365, DataConnectorKindThreatIntelligence} +} + +// DataTypeState enumerates the values for data type state. +type DataTypeState string + +const ( + // Disabled ... + Disabled DataTypeState = "Disabled" + // Enabled ... + Enabled DataTypeState = "Enabled" +) + +// PossibleDataTypeStateValues returns an array of possible values for the DataTypeState const type. +func PossibleDataTypeStateValues() []DataTypeState { + return []DataTypeState{Disabled, Enabled} +} + +// IncidentSeverity enumerates the values for incident severity. +type IncidentSeverity string + +const ( + // IncidentSeverityCritical Critical severity + IncidentSeverityCritical IncidentSeverity = "Critical" + // IncidentSeverityHigh High severity + IncidentSeverityHigh IncidentSeverity = "High" + // IncidentSeverityInformational Informational severity + IncidentSeverityInformational IncidentSeverity = "Informational" + // IncidentSeverityLow Low severity + IncidentSeverityLow IncidentSeverity = "Low" + // IncidentSeverityMedium Medium severity + IncidentSeverityMedium IncidentSeverity = "Medium" +) + +// PossibleIncidentSeverityValues returns an array of possible values for the IncidentSeverity const type. +func PossibleIncidentSeverityValues() []IncidentSeverity { + return []IncidentSeverity{IncidentSeverityCritical, IncidentSeverityHigh, IncidentSeverityInformational, IncidentSeverityLow, IncidentSeverityMedium} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindAlertRule ... + KindAlertRule Kind = "AlertRule" + // KindFusion ... + KindFusion Kind = "Fusion" + // KindMicrosoftSecurityIncidentCreation ... + KindMicrosoftSecurityIncidentCreation Kind = "MicrosoftSecurityIncidentCreation" + // KindScheduled ... + KindScheduled Kind = "Scheduled" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindAlertRule, KindFusion, KindMicrosoftSecurityIncidentCreation, KindScheduled} +} + +// KindBasicAlertRuleTemplate enumerates the values for kind basic alert rule template. +type KindBasicAlertRuleTemplate string + +const ( + // KindBasicAlertRuleTemplateKindAlertRuleTemplate ... + KindBasicAlertRuleTemplateKindAlertRuleTemplate KindBasicAlertRuleTemplate = "AlertRuleTemplate" + // KindBasicAlertRuleTemplateKindFusion ... + KindBasicAlertRuleTemplateKindFusion KindBasicAlertRuleTemplate = "Fusion" + // KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation ... + KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation KindBasicAlertRuleTemplate = "MicrosoftSecurityIncidentCreation" + // KindBasicAlertRuleTemplateKindScheduled ... + KindBasicAlertRuleTemplateKindScheduled KindBasicAlertRuleTemplate = "Scheduled" +) + +// PossibleKindBasicAlertRuleTemplateValues returns an array of possible values for the KindBasicAlertRuleTemplate const type. +func PossibleKindBasicAlertRuleTemplateValues() []KindBasicAlertRuleTemplate { + return []KindBasicAlertRuleTemplate{KindBasicAlertRuleTemplateKindAlertRuleTemplate, KindBasicAlertRuleTemplateKindFusion, KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation, KindBasicAlertRuleTemplateKindScheduled} +} + +// KindBasicDataConnector enumerates the values for kind basic data connector. +type KindBasicDataConnector string + +const ( + // KindAmazonWebServicesCloudTrail ... + KindAmazonWebServicesCloudTrail KindBasicDataConnector = "AmazonWebServicesCloudTrail" + // KindAzureActiveDirectory ... + KindAzureActiveDirectory KindBasicDataConnector = "AzureActiveDirectory" + // KindAzureAdvancedThreatProtection ... + KindAzureAdvancedThreatProtection KindBasicDataConnector = "AzureAdvancedThreatProtection" + // KindAzureSecurityCenter ... + KindAzureSecurityCenter KindBasicDataConnector = "AzureSecurityCenter" + // KindDataConnector ... + KindDataConnector KindBasicDataConnector = "DataConnector" + // KindMicrosoftCloudAppSecurity ... + KindMicrosoftCloudAppSecurity KindBasicDataConnector = "MicrosoftCloudAppSecurity" + // KindMicrosoftDefenderAdvancedThreatProtection ... + KindMicrosoftDefenderAdvancedThreatProtection KindBasicDataConnector = "MicrosoftDefenderAdvancedThreatProtection" + // KindOffice365 ... + KindOffice365 KindBasicDataConnector = "Office365" + // KindThreatIntelligence ... + KindThreatIntelligence KindBasicDataConnector = "ThreatIntelligence" +) + +// PossibleKindBasicDataConnectorValues returns an array of possible values for the KindBasicDataConnector const type. +func PossibleKindBasicDataConnectorValues() []KindBasicDataConnector { + return []KindBasicDataConnector{KindAmazonWebServicesCloudTrail, KindAzureActiveDirectory, KindAzureAdvancedThreatProtection, KindAzureSecurityCenter, KindDataConnector, KindMicrosoftCloudAppSecurity, KindMicrosoftDefenderAdvancedThreatProtection, KindOffice365, KindThreatIntelligence} +} + +// KindBasicSettings enumerates the values for kind basic settings. +type KindBasicSettings string + +const ( + // KindSettings ... + KindSettings KindBasicSettings = "Settings" + // KindToggleSettings ... + KindToggleSettings KindBasicSettings = "ToggleSettings" + // KindUebaSettings ... + KindUebaSettings KindBasicSettings = "UebaSettings" +) + +// PossibleKindBasicSettingsValues returns an array of possible values for the KindBasicSettings const type. +func PossibleKindBasicSettingsValues() []KindBasicSettings { + return []KindBasicSettings{KindSettings, KindToggleSettings, KindUebaSettings} +} + +// LicenseStatus enumerates the values for license status. +type LicenseStatus string + +const ( + // LicenseStatusDisabled ... + LicenseStatusDisabled LicenseStatus = "Disabled" + // LicenseStatusEnabled ... + LicenseStatusEnabled LicenseStatus = "Enabled" +) + +// PossibleLicenseStatusValues returns an array of possible values for the LicenseStatus const type. +func PossibleLicenseStatusValues() []LicenseStatus { + return []LicenseStatus{LicenseStatusDisabled, LicenseStatusEnabled} +} + +// MicrosoftSecurityProductName enumerates the values for microsoft security product name. +type MicrosoftSecurityProductName string + +const ( + // AzureActiveDirectoryIdentityProtection ... + AzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = "Azure Active Directory Identity Protection" + // AzureAdvancedThreatProtection ... + AzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection" + // AzureSecurityCenter ... + AzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center" + // AzureSecurityCenterforIoT ... + AzureSecurityCenterforIoT MicrosoftSecurityProductName = "Azure Security Center for IoT" + // MicrosoftCloudAppSecurity ... + MicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security" +) + +// PossibleMicrosoftSecurityProductNameValues returns an array of possible values for the MicrosoftSecurityProductName const type. +func PossibleMicrosoftSecurityProductNameValues() []MicrosoftSecurityProductName { + return []MicrosoftSecurityProductName{AzureActiveDirectoryIdentityProtection, AzureAdvancedThreatProtection, AzureSecurityCenter, AzureSecurityCenterforIoT, MicrosoftCloudAppSecurity} +} + +// SettingKind enumerates the values for setting kind. +type SettingKind string + +const ( + // SettingKindToggleSettings ... + SettingKindToggleSettings SettingKind = "ToggleSettings" + // SettingKindUebaSettings ... + SettingKindUebaSettings SettingKind = "UebaSettings" +) + +// PossibleSettingKindValues returns an array of possible values for the SettingKind const type. +func PossibleSettingKindValues() []SettingKind { + return []SettingKind{SettingKindToggleSettings, SettingKindUebaSettings} +} + +// StatusInMcas enumerates the values for status in mcas. +type StatusInMcas string + +const ( + // StatusInMcasDisabled ... + StatusInMcasDisabled StatusInMcas = "Disabled" + // StatusInMcasEnabled ... + StatusInMcasEnabled StatusInMcas = "Enabled" +) + +// PossibleStatusInMcasValues returns an array of possible values for the StatusInMcas const type. +func PossibleStatusInMcasValues() []StatusInMcas { + return []StatusInMcas{StatusInMcasDisabled, StatusInMcasEnabled} +} + +// TemplateStatus enumerates the values for template status. +type TemplateStatus string + +const ( + // Available Alert rule template is available. + Available TemplateStatus = "Available" + // Installed Alert rule template installed. and can not use more then once + Installed TemplateStatus = "Installed" + // NotAvailable Alert rule template is not available + NotAvailable TemplateStatus = "NotAvailable" +) + +// PossibleTemplateStatusValues returns an array of possible values for the TemplateStatus const type. +func PossibleTemplateStatusValues() []TemplateStatus { + return []TemplateStatus{Available, Installed, NotAvailable} +} + +// TriggerOperator enumerates the values for trigger operator. +type TriggerOperator string + +const ( + // Equal ... + Equal TriggerOperator = "Equal" + // GreaterThan ... + GreaterThan TriggerOperator = "GreaterThan" + // LessThan ... + LessThan TriggerOperator = "LessThan" + // NotEqual ... + NotEqual TriggerOperator = "NotEqual" +) + +// PossibleTriggerOperatorValues returns an array of possible values for the TriggerOperator const type. +func PossibleTriggerOperatorValues() []TriggerOperator { + return []TriggerOperator{Equal, GreaterThan, LessThan, NotEqual} +} + +// AADDataConnector represents AAD (Azure Active Directory) data connector. +type AADDataConnector struct { + // AADDataConnectorProperties - AAD (Azure Active Directory) data connector properties. + *AADDataConnectorProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' + Kind KindBasicDataConnector `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for AADDataConnector. +func (adc AADDataConnector) MarshalJSON() ([]byte, error) { + adc.Kind = KindAzureActiveDirectory + objectMap := make(map[string]interface{}) + if adc.AADDataConnectorProperties != nil { + objectMap["properties"] = adc.AADDataConnectorProperties + } + if adc.Etag != nil { + objectMap["etag"] = adc.Etag + } + if adc.Kind != "" { + objectMap["kind"] = adc.Kind + } + return json.Marshal(objectMap) +} + +// AsAADDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { + return &adc, true +} + +// AsAATPDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { + return nil, false +} + +// AsASCDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { + return nil, false +} + +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { + return nil, false +} + +// AsMCASDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { + return nil, false +} + +// AsMDATPDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { + return nil, false +} + +// AsOfficeDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { + return nil, false +} + +// AsTIDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { + return nil, false +} + +// AsDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsDataConnector() (*DataConnector, bool) { + return nil, false +} + +// AsBasicDataConnector is the BasicDataConnector implementation for AADDataConnector. +func (adc AADDataConnector) AsBasicDataConnector() (BasicDataConnector, bool) { + return &adc, true +} + +// UnmarshalJSON is the custom unmarshaler for AADDataConnector struct. +func (adc *AADDataConnector) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var aADDataConnectorProperties AADDataConnectorProperties + err = json.Unmarshal(*v, &aADDataConnectorProperties) + if err != nil { + return err + } + adc.AADDataConnectorProperties = &aADDataConnectorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + adc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + adc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + adc.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + adc.Etag = &etag + } + case "kind": + if v != nil { + var kind KindBasicDataConnector + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + adc.Kind = kind + } + } + } + + return nil +} + +// AADDataConnectorProperties AAD (Azure Active Directory) data connector properties. +type AADDataConnectorProperties struct { + // TenantID - The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` + // DataTypes - The available data types for the connector. + DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` +} + +// AATPDataConnector represents AATP (Azure Advanced Threat Protection) data connector. +type AATPDataConnector struct { + // AATPDataConnectorProperties - AATP (Azure Advanced Threat Protection) data connector properties. + *AATPDataConnectorProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' + Kind KindBasicDataConnector `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for AATPDataConnector. +func (adc AATPDataConnector) MarshalJSON() ([]byte, error) { + adc.Kind = KindAzureAdvancedThreatProtection + objectMap := make(map[string]interface{}) + if adc.AATPDataConnectorProperties != nil { + objectMap["properties"] = adc.AATPDataConnectorProperties + } + if adc.Etag != nil { + objectMap["etag"] = adc.Etag + } + if adc.Kind != "" { + objectMap["kind"] = adc.Kind + } + return json.Marshal(objectMap) +} + +// AsAADDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { + return nil, false +} + +// AsAATPDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { + return &adc, true +} + +// AsASCDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { + return nil, false +} + +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { + return nil, false +} + +// AsMCASDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { + return nil, false +} + +// AsMDATPDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { + return nil, false +} + +// AsOfficeDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { + return nil, false +} + +// AsTIDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { + return nil, false +} + +// AsDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsDataConnector() (*DataConnector, bool) { + return nil, false +} + +// AsBasicDataConnector is the BasicDataConnector implementation for AATPDataConnector. +func (adc AATPDataConnector) AsBasicDataConnector() (BasicDataConnector, bool) { + return &adc, true +} + +// UnmarshalJSON is the custom unmarshaler for AATPDataConnector struct. +func (adc *AATPDataConnector) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var aATPDataConnectorProperties AATPDataConnectorProperties + err = json.Unmarshal(*v, &aATPDataConnectorProperties) + if err != nil { + return err + } + adc.AATPDataConnectorProperties = &aATPDataConnectorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + adc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + adc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + adc.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + adc.Etag = &etag + } + case "kind": + if v != nil { + var kind KindBasicDataConnector + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + adc.Kind = kind + } + } + } + + return nil +} + +// AATPDataConnectorProperties AATP (Azure Advanced Threat Protection) data connector properties. +type AATPDataConnectorProperties struct { + // TenantID - The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` + // DataTypes - The available data types for the connector. + DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` +} + +// ActionPropertiesBase action property bag base. +type ActionPropertiesBase struct { + // LogicAppResourceID - Logic App Resource Id, providers/Microsoft.Logic/workflows/{WorkflowID}. + LogicAppResourceID *string `json:"logicAppResourceId,omitempty"` +} + +// ActionRequest action for alert rule. +type ActionRequest struct { + // ActionRequestProperties - Action properties for put request + *ActionRequestProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for ActionRequest. +func (ar ActionRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ar.ActionRequestProperties != nil { + objectMap["properties"] = ar.ActionRequestProperties + } + if ar.Etag != nil { + objectMap["etag"] = ar.Etag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ActionRequest struct. +func (ar *ActionRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var actionRequestProperties ActionRequestProperties + err = json.Unmarshal(*v, &actionRequestProperties) + if err != nil { + return err + } + ar.ActionRequestProperties = &actionRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ar.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + ar.Etag = &etag + } + } + } + + return nil +} + +// ActionRequestProperties action property bag. +type ActionRequestProperties struct { + // TriggerURI - Logic App Callback URL for this specific workflow. + TriggerURI *string `json:"triggerUri,omitempty"` + // LogicAppResourceID - Logic App Resource Id, providers/Microsoft.Logic/workflows/{WorkflowID}. + LogicAppResourceID *string `json:"logicAppResourceId,omitempty"` +} + +// ActionResponse action for alert rule. +type ActionResponse struct { + autorest.Response `json:"-"` + // Etag - Etag of the action. + Etag *string `json:"etag,omitempty"` + // ActionResponseProperties - Action properties for get request + *ActionResponseProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ActionResponse. +func (ar ActionResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ar.Etag != nil { + objectMap["etag"] = ar.Etag + } + if ar.ActionResponseProperties != nil { + objectMap["properties"] = ar.ActionResponseProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ActionResponse struct. +func (ar *ActionResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + ar.Etag = &etag + } + case "properties": + if v != nil { + var actionResponseProperties ActionResponseProperties + err = json.Unmarshal(*v, &actionResponseProperties) + if err != nil { + return err + } + ar.ActionResponseProperties = &actionResponseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ar.Type = &typeVar + } + } + } + + return nil +} + +// ActionResponseProperties action property bag. +type ActionResponseProperties struct { + // WorkflowID - The name of the logic app's workflow. + WorkflowID *string `json:"workflowId,omitempty"` + // LogicAppResourceID - Logic App Resource Id, providers/Microsoft.Logic/workflows/{WorkflowID}. + LogicAppResourceID *string `json:"logicAppResourceId,omitempty"` +} + +// ActionsList list all the actions. +type ActionsList struct { + autorest.Response `json:"-"` + // NextLink - READ-ONLY; URL to fetch the next set of actions. + NextLink *string `json:"nextLink,omitempty"` + // Value - Array of actions. + Value *[]ActionResponse `json:"value,omitempty"` +} + +// ActionsListIterator provides access to a complete listing of ActionResponse values. +type ActionsListIterator struct { + i int + page ActionsListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ActionsListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ActionsListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ActionsListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ActionsListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ActionsListIterator) Response() ActionsList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ActionsListIterator) Value() ActionResponse { + if !iter.page.NotDone() { + return ActionResponse{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ActionsListIterator type. +func NewActionsListIterator(page ActionsListPage) ActionsListIterator { + return ActionsListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al ActionsList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// actionsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al ActionsList) actionsListPreparer(ctx context.Context) (*http.Request, error) { + if al.NextLink == nil || len(to.String(al.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(al.NextLink))) +} + +// ActionsListPage contains a page of ActionResponse values. +type ActionsListPage struct { + fn func(context.Context, ActionsList) (ActionsList, error) + al ActionsList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ActionsListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ActionsListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.al) + if err != nil { + return err + } + page.al = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ActionsListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ActionsListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ActionsListPage) Response() ActionsList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ActionsListPage) Values() []ActionResponse { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the ActionsListPage type. +func NewActionsListPage(getNextPage func(context.Context, ActionsList) (ActionsList, error)) ActionsListPage { + return ActionsListPage{fn: getNextPage} +} + +// BasicAlertRule alert rule. +type BasicAlertRule interface { + AsFusionAlertRule() (*FusionAlertRule, bool) + AsMicrosoftSecurityIncidentCreationAlertRule() (*MicrosoftSecurityIncidentCreationAlertRule, bool) + AsScheduledAlertRule() (*ScheduledAlertRule, bool) + AsAlertRule() (*AlertRule, bool) +} + +// AlertRule alert rule. +type AlertRule struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindAlertRule', 'KindFusion', 'KindMicrosoftSecurityIncidentCreation', 'KindScheduled' + Kind Kind `json:"kind,omitempty"` +} + +func unmarshalBasicAlertRule(body []byte) (BasicAlertRule, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindFusion): + var far FusionAlertRule + err := json.Unmarshal(body, &far) + return far, err + case string(KindMicrosoftSecurityIncidentCreation): + var msicar MicrosoftSecurityIncidentCreationAlertRule + err := json.Unmarshal(body, &msicar) + return msicar, err + case string(KindScheduled): + var sar ScheduledAlertRule + err := json.Unmarshal(body, &sar) + return sar, err + default: + var ar AlertRule + err := json.Unmarshal(body, &ar) + return ar, err + } +} +func unmarshalBasicAlertRuleArray(body []byte) ([]BasicAlertRule, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + arArray := make([]BasicAlertRule, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ar, err := unmarshalBasicAlertRule(*rawMessage) + if err != nil { + return nil, err + } + arArray[index] = ar + } + return arArray, nil +} + +// MarshalJSON is the custom marshaler for AlertRule. +func (ar AlertRule) MarshalJSON() ([]byte, error) { + ar.Kind = KindAlertRule + objectMap := make(map[string]interface{}) + if ar.Etag != nil { + objectMap["etag"] = ar.Etag + } + if ar.Kind != "" { + objectMap["kind"] = ar.Kind + } + return json.Marshal(objectMap) +} + +// AsFusionAlertRule is the BasicAlertRule implementation for AlertRule. +func (ar AlertRule) AsFusionAlertRule() (*FusionAlertRule, bool) { + return nil, false +} + +// AsMicrosoftSecurityIncidentCreationAlertRule is the BasicAlertRule implementation for AlertRule. +func (ar AlertRule) AsMicrosoftSecurityIncidentCreationAlertRule() (*MicrosoftSecurityIncidentCreationAlertRule, bool) { + return nil, false +} + +// AsScheduledAlertRule is the BasicAlertRule implementation for AlertRule. +func (ar AlertRule) AsScheduledAlertRule() (*ScheduledAlertRule, bool) { + return nil, false +} + +// AsAlertRule is the BasicAlertRule implementation for AlertRule. +func (ar AlertRule) AsAlertRule() (*AlertRule, bool) { + return &ar, true +} + +// AsBasicAlertRule is the BasicAlertRule implementation for AlertRule. +func (ar AlertRule) AsBasicAlertRule() (BasicAlertRule, bool) { + return &ar, true +} + +// AlertRuleKind1 describes an Azure resource with kind. +type AlertRuleKind1 struct { + // Kind - The kind of the alert rule. Possible values include: 'Scheduled', 'MicrosoftSecurityIncidentCreation', 'Fusion' + Kind AlertRuleKind `json:"kind,omitempty"` +} + +// AlertRuleModel ... +type AlertRuleModel struct { + autorest.Response `json:"-"` + Value BasicAlertRule `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AlertRuleModel struct. +func (arm *AlertRuleModel) UnmarshalJSON(body []byte) error { + ar, err := unmarshalBasicAlertRule(body) + if err != nil { + return err + } + arm.Value = ar + + return nil +} + +// AlertRulesList list all the alert rules. +type AlertRulesList struct { + autorest.Response `json:"-"` + // NextLink - READ-ONLY; URL to fetch the next set of alert rules. + NextLink *string `json:"nextLink,omitempty"` + // Value - Array of alert rules. + Value *[]BasicAlertRule `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for AlertRulesList struct. +func (arl *AlertRulesList) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + arl.NextLink = &nextLink + } + case "value": + if v != nil { + value, err := unmarshalBasicAlertRuleArray(*v) + if err != nil { + return err + } + arl.Value = &value + } + } + } + + return nil +} + +// AlertRulesListIterator provides access to a complete listing of AlertRule values. +type AlertRulesListIterator struct { + i int + page AlertRulesListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AlertRulesListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AlertRulesListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertRulesListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AlertRulesListIterator) Response() AlertRulesList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AlertRulesListIterator) Value() BasicAlertRule { + if !iter.page.NotDone() { + return AlertRule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertRulesListIterator type. +func NewAlertRulesListIterator(page AlertRulesListPage) AlertRulesListIterator { + return AlertRulesListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (arl AlertRulesList) IsEmpty() bool { + return arl.Value == nil || len(*arl.Value) == 0 +} + +// alertRulesListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (arl AlertRulesList) alertRulesListPreparer(ctx context.Context) (*http.Request, error) { + if arl.NextLink == nil || len(to.String(arl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(arl.NextLink))) +} + +// AlertRulesListPage contains a page of BasicAlertRule values. +type AlertRulesListPage struct { + fn func(context.Context, AlertRulesList) (AlertRulesList, error) + arl AlertRulesList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AlertRulesListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertRulesListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.arl) + if err != nil { + return err + } + page.arl = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AlertRulesListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertRulesListPage) NotDone() bool { + return !page.arl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertRulesListPage) Response() AlertRulesList { + return page.arl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertRulesListPage) Values() []BasicAlertRule { + if page.arl.IsEmpty() { + return nil + } + return *page.arl.Value +} + +// Creates a new instance of the AlertRulesListPage type. +func NewAlertRulesListPage(getNextPage func(context.Context, AlertRulesList) (AlertRulesList, error)) AlertRulesListPage { + return AlertRulesListPage{fn: getNextPage} +} + +// BasicAlertRuleTemplate alert rule template. +type BasicAlertRuleTemplate interface { + AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) + AsMicrosoftSecurityIncidentCreationAlertRuleTemplate() (*MicrosoftSecurityIncidentCreationAlertRuleTemplate, bool) + AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) + AsAlertRuleTemplate() (*AlertRuleTemplate, bool) +} + +// AlertRuleTemplate alert rule template. +type AlertRuleTemplate struct { + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindBasicAlertRuleTemplateKindAlertRuleTemplate', 'KindBasicAlertRuleTemplateKindFusion', 'KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation', 'KindBasicAlertRuleTemplateKindScheduled' + Kind KindBasicAlertRuleTemplate `json:"kind,omitempty"` +} + +func unmarshalBasicAlertRuleTemplate(body []byte) (BasicAlertRuleTemplate, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindBasicAlertRuleTemplateKindFusion): + var fart FusionAlertRuleTemplate + err := json.Unmarshal(body, &fart) + return fart, err + case string(KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation): + var msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate + err := json.Unmarshal(body, &msicart) + return msicart, err + case string(KindBasicAlertRuleTemplateKindScheduled): + var sart ScheduledAlertRuleTemplate + err := json.Unmarshal(body, &sart) + return sart, err + default: + var art AlertRuleTemplate + err := json.Unmarshal(body, &art) + return art, err + } +} +func unmarshalBasicAlertRuleTemplateArray(body []byte) ([]BasicAlertRuleTemplate, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + artArray := make([]BasicAlertRuleTemplate, len(rawMessages)) + + for index, rawMessage := range rawMessages { + art, err := unmarshalBasicAlertRuleTemplate(*rawMessage) + if err != nil { + return nil, err + } + artArray[index] = art + } + return artArray, nil +} + +// MarshalJSON is the custom marshaler for AlertRuleTemplate. +func (art AlertRuleTemplate) MarshalJSON() ([]byte, error) { + art.Kind = KindBasicAlertRuleTemplateKindAlertRuleTemplate + objectMap := make(map[string]interface{}) + if art.Kind != "" { + objectMap["kind"] = art.Kind + } + return json.Marshal(objectMap) +} + +// AsFusionAlertRuleTemplate is the BasicAlertRuleTemplate implementation for AlertRuleTemplate. +func (art AlertRuleTemplate) AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) { + return nil, false +} + +// AsMicrosoftSecurityIncidentCreationAlertRuleTemplate is the BasicAlertRuleTemplate implementation for AlertRuleTemplate. +func (art AlertRuleTemplate) AsMicrosoftSecurityIncidentCreationAlertRuleTemplate() (*MicrosoftSecurityIncidentCreationAlertRuleTemplate, bool) { + return nil, false +} + +// AsScheduledAlertRuleTemplate is the BasicAlertRuleTemplate implementation for AlertRuleTemplate. +func (art AlertRuleTemplate) AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) { + return nil, false +} + +// AsAlertRuleTemplate is the BasicAlertRuleTemplate implementation for AlertRuleTemplate. +func (art AlertRuleTemplate) AsAlertRuleTemplate() (*AlertRuleTemplate, bool) { + return &art, true +} + +// AsBasicAlertRuleTemplate is the BasicAlertRuleTemplate implementation for AlertRuleTemplate. +func (art AlertRuleTemplate) AsBasicAlertRuleTemplate() (BasicAlertRuleTemplate, bool) { + return &art, true +} + +// AlertRuleTemplateDataSource alert rule template data sources +type AlertRuleTemplateDataSource struct { + // ConnectorID - The connector id that provides the following data types + ConnectorID *string `json:"connectorId,omitempty"` + // DataTypes - The data types used by the alert rule template + DataTypes *[]string `json:"dataTypes,omitempty"` +} + +// AlertRuleTemplatePropertiesBase base alert rule template property bag. +type AlertRuleTemplatePropertiesBase struct { + // AlertRulesCreatedByTemplateCount - the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + // CreatedDateUTC - READ-ONLY; The time that this alert rule template has been added. + CreatedDateUTC *date.Time `json:"createdDateUTC,omitempty"` + // Description - The description of the alert rule template. + Description *string `json:"description,omitempty"` + // DisplayName - The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` + // RequiredDataConnectors - The required data connectors for this template + RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + // Status - The alert rule template status. Possible values include: 'Installed', 'Available', 'NotAvailable' + Status TemplateStatus `json:"status,omitempty"` +} + +// AlertsDataTypeOfDataConnector alerts data type for data connectors. +type AlertsDataTypeOfDataConnector struct { + // Alerts - Alerts data type connection. + Alerts *AlertsDataTypeOfDataConnectorAlerts `json:"alerts,omitempty"` +} + +// AlertsDataTypeOfDataConnectorAlerts alerts data type connection. +type AlertsDataTypeOfDataConnectorAlerts struct { + // State - Describe whether this data type connection is enabled or not. Possible values include: 'Enabled', 'Disabled' + State DataTypeState `json:"state,omitempty"` +} + +// ASCDataConnector represents ASC (Azure Security Center) data connector. +type ASCDataConnector struct { + // ASCDataConnectorProperties - ASC (Azure Security Center) data connector properties. + *ASCDataConnectorProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' + Kind KindBasicDataConnector `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ASCDataConnector. +func (adc ASCDataConnector) MarshalJSON() ([]byte, error) { + adc.Kind = KindAzureSecurityCenter + objectMap := make(map[string]interface{}) + if adc.ASCDataConnectorProperties != nil { + objectMap["properties"] = adc.ASCDataConnectorProperties + } + if adc.Etag != nil { + objectMap["etag"] = adc.Etag + } + if adc.Kind != "" { + objectMap["kind"] = adc.Kind + } + return json.Marshal(objectMap) +} + +// AsAADDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { + return nil, false +} + +// AsAATPDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { + return nil, false +} + +// AsASCDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { + return &adc, true +} + +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { + return nil, false +} + +// AsMCASDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { + return nil, false +} + +// AsMDATPDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { + return nil, false +} + +// AsOfficeDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { + return nil, false +} + +// AsTIDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { + return nil, false +} + +// AsDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsDataConnector() (*DataConnector, bool) { + return nil, false +} + +// AsBasicDataConnector is the BasicDataConnector implementation for ASCDataConnector. +func (adc ASCDataConnector) AsBasicDataConnector() (BasicDataConnector, bool) { + return &adc, true +} + +// UnmarshalJSON is the custom unmarshaler for ASCDataConnector struct. +func (adc *ASCDataConnector) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var aSCDataConnectorProperties ASCDataConnectorProperties + err = json.Unmarshal(*v, &aSCDataConnectorProperties) + if err != nil { + return err + } + adc.ASCDataConnectorProperties = &aSCDataConnectorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + adc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + adc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + adc.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + adc.Etag = &etag + } + case "kind": + if v != nil { + var kind KindBasicDataConnector + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + adc.Kind = kind + } + } + } + + return nil +} + +// ASCDataConnectorProperties ASC (Azure Security Center) data connector properties. +type ASCDataConnectorProperties struct { + // SubscriptionID - The subscription id to connect to, and get the data from. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // DataTypes - The available data types for the connector. + DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` +} + +// AwsCloudTrailDataConnector represents Amazon Web Services CloudTrail data connector. +type AwsCloudTrailDataConnector struct { + // AwsCloudTrailDataConnectorProperties - Amazon Web Services CloudTrail data connector properties. + *AwsCloudTrailDataConnectorProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' + Kind KindBasicDataConnector `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) MarshalJSON() ([]byte, error) { + actdc.Kind = KindAmazonWebServicesCloudTrail + objectMap := make(map[string]interface{}) + if actdc.AwsCloudTrailDataConnectorProperties != nil { + objectMap["properties"] = actdc.AwsCloudTrailDataConnectorProperties + } + if actdc.Etag != nil { + objectMap["etag"] = actdc.Etag + } + if actdc.Kind != "" { + objectMap["kind"] = actdc.Kind + } + return json.Marshal(objectMap) +} + +// AsAADDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { + return nil, false +} + +// AsAATPDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { + return nil, false +} + +// AsASCDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { + return nil, false +} + +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { + return &actdc, true +} + +// AsMCASDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { + return nil, false +} + +// AsMDATPDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { + return nil, false +} + +// AsOfficeDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { + return nil, false +} + +// AsTIDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { + return nil, false +} + +// AsDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsDataConnector() (*DataConnector, bool) { + return nil, false +} + +// AsBasicDataConnector is the BasicDataConnector implementation for AwsCloudTrailDataConnector. +func (actdc AwsCloudTrailDataConnector) AsBasicDataConnector() (BasicDataConnector, bool) { + return &actdc, true +} + +// UnmarshalJSON is the custom unmarshaler for AwsCloudTrailDataConnector struct. +func (actdc *AwsCloudTrailDataConnector) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var awsCloudTrailDataConnectorProperties AwsCloudTrailDataConnectorProperties + err = json.Unmarshal(*v, &awsCloudTrailDataConnectorProperties) + if err != nil { + return err + } + actdc.AwsCloudTrailDataConnectorProperties = &awsCloudTrailDataConnectorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + actdc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + actdc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + actdc.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + actdc.Etag = &etag + } + case "kind": + if v != nil { + var kind KindBasicDataConnector + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + actdc.Kind = kind + } + } + } + + return nil +} + +// AwsCloudTrailDataConnectorDataTypes the available data types for Amazon Web Services CloudTrail data +// connector. +type AwsCloudTrailDataConnectorDataTypes struct { + // Logs - Logs data type. + Logs *AwsCloudTrailDataConnectorDataTypesLogs `json:"logs,omitempty"` +} + +// AwsCloudTrailDataConnectorDataTypesLogs logs data type. +type AwsCloudTrailDataConnectorDataTypesLogs struct { + // State - Describe whether this data type connection is enabled or not. Possible values include: 'Enabled', 'Disabled' + State DataTypeState `json:"state,omitempty"` +} + +// AwsCloudTrailDataConnectorProperties amazon Web Services CloudTrail data connector properties. +type AwsCloudTrailDataConnectorProperties struct { + // AwsRoleArn - The Aws Role Arn (with CloudTrailReadOnly policy) that is used to access the Aws account. + AwsRoleArn *string `json:"awsRoleArn,omitempty"` + // DataTypes - The available data types for the connector. + DataTypes *AwsCloudTrailDataConnectorDataTypes `json:"dataTypes,omitempty"` +} + +// CloudError error response structure. +type CloudError struct { + // CloudErrorBody - Error data + *CloudErrorBody `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloudError. +func (ce CloudError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ce.CloudErrorBody != nil { + objectMap["error"] = ce.CloudErrorBody + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CloudError struct. +func (ce *CloudError) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "error": + if v != nil { + var cloudErrorBody CloudErrorBody + err = json.Unmarshal(*v, &cloudErrorBody) + if err != nil { + return err + } + ce.CloudErrorBody = &cloudErrorBody + } + } + } + + return nil +} + +// CloudErrorBody error details. +type CloudErrorBody struct { + // Code - READ-ONLY; An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` +} + +// BasicDataConnector data connector. +type BasicDataConnector interface { + AsAADDataConnector() (*AADDataConnector, bool) + AsAATPDataConnector() (*AATPDataConnector, bool) + AsASCDataConnector() (*ASCDataConnector, bool) + AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) + AsMCASDataConnector() (*MCASDataConnector, bool) + AsMDATPDataConnector() (*MDATPDataConnector, bool) + AsOfficeDataConnector() (*OfficeDataConnector, bool) + AsTIDataConnector() (*TIDataConnector, bool) + AsDataConnector() (*DataConnector, bool) +} + +// DataConnector data connector. +type DataConnector struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' + Kind KindBasicDataConnector `json:"kind,omitempty"` +} + +func unmarshalBasicDataConnector(body []byte) (BasicDataConnector, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindAzureActiveDirectory): + var adc AADDataConnector + err := json.Unmarshal(body, &adc) + return adc, err + case string(KindAzureAdvancedThreatProtection): + var adc AATPDataConnector + err := json.Unmarshal(body, &adc) + return adc, err + case string(KindAzureSecurityCenter): + var adc ASCDataConnector + err := json.Unmarshal(body, &adc) + return adc, err + case string(KindAmazonWebServicesCloudTrail): + var actdc AwsCloudTrailDataConnector + err := json.Unmarshal(body, &actdc) + return actdc, err + case string(KindMicrosoftCloudAppSecurity): + var mdc MCASDataConnector + err := json.Unmarshal(body, &mdc) + return mdc, err + case string(KindMicrosoftDefenderAdvancedThreatProtection): + var mdc MDATPDataConnector + err := json.Unmarshal(body, &mdc) + return mdc, err + case string(KindOffice365): + var odc OfficeDataConnector + err := json.Unmarshal(body, &odc) + return odc, err + case string(KindThreatIntelligence): + var tdc TIDataConnector + err := json.Unmarshal(body, &tdc) + return tdc, err + default: + var dc DataConnector + err := json.Unmarshal(body, &dc) + return dc, err + } +} +func unmarshalBasicDataConnectorArray(body []byte) ([]BasicDataConnector, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dcArray := make([]BasicDataConnector, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dc, err := unmarshalBasicDataConnector(*rawMessage) + if err != nil { + return nil, err + } + dcArray[index] = dc + } + return dcArray, nil +} + +// MarshalJSON is the custom marshaler for DataConnector. +func (dc DataConnector) MarshalJSON() ([]byte, error) { + dc.Kind = KindDataConnector + objectMap := make(map[string]interface{}) + if dc.Etag != nil { + objectMap["etag"] = dc.Etag + } + if dc.Kind != "" { + objectMap["kind"] = dc.Kind + } + return json.Marshal(objectMap) +} + +// AsAADDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsAADDataConnector() (*AADDataConnector, bool) { + return nil, false +} + +// AsAATPDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { + return nil, false +} + +// AsASCDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { + return nil, false +} + +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { + return nil, false +} + +// AsMCASDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { + return nil, false +} + +// AsMDATPDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { + return nil, false +} + +// AsOfficeDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { + return nil, false +} + +// AsTIDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsTIDataConnector() (*TIDataConnector, bool) { + return nil, false +} + +// AsDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsDataConnector() (*DataConnector, bool) { + return &dc, true +} + +// AsBasicDataConnector is the BasicDataConnector implementation for DataConnector. +func (dc DataConnector) AsBasicDataConnector() (BasicDataConnector, bool) { + return &dc, true +} + +// DataConnectorDataTypeCommon common field for data type in data connectors. +type DataConnectorDataTypeCommon struct { + // State - Describe whether this data type connection is enabled or not. Possible values include: 'Enabled', 'Disabled' + State DataTypeState `json:"state,omitempty"` +} + +// DataConnectorKind1 describes an Azure resource with kind. +type DataConnectorKind1 struct { + // Kind - The kind of the data connector. Possible values include: 'DataConnectorKindAzureActiveDirectory', 'DataConnectorKindAzureSecurityCenter', 'DataConnectorKindMicrosoftCloudAppSecurity', 'DataConnectorKindThreatIntelligence', 'DataConnectorKindOffice365', 'DataConnectorKindAmazonWebServicesCloudTrail', 'DataConnectorKindAzureAdvancedThreatProtection', 'DataConnectorKindMicrosoftDefenderAdvancedThreatProtection' + Kind DataConnectorKind `json:"kind,omitempty"` +} + +// DataConnectorList list all the data connectors. +type DataConnectorList struct { + autorest.Response `json:"-"` + // NextLink - READ-ONLY; URL to fetch the next set of data connectors. + NextLink *string `json:"nextLink,omitempty"` + // Value - Array of data connectors. + Value *[]BasicDataConnector `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataConnectorList struct. +func (dcl *DataConnectorList) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + dcl.NextLink = &nextLink + } + case "value": + if v != nil { + value, err := unmarshalBasicDataConnectorArray(*v) + if err != nil { + return err + } + dcl.Value = &value + } + } + } + + return nil +} + +// DataConnectorListIterator provides access to a complete listing of DataConnector values. +type DataConnectorListIterator struct { + i int + page DataConnectorListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DataConnectorListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectorListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DataConnectorListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DataConnectorListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DataConnectorListIterator) Response() DataConnectorList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DataConnectorListIterator) Value() BasicDataConnector { + if !iter.page.NotDone() { + return DataConnector{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DataConnectorListIterator type. +func NewDataConnectorListIterator(page DataConnectorListPage) DataConnectorListIterator { + return DataConnectorListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dcl DataConnectorList) IsEmpty() bool { + return dcl.Value == nil || len(*dcl.Value) == 0 +} + +// dataConnectorListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dcl DataConnectorList) dataConnectorListPreparer(ctx context.Context) (*http.Request, error) { + if dcl.NextLink == nil || len(to.String(dcl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dcl.NextLink))) +} + +// DataConnectorListPage contains a page of BasicDataConnector values. +type DataConnectorListPage struct { + fn func(context.Context, DataConnectorList) (DataConnectorList, error) + dcl DataConnectorList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DataConnectorListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataConnectorListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.dcl) + if err != nil { + return err + } + page.dcl = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DataConnectorListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DataConnectorListPage) NotDone() bool { + return !page.dcl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DataConnectorListPage) Response() DataConnectorList { + return page.dcl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DataConnectorListPage) Values() []BasicDataConnector { + if page.dcl.IsEmpty() { + return nil + } + return *page.dcl.Value +} + +// Creates a new instance of the DataConnectorListPage type. +func NewDataConnectorListPage(getNextPage func(context.Context, DataConnectorList) (DataConnectorList, error)) DataConnectorListPage { + return DataConnectorListPage{fn: getNextPage} +} + +// DataConnectorModel ... +type DataConnectorModel struct { + autorest.Response `json:"-"` + Value BasicDataConnector `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataConnectorModel struct. +func (dcm *DataConnectorModel) UnmarshalJSON(body []byte) error { + dc, err := unmarshalBasicDataConnector(body) + if err != nil { + return err + } + dcm.Value = dc + + return nil +} + +// DataConnectorTenantID properties data connector on tenant level. +type DataConnectorTenantID struct { + // TenantID - The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} + +// DataConnectorWithAlertsProperties data connector properties. +type DataConnectorWithAlertsProperties struct { + // DataTypes - The available data types for the connector. + DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` +} + +// FusionAlertRule represents Fusion alert rule. +type FusionAlertRule struct { + // FusionAlertRuleProperties - Fusion alert rule properties + *FusionAlertRuleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindAlertRule', 'KindFusion', 'KindMicrosoftSecurityIncidentCreation', 'KindScheduled' + Kind Kind `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for FusionAlertRule. +func (far FusionAlertRule) MarshalJSON() ([]byte, error) { + far.Kind = KindFusion + objectMap := make(map[string]interface{}) + if far.FusionAlertRuleProperties != nil { + objectMap["properties"] = far.FusionAlertRuleProperties + } + if far.Etag != nil { + objectMap["etag"] = far.Etag + } + if far.Kind != "" { + objectMap["kind"] = far.Kind + } + return json.Marshal(objectMap) +} + +// AsFusionAlertRule is the BasicAlertRule implementation for FusionAlertRule. +func (far FusionAlertRule) AsFusionAlertRule() (*FusionAlertRule, bool) { + return &far, true +} + +// AsMicrosoftSecurityIncidentCreationAlertRule is the BasicAlertRule implementation for FusionAlertRule. +func (far FusionAlertRule) AsMicrosoftSecurityIncidentCreationAlertRule() (*MicrosoftSecurityIncidentCreationAlertRule, bool) { + return nil, false +} + +// AsScheduledAlertRule is the BasicAlertRule implementation for FusionAlertRule. +func (far FusionAlertRule) AsScheduledAlertRule() (*ScheduledAlertRule, bool) { + return nil, false +} + +// AsAlertRule is the BasicAlertRule implementation for FusionAlertRule. +func (far FusionAlertRule) AsAlertRule() (*AlertRule, bool) { + return nil, false +} + +// AsBasicAlertRule is the BasicAlertRule implementation for FusionAlertRule. +func (far FusionAlertRule) AsBasicAlertRule() (BasicAlertRule, bool) { + return &far, true +} + +// UnmarshalJSON is the custom unmarshaler for FusionAlertRule struct. +func (far *FusionAlertRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var fusionAlertRuleProperties FusionAlertRuleProperties + err = json.Unmarshal(*v, &fusionAlertRuleProperties) + if err != nil { + return err + } + far.FusionAlertRuleProperties = &fusionAlertRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + far.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + far.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + far.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + far.Etag = &etag + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + far.Kind = kind + } + } + } + + return nil +} + +// FusionAlertRuleProperties fusion alert rule base property bag. +type FusionAlertRuleProperties struct { + // AlertRuleTemplateName - The Name of the alert rule template used to create this rule. + AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` + // Description - READ-ONLY; The description of the alert rule. + Description *string `json:"description,omitempty"` + // DisplayName - READ-ONLY; The display name for alerts created by this alert rule. + DisplayName *string `json:"displayName,omitempty"` + // Enabled - Determines whether this alert rule is enabled or disabled. + Enabled *bool `json:"enabled,omitempty"` + // LastModifiedUtc - READ-ONLY; The last time that this alert has been modified. + LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` + // Severity - READ-ONLY; The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' + Severity AlertSeverity `json:"severity,omitempty"` + // Tactics - READ-ONLY; The tactics of the alert rule + Tactics *[]AttackTactic `json:"tactics,omitempty"` +} + +// FusionAlertRuleTemplate represents Fusion alert rule template. +type FusionAlertRuleTemplate struct { + // FusionAlertRuleTemplateProperties - Fusion alert rule template properties + *FusionAlertRuleTemplateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindBasicAlertRuleTemplateKindAlertRuleTemplate', 'KindBasicAlertRuleTemplateKindFusion', 'KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation', 'KindBasicAlertRuleTemplateKindScheduled' + Kind KindBasicAlertRuleTemplate `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for FusionAlertRuleTemplate. +func (fart FusionAlertRuleTemplate) MarshalJSON() ([]byte, error) { + fart.Kind = KindBasicAlertRuleTemplateKindFusion + objectMap := make(map[string]interface{}) + if fart.FusionAlertRuleTemplateProperties != nil { + objectMap["properties"] = fart.FusionAlertRuleTemplateProperties + } + if fart.Kind != "" { + objectMap["kind"] = fart.Kind + } + return json.Marshal(objectMap) +} + +// AsFusionAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FusionAlertRuleTemplate. +func (fart FusionAlertRuleTemplate) AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) { + return &fart, true +} + +// AsMicrosoftSecurityIncidentCreationAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FusionAlertRuleTemplate. +func (fart FusionAlertRuleTemplate) AsMicrosoftSecurityIncidentCreationAlertRuleTemplate() (*MicrosoftSecurityIncidentCreationAlertRuleTemplate, bool) { + return nil, false +} + +// AsScheduledAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FusionAlertRuleTemplate. +func (fart FusionAlertRuleTemplate) AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) { + return nil, false +} + +// AsAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FusionAlertRuleTemplate. +func (fart FusionAlertRuleTemplate) AsAlertRuleTemplate() (*AlertRuleTemplate, bool) { + return nil, false +} + +// AsBasicAlertRuleTemplate is the BasicAlertRuleTemplate implementation for FusionAlertRuleTemplate. +func (fart FusionAlertRuleTemplate) AsBasicAlertRuleTemplate() (BasicAlertRuleTemplate, bool) { + return &fart, true +} + +// UnmarshalJSON is the custom unmarshaler for FusionAlertRuleTemplate struct. +func (fart *FusionAlertRuleTemplate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var fusionAlertRuleTemplateProperties FusionAlertRuleTemplateProperties + err = json.Unmarshal(*v, &fusionAlertRuleTemplateProperties) + if err != nil { + return err + } + fart.FusionAlertRuleTemplateProperties = &fusionAlertRuleTemplateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fart.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fart.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fart.Type = &typeVar + } + case "kind": + if v != nil { + var kind KindBasicAlertRuleTemplate + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + fart.Kind = kind + } + } + } + + return nil +} + +// FusionAlertRuleTemplateProperties fusion alert rule template properties +type FusionAlertRuleTemplateProperties struct { + // Severity - The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' + Severity AlertSeverity `json:"severity,omitempty"` + // Tactics - The tactics of the alert rule template + Tactics *[]AttackTactic `json:"tactics,omitempty"` + // AlertRulesCreatedByTemplateCount - the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + // CreatedDateUTC - READ-ONLY; The time that this alert rule template has been added. + CreatedDateUTC *date.Time `json:"createdDateUTC,omitempty"` + // Description - The description of the alert rule template. + Description *string `json:"description,omitempty"` + // DisplayName - The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` + // RequiredDataConnectors - The required data connectors for this template + RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + // Status - The alert rule template status. Possible values include: 'Installed', 'Available', 'NotAvailable' + Status TemplateStatus `json:"status,omitempty"` +} + +// IncidentInfo describes related incident information for the bookmark +type IncidentInfo struct { + // IncidentID - Incident Id + IncidentID *string `json:"incidentId,omitempty"` + // Severity - The severity of the incident. Possible values include: 'IncidentSeverityCritical', 'IncidentSeverityHigh', 'IncidentSeverityMedium', 'IncidentSeverityLow', 'IncidentSeverityInformational' + Severity IncidentSeverity `json:"severity,omitempty"` + // Title - The title of the incident + Title *string `json:"title,omitempty"` + // RelationName - Relation Name + RelationName *string `json:"relationName,omitempty"` +} + +// MCASDataConnector represents MCAS (Microsoft Cloud App Security) data connector. +type MCASDataConnector struct { + // MCASDataConnectorProperties - MCAS (Microsoft Cloud App Security) data connector properties. + *MCASDataConnectorProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' + Kind KindBasicDataConnector `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for MCASDataConnector. +func (mdc MCASDataConnector) MarshalJSON() ([]byte, error) { + mdc.Kind = KindMicrosoftCloudAppSecurity + objectMap := make(map[string]interface{}) + if mdc.MCASDataConnectorProperties != nil { + objectMap["properties"] = mdc.MCASDataConnectorProperties + } + if mdc.Etag != nil { + objectMap["etag"] = mdc.Etag + } + if mdc.Kind != "" { + objectMap["kind"] = mdc.Kind + } + return json.Marshal(objectMap) +} + +// AsAADDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { + return nil, false +} + +// AsAATPDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { + return nil, false +} + +// AsASCDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { + return nil, false +} + +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { + return nil, false +} + +// AsMCASDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { + return &mdc, true +} + +// AsMDATPDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { + return nil, false +} + +// AsOfficeDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { + return nil, false +} + +// AsTIDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { + return nil, false +} + +// AsDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsDataConnector() (*DataConnector, bool) { + return nil, false +} + +// AsBasicDataConnector is the BasicDataConnector implementation for MCASDataConnector. +func (mdc MCASDataConnector) AsBasicDataConnector() (BasicDataConnector, bool) { + return &mdc, true +} + +// UnmarshalJSON is the custom unmarshaler for MCASDataConnector struct. +func (mdc *MCASDataConnector) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mCASDataConnectorProperties MCASDataConnectorProperties + err = json.Unmarshal(*v, &mCASDataConnectorProperties) + if err != nil { + return err + } + mdc.MCASDataConnectorProperties = &mCASDataConnectorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mdc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mdc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mdc.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + mdc.Etag = &etag + } + case "kind": + if v != nil { + var kind KindBasicDataConnector + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + mdc.Kind = kind + } + } + } + + return nil +} + +// MCASDataConnectorDataTypes the available data types for MCAS (Microsoft Cloud App Security) data +// connector. +type MCASDataConnectorDataTypes struct { + // DiscoveryLogs - Discovery log data type connection. + DiscoveryLogs *MCASDataConnectorDataTypesDiscoveryLogs `json:"discoveryLogs,omitempty"` + // Alerts - Alerts data type connection. + Alerts *AlertsDataTypeOfDataConnectorAlerts `json:"alerts,omitempty"` +} + +// MCASDataConnectorDataTypesDiscoveryLogs discovery log data type connection. +type MCASDataConnectorDataTypesDiscoveryLogs struct { + // State - Describe whether this data type connection is enabled or not. Possible values include: 'Enabled', 'Disabled' + State DataTypeState `json:"state,omitempty"` +} + +// MCASDataConnectorProperties MCAS (Microsoft Cloud App Security) data connector properties. +type MCASDataConnectorProperties struct { + // DataTypes - The available data types for the connector. + DataTypes *MCASDataConnectorDataTypes `json:"dataTypes,omitempty"` + // TenantID - The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} + +// MDATPDataConnector represents MDATP (Microsoft Defender Advanced Threat Protection) data connector. +type MDATPDataConnector struct { + // MDATPDataConnectorProperties - MDATP (Microsoft Defender Advanced Threat Protection) data connector properties. + *MDATPDataConnectorProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' + Kind KindBasicDataConnector `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for MDATPDataConnector. +func (mdc MDATPDataConnector) MarshalJSON() ([]byte, error) { + mdc.Kind = KindMicrosoftDefenderAdvancedThreatProtection + objectMap := make(map[string]interface{}) + if mdc.MDATPDataConnectorProperties != nil { + objectMap["properties"] = mdc.MDATPDataConnectorProperties + } + if mdc.Etag != nil { + objectMap["etag"] = mdc.Etag + } + if mdc.Kind != "" { + objectMap["kind"] = mdc.Kind + } + return json.Marshal(objectMap) +} + +// AsAADDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { + return nil, false +} + +// AsAATPDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { + return nil, false +} + +// AsASCDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { + return nil, false +} + +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { + return nil, false +} + +// AsMCASDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { + return nil, false +} + +// AsMDATPDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { + return &mdc, true +} + +// AsOfficeDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { + return nil, false +} + +// AsTIDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { + return nil, false +} + +// AsDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsDataConnector() (*DataConnector, bool) { + return nil, false +} + +// AsBasicDataConnector is the BasicDataConnector implementation for MDATPDataConnector. +func (mdc MDATPDataConnector) AsBasicDataConnector() (BasicDataConnector, bool) { + return &mdc, true +} + +// UnmarshalJSON is the custom unmarshaler for MDATPDataConnector struct. +func (mdc *MDATPDataConnector) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mDATPDataConnectorProperties MDATPDataConnectorProperties + err = json.Unmarshal(*v, &mDATPDataConnectorProperties) + if err != nil { + return err + } + mdc.MDATPDataConnectorProperties = &mDATPDataConnectorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mdc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mdc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mdc.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + mdc.Etag = &etag + } + case "kind": + if v != nil { + var kind KindBasicDataConnector + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + mdc.Kind = kind + } + } + } + + return nil +} + +// MDATPDataConnectorProperties MDATP (Microsoft Defender Advanced Threat Protection) data connector +// properties. +type MDATPDataConnectorProperties struct { + // TenantID - The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` + // DataTypes - The available data types for the connector. + DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` +} + +// MicrosoftSecurityIncidentCreationAlertRule represents MicrosoftSecurityIncidentCreation rule. +type MicrosoftSecurityIncidentCreationAlertRule struct { + // MicrosoftSecurityIncidentCreationAlertRuleProperties - MicrosoftSecurityIncidentCreation rule properties + *MicrosoftSecurityIncidentCreationAlertRuleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindAlertRule', 'KindFusion', 'KindMicrosoftSecurityIncidentCreation', 'KindScheduled' + Kind Kind `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for MicrosoftSecurityIncidentCreationAlertRule. +func (msicar MicrosoftSecurityIncidentCreationAlertRule) MarshalJSON() ([]byte, error) { + msicar.Kind = KindMicrosoftSecurityIncidentCreation + objectMap := make(map[string]interface{}) + if msicar.MicrosoftSecurityIncidentCreationAlertRuleProperties != nil { + objectMap["properties"] = msicar.MicrosoftSecurityIncidentCreationAlertRuleProperties + } + if msicar.Etag != nil { + objectMap["etag"] = msicar.Etag + } + if msicar.Kind != "" { + objectMap["kind"] = msicar.Kind + } + return json.Marshal(objectMap) +} + +// AsFusionAlertRule is the BasicAlertRule implementation for MicrosoftSecurityIncidentCreationAlertRule. +func (msicar MicrosoftSecurityIncidentCreationAlertRule) AsFusionAlertRule() (*FusionAlertRule, bool) { + return nil, false +} + +// AsMicrosoftSecurityIncidentCreationAlertRule is the BasicAlertRule implementation for MicrosoftSecurityIncidentCreationAlertRule. +func (msicar MicrosoftSecurityIncidentCreationAlertRule) AsMicrosoftSecurityIncidentCreationAlertRule() (*MicrosoftSecurityIncidentCreationAlertRule, bool) { + return &msicar, true +} + +// AsScheduledAlertRule is the BasicAlertRule implementation for MicrosoftSecurityIncidentCreationAlertRule. +func (msicar MicrosoftSecurityIncidentCreationAlertRule) AsScheduledAlertRule() (*ScheduledAlertRule, bool) { + return nil, false +} + +// AsAlertRule is the BasicAlertRule implementation for MicrosoftSecurityIncidentCreationAlertRule. +func (msicar MicrosoftSecurityIncidentCreationAlertRule) AsAlertRule() (*AlertRule, bool) { + return nil, false +} + +// AsBasicAlertRule is the BasicAlertRule implementation for MicrosoftSecurityIncidentCreationAlertRule. +func (msicar MicrosoftSecurityIncidentCreationAlertRule) AsBasicAlertRule() (BasicAlertRule, bool) { + return &msicar, true +} + +// UnmarshalJSON is the custom unmarshaler for MicrosoftSecurityIncidentCreationAlertRule struct. +func (msicar *MicrosoftSecurityIncidentCreationAlertRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var microsoftSecurityIncidentCreationAlertRuleProperties MicrosoftSecurityIncidentCreationAlertRuleProperties + err = json.Unmarshal(*v, µsoftSecurityIncidentCreationAlertRuleProperties) + if err != nil { + return err + } + msicar.MicrosoftSecurityIncidentCreationAlertRuleProperties = µsoftSecurityIncidentCreationAlertRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + msicar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + msicar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + msicar.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + msicar.Etag = &etag + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + msicar.Kind = kind + } + } + } + + return nil +} + +// MicrosoftSecurityIncidentCreationAlertRuleCommonProperties microsoftSecurityIncidentCreation rule common +// property bag. +type MicrosoftSecurityIncidentCreationAlertRuleCommonProperties struct { + // DisplayNamesFilter - the alerts' displayNames on which the cases will be generated + DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` + // ProductFilter - The alerts' productName on which the cases will be generated. Possible values include: 'MicrosoftCloudAppSecurity', 'AzureSecurityCenter', 'AzureAdvancedThreatProtection', 'AzureActiveDirectoryIdentityProtection', 'AzureSecurityCenterforIoT' + ProductFilter MicrosoftSecurityProductName `json:"productFilter,omitempty"` + // SeveritiesFilter - the alerts' severities on which the cases will be generated + SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` +} + +// MicrosoftSecurityIncidentCreationAlertRuleProperties microsoftSecurityIncidentCreation rule property +// bag. +type MicrosoftSecurityIncidentCreationAlertRuleProperties struct { + // AlertRuleTemplateName - The Name of the alert rule template used to create this rule. + AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` + // Description - The description of the alert rule. + Description *string `json:"description,omitempty"` + // DisplayName - The display name for alerts created by this alert rule. + DisplayName *string `json:"displayName,omitempty"` + // Enabled - Determines whether this alert rule is enabled or disabled. + Enabled *bool `json:"enabled,omitempty"` + // LastModifiedUtc - READ-ONLY; The last time that this alert has been modified. + LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` + // DisplayNamesFilter - the alerts' displayNames on which the cases will be generated + DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` + // ProductFilter - The alerts' productName on which the cases will be generated. Possible values include: 'MicrosoftCloudAppSecurity', 'AzureSecurityCenter', 'AzureAdvancedThreatProtection', 'AzureActiveDirectoryIdentityProtection', 'AzureSecurityCenterforIoT' + ProductFilter MicrosoftSecurityProductName `json:"productFilter,omitempty"` + // SeveritiesFilter - the alerts' severities on which the cases will be generated + SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` +} + +// MicrosoftSecurityIncidentCreationAlertRuleTemplate represents MicrosoftSecurityIncidentCreation rule +// template. +type MicrosoftSecurityIncidentCreationAlertRuleTemplate struct { + // MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties - MicrosoftSecurityIncidentCreation rule template properties + *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindBasicAlertRuleTemplateKindAlertRuleTemplate', 'KindBasicAlertRuleTemplateKindFusion', 'KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation', 'KindBasicAlertRuleTemplateKindScheduled' + Kind KindBasicAlertRuleTemplate `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate) MarshalJSON() ([]byte, error) { + msicart.Kind = KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation + objectMap := make(map[string]interface{}) + if msicart.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties != nil { + objectMap["properties"] = msicart.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties + } + if msicart.Kind != "" { + objectMap["kind"] = msicart.Kind + } + return json.Marshal(objectMap) +} + +// AsFusionAlertRuleTemplate is the BasicAlertRuleTemplate implementation for MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate) AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) { + return nil, false +} + +// AsMicrosoftSecurityIncidentCreationAlertRuleTemplate is the BasicAlertRuleTemplate implementation for MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate) AsMicrosoftSecurityIncidentCreationAlertRuleTemplate() (*MicrosoftSecurityIncidentCreationAlertRuleTemplate, bool) { + return &msicart, true +} + +// AsScheduledAlertRuleTemplate is the BasicAlertRuleTemplate implementation for MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate) AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) { + return nil, false +} + +// AsAlertRuleTemplate is the BasicAlertRuleTemplate implementation for MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate) AsAlertRuleTemplate() (*AlertRuleTemplate, bool) { + return nil, false +} + +// AsBasicAlertRuleTemplate is the BasicAlertRuleTemplate implementation for MicrosoftSecurityIncidentCreationAlertRuleTemplate. +func (msicart MicrosoftSecurityIncidentCreationAlertRuleTemplate) AsBasicAlertRuleTemplate() (BasicAlertRuleTemplate, bool) { + return &msicart, true +} + +// UnmarshalJSON is the custom unmarshaler for MicrosoftSecurityIncidentCreationAlertRuleTemplate struct. +func (msicart *MicrosoftSecurityIncidentCreationAlertRuleTemplate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var microsoftSecurityIncidentCreationAlertRuleTemplateProperties MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties + err = json.Unmarshal(*v, µsoftSecurityIncidentCreationAlertRuleTemplateProperties) + if err != nil { + return err + } + msicart.MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties = µsoftSecurityIncidentCreationAlertRuleTemplateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + msicart.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + msicart.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + msicart.Type = &typeVar + } + case "kind": + if v != nil { + var kind KindBasicAlertRuleTemplate + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + msicart.Kind = kind + } + } + } + + return nil +} + +// MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties microsoftSecurityIncidentCreation rule +// template properties +type MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties struct { + // AlertRulesCreatedByTemplateCount - the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + // CreatedDateUTC - READ-ONLY; The time that this alert rule template has been added. + CreatedDateUTC *date.Time `json:"createdDateUTC,omitempty"` + // Description - The description of the alert rule template. + Description *string `json:"description,omitempty"` + // DisplayName - The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` + // RequiredDataConnectors - The required data connectors for this template + RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + // Status - The alert rule template status. Possible values include: 'Installed', 'Available', 'NotAvailable' + Status TemplateStatus `json:"status,omitempty"` + // DisplayNamesFilter - the alerts' displayNames on which the cases will be generated + DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` + // ProductFilter - The alerts' productName on which the cases will be generated. Possible values include: 'MicrosoftCloudAppSecurity', 'AzureSecurityCenter', 'AzureAdvancedThreatProtection', 'AzureActiveDirectoryIdentityProtection', 'AzureSecurityCenterforIoT' + ProductFilter MicrosoftSecurityProductName `json:"productFilter,omitempty"` + // SeveritiesFilter - the alerts' severities on which the cases will be generated + SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` +} + +// OfficeConsent consent for Office365 tenant that already made. +type OfficeConsent struct { + // OfficeConsentProperties - Office consent properties + *OfficeConsentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OfficeConsent. +func (oc OfficeConsent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oc.OfficeConsentProperties != nil { + objectMap["properties"] = oc.OfficeConsentProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OfficeConsent struct. +func (oc *OfficeConsent) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var officeConsentProperties OfficeConsentProperties + err = json.Unmarshal(*v, &officeConsentProperties) + if err != nil { + return err + } + oc.OfficeConsentProperties = &officeConsentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + oc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + oc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + oc.Type = &typeVar + } + } + } + + return nil +} + +// OfficeConsentList list of all the office365 consents. +type OfficeConsentList struct { + // NextLink - READ-ONLY; URL to fetch the next set of office consents. + NextLink *string `json:"nextLink,omitempty"` + // Value - Array of the consents. + Value *[]OfficeConsent `json:"value,omitempty"` +} + +// OfficeConsentProperties consent property bag. +type OfficeConsentProperties struct { + // TenantID - The tenantId of the Office365 with the consent. + TenantID *string `json:"tenantId,omitempty"` + // TenantName - READ-ONLY; The tenant name of the Office365 with the consent. + TenantName *string `json:"tenantName,omitempty"` +} + +// OfficeDataConnector represents office data connector. +type OfficeDataConnector struct { + // OfficeDataConnectorProperties - Office data connector properties. + *OfficeDataConnectorProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' + Kind KindBasicDataConnector `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for OfficeDataConnector. +func (odc OfficeDataConnector) MarshalJSON() ([]byte, error) { + odc.Kind = KindOffice365 + objectMap := make(map[string]interface{}) + if odc.OfficeDataConnectorProperties != nil { + objectMap["properties"] = odc.OfficeDataConnectorProperties + } + if odc.Etag != nil { + objectMap["etag"] = odc.Etag + } + if odc.Kind != "" { + objectMap["kind"] = odc.Kind + } + return json.Marshal(objectMap) +} + +// AsAADDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { + return nil, false +} + +// AsAATPDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { + return nil, false +} + +// AsASCDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { + return nil, false +} + +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { + return nil, false +} + +// AsMCASDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { + return nil, false +} + +// AsMDATPDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { + return nil, false +} + +// AsOfficeDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { + return &odc, true +} + +// AsTIDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { + return nil, false +} + +// AsDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsDataConnector() (*DataConnector, bool) { + return nil, false +} + +// AsBasicDataConnector is the BasicDataConnector implementation for OfficeDataConnector. +func (odc OfficeDataConnector) AsBasicDataConnector() (BasicDataConnector, bool) { + return &odc, true +} + +// UnmarshalJSON is the custom unmarshaler for OfficeDataConnector struct. +func (odc *OfficeDataConnector) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var officeDataConnectorProperties OfficeDataConnectorProperties + err = json.Unmarshal(*v, &officeDataConnectorProperties) + if err != nil { + return err + } + odc.OfficeDataConnectorProperties = &officeDataConnectorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + odc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + odc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + odc.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + odc.Etag = &etag + } + case "kind": + if v != nil { + var kind KindBasicDataConnector + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + odc.Kind = kind + } + } + } + + return nil +} + +// OfficeDataConnectorDataTypes the available data types for office data connector. +type OfficeDataConnectorDataTypes struct { + // Exchange - Exchange data type connection. + Exchange *OfficeDataConnectorDataTypesExchange `json:"exchange,omitempty"` + // SharePoint - SharePoint data type connection. + SharePoint *OfficeDataConnectorDataTypesSharePoint `json:"sharePoint,omitempty"` +} + +// OfficeDataConnectorDataTypesExchange exchange data type connection. +type OfficeDataConnectorDataTypesExchange struct { + // State - Describe whether this data type connection is enabled or not. Possible values include: 'Enabled', 'Disabled' + State DataTypeState `json:"state,omitempty"` +} + +// OfficeDataConnectorDataTypesSharePoint sharePoint data type connection. +type OfficeDataConnectorDataTypesSharePoint struct { + // State - Describe whether this data type connection is enabled or not. Possible values include: 'Enabled', 'Disabled' + State DataTypeState `json:"state,omitempty"` +} + +// OfficeDataConnectorProperties office data connector properties. +type OfficeDataConnectorProperties struct { + // DataTypes - The available data types for the connector. + DataTypes *OfficeDataConnectorDataTypes `json:"dataTypes,omitempty"` + // TenantID - The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} + +// Operation operation provided by provider +type Operation struct { + // Display - Properties of the operation + Display *OperationDisplay `json:"display,omitempty"` + // Name - Name of the operation + Name *string `json:"name,omitempty"` +} + +// OperationDisplay properties of the operation +type OperationDisplay struct { + // Description - Description of the operation + Description *string `json:"description,omitempty"` + // Operation - Operation name + Operation *string `json:"operation,omitempty"` + // Provider - Provider name + Provider *string `json:"provider,omitempty"` + // Resource - Resource name + Resource *string `json:"resource,omitempty"` +} + +// OperationsList lists the operations available in the SecurityInsights RP. +type OperationsList struct { + autorest.Response `json:"-"` + // NextLink - URL to fetch the next set of operations. + NextLink *string `json:"nextLink,omitempty"` + // Value - Array of operations + Value *[]Operation `json:"value,omitempty"` +} + +// OperationsListIterator provides access to a complete listing of Operation values. +type OperationsListIterator struct { + i int + page OperationsListPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationsListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationsListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationsListIterator) Response() OperationsList { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationsListIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsListIterator type. +func NewOperationsListIterator(page OperationsListPage) OperationsListIterator { + return OperationsListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ol OperationsList) IsEmpty() bool { + return ol.Value == nil || len(*ol.Value) == 0 +} + +// operationsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ol OperationsList) operationsListPreparer(ctx context.Context) (*http.Request, error) { + if ol.NextLink == nil || len(to.String(ol.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ol.NextLink))) +} + +// OperationsListPage contains a page of Operation values. +type OperationsListPage struct { + fn func(context.Context, OperationsList) (OperationsList, error) + ol OperationsList +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationsListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ol) + if err != nil { + return err + } + page.ol = next + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationsListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsListPage) NotDone() bool { + return !page.ol.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsListPage) Response() OperationsList { + return page.ol +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsListPage) Values() []Operation { + if page.ol.IsEmpty() { + return nil + } + return *page.ol.Value +} + +// Creates a new instance of the OperationsListPage type. +func NewOperationsListPage(getNextPage func(context.Context, OperationsList) (OperationsList, error)) OperationsListPage { + return OperationsListPage{fn: getNextPage} +} + +// Resource an azure resource object +type Resource struct { + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` +} + +// ResourceWithEtag an azure resource object with an Etag property +type ResourceWithEtag struct { + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` +} + +// ScheduledAlertRule represents scheduled alert rule. +type ScheduledAlertRule struct { + // ScheduledAlertRuleProperties - Scheduled alert rule properties + *ScheduledAlertRuleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindAlertRule', 'KindFusion', 'KindMicrosoftSecurityIncidentCreation', 'KindScheduled' + Kind Kind `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduledAlertRule. +func (sar ScheduledAlertRule) MarshalJSON() ([]byte, error) { + sar.Kind = KindScheduled + objectMap := make(map[string]interface{}) + if sar.ScheduledAlertRuleProperties != nil { + objectMap["properties"] = sar.ScheduledAlertRuleProperties + } + if sar.Etag != nil { + objectMap["etag"] = sar.Etag + } + if sar.Kind != "" { + objectMap["kind"] = sar.Kind + } + return json.Marshal(objectMap) +} + +// AsFusionAlertRule is the BasicAlertRule implementation for ScheduledAlertRule. +func (sar ScheduledAlertRule) AsFusionAlertRule() (*FusionAlertRule, bool) { + return nil, false +} + +// AsMicrosoftSecurityIncidentCreationAlertRule is the BasicAlertRule implementation for ScheduledAlertRule. +func (sar ScheduledAlertRule) AsMicrosoftSecurityIncidentCreationAlertRule() (*MicrosoftSecurityIncidentCreationAlertRule, bool) { + return nil, false +} + +// AsScheduledAlertRule is the BasicAlertRule implementation for ScheduledAlertRule. +func (sar ScheduledAlertRule) AsScheduledAlertRule() (*ScheduledAlertRule, bool) { + return &sar, true +} + +// AsAlertRule is the BasicAlertRule implementation for ScheduledAlertRule. +func (sar ScheduledAlertRule) AsAlertRule() (*AlertRule, bool) { + return nil, false +} + +// AsBasicAlertRule is the BasicAlertRule implementation for ScheduledAlertRule. +func (sar ScheduledAlertRule) AsBasicAlertRule() (BasicAlertRule, bool) { + return &sar, true +} + +// UnmarshalJSON is the custom unmarshaler for ScheduledAlertRule struct. +func (sar *ScheduledAlertRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var scheduledAlertRuleProperties ScheduledAlertRuleProperties + err = json.Unmarshal(*v, &scheduledAlertRuleProperties) + if err != nil { + return err + } + sar.ScheduledAlertRuleProperties = &scheduledAlertRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sar.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + sar.Etag = &etag + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sar.Kind = kind + } + } + } + + return nil +} + +// ScheduledAlertRuleCommonProperties schedule alert rule template property bag. +type ScheduledAlertRuleCommonProperties struct { + // Query - The query that creates alerts for this rule. + Query *string `json:"query,omitempty"` + // QueryFrequency - The frequency (in ISO 8601 duration format) for this alert rule to run. + QueryFrequency *string `json:"queryFrequency,omitempty"` + // QueryPeriod - The period (in ISO 8601 duration format) that this alert rule looks at. + QueryPeriod *string `json:"queryPeriod,omitempty"` + // Severity - The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' + Severity AlertSeverity `json:"severity,omitempty"` + // TriggerOperator - The operation against the threshold that triggers alert rule. Possible values include: 'GreaterThan', 'LessThan', 'Equal', 'NotEqual' + TriggerOperator TriggerOperator `json:"triggerOperator,omitempty"` + // TriggerThreshold - The threshold triggers this alert rule. + TriggerThreshold *int32 `json:"triggerThreshold,omitempty"` +} + +// ScheduledAlertRuleProperties scheduled alert rule base property bag. +type ScheduledAlertRuleProperties struct { + // AlertRuleTemplateName - The Name of the alert rule template used to create this rule. + AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` + // Description - The description of the alert rule. + Description *string `json:"description,omitempty"` + // DisplayName - The display name for alerts created by this alert rule. + DisplayName *string `json:"displayName,omitempty"` + // Enabled - Determines whether this alert rule is enabled or disabled. + Enabled *bool `json:"enabled,omitempty"` + // LastModifiedUtc - READ-ONLY; The last time that this alert rule has been modified. + LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` + // SuppressionDuration - The suppression (in ISO 8601 duration format) to wait since last time this alert rule been triggered. + SuppressionDuration *string `json:"suppressionDuration,omitempty"` + // SuppressionEnabled - Determines whether the suppression for this alert rule is enabled or disabled. + SuppressionEnabled *bool `json:"suppressionEnabled,omitempty"` + // Tactics - The tactics of the alert rule + Tactics *[]AttackTactic `json:"tactics,omitempty"` + // Query - The query that creates alerts for this rule. + Query *string `json:"query,omitempty"` + // QueryFrequency - The frequency (in ISO 8601 duration format) for this alert rule to run. + QueryFrequency *string `json:"queryFrequency,omitempty"` + // QueryPeriod - The period (in ISO 8601 duration format) that this alert rule looks at. + QueryPeriod *string `json:"queryPeriod,omitempty"` + // Severity - The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' + Severity AlertSeverity `json:"severity,omitempty"` + // TriggerOperator - The operation against the threshold that triggers alert rule. Possible values include: 'GreaterThan', 'LessThan', 'Equal', 'NotEqual' + TriggerOperator TriggerOperator `json:"triggerOperator,omitempty"` + // TriggerThreshold - The threshold triggers this alert rule. + TriggerThreshold *int32 `json:"triggerThreshold,omitempty"` +} + +// ScheduledAlertRuleTemplate represents scheduled alert rule template. +type ScheduledAlertRuleTemplate struct { + // ScheduledAlertRuleTemplateProperties - Scheduled alert rule template properties + *ScheduledAlertRuleTemplateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindBasicAlertRuleTemplateKindAlertRuleTemplate', 'KindBasicAlertRuleTemplateKindFusion', 'KindBasicAlertRuleTemplateKindMicrosoftSecurityIncidentCreation', 'KindBasicAlertRuleTemplateKindScheduled' + Kind KindBasicAlertRuleTemplate `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduledAlertRuleTemplate. +func (sart ScheduledAlertRuleTemplate) MarshalJSON() ([]byte, error) { + sart.Kind = KindBasicAlertRuleTemplateKindScheduled + objectMap := make(map[string]interface{}) + if sart.ScheduledAlertRuleTemplateProperties != nil { + objectMap["properties"] = sart.ScheduledAlertRuleTemplateProperties + } + if sart.Kind != "" { + objectMap["kind"] = sart.Kind + } + return json.Marshal(objectMap) +} + +// AsFusionAlertRuleTemplate is the BasicAlertRuleTemplate implementation for ScheduledAlertRuleTemplate. +func (sart ScheduledAlertRuleTemplate) AsFusionAlertRuleTemplate() (*FusionAlertRuleTemplate, bool) { + return nil, false +} + +// AsMicrosoftSecurityIncidentCreationAlertRuleTemplate is the BasicAlertRuleTemplate implementation for ScheduledAlertRuleTemplate. +func (sart ScheduledAlertRuleTemplate) AsMicrosoftSecurityIncidentCreationAlertRuleTemplate() (*MicrosoftSecurityIncidentCreationAlertRuleTemplate, bool) { + return nil, false +} + +// AsScheduledAlertRuleTemplate is the BasicAlertRuleTemplate implementation for ScheduledAlertRuleTemplate. +func (sart ScheduledAlertRuleTemplate) AsScheduledAlertRuleTemplate() (*ScheduledAlertRuleTemplate, bool) { + return &sart, true +} + +// AsAlertRuleTemplate is the BasicAlertRuleTemplate implementation for ScheduledAlertRuleTemplate. +func (sart ScheduledAlertRuleTemplate) AsAlertRuleTemplate() (*AlertRuleTemplate, bool) { + return nil, false +} + +// AsBasicAlertRuleTemplate is the BasicAlertRuleTemplate implementation for ScheduledAlertRuleTemplate. +func (sart ScheduledAlertRuleTemplate) AsBasicAlertRuleTemplate() (BasicAlertRuleTemplate, bool) { + return &sart, true +} + +// UnmarshalJSON is the custom unmarshaler for ScheduledAlertRuleTemplate struct. +func (sart *ScheduledAlertRuleTemplate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var scheduledAlertRuleTemplateProperties ScheduledAlertRuleTemplateProperties + err = json.Unmarshal(*v, &scheduledAlertRuleTemplateProperties) + if err != nil { + return err + } + sart.ScheduledAlertRuleTemplateProperties = &scheduledAlertRuleTemplateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sart.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sart.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sart.Type = &typeVar + } + case "kind": + if v != nil { + var kind KindBasicAlertRuleTemplate + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sart.Kind = kind + } + } + } + + return nil +} + +// ScheduledAlertRuleTemplateProperties scheduled alert rule template properties +type ScheduledAlertRuleTemplateProperties struct { + // AlertRulesCreatedByTemplateCount - the number of alert rules that were created by this template + AlertRulesCreatedByTemplateCount *int32 `json:"alertRulesCreatedByTemplateCount,omitempty"` + // CreatedDateUTC - READ-ONLY; The time that this alert rule template has been added. + CreatedDateUTC *date.Time `json:"createdDateUTC,omitempty"` + // Description - The description of the alert rule template. + Description *string `json:"description,omitempty"` + // DisplayName - The display name for alert rule template. + DisplayName *string `json:"displayName,omitempty"` + // RequiredDataConnectors - The required data connectors for this template + RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` + // Status - The alert rule template status. Possible values include: 'Installed', 'Available', 'NotAvailable' + Status TemplateStatus `json:"status,omitempty"` + // Query - The query that creates alerts for this rule. + Query *string `json:"query,omitempty"` + // QueryFrequency - The frequency (in ISO 8601 duration format) for this alert rule to run. + QueryFrequency *string `json:"queryFrequency,omitempty"` + // QueryPeriod - The period (in ISO 8601 duration format) that this alert rule looks at. + QueryPeriod *string `json:"queryPeriod,omitempty"` + // Severity - The severity for alerts created by this alert rule. Possible values include: 'High', 'Medium', 'Low', 'Informational' + Severity AlertSeverity `json:"severity,omitempty"` + // TriggerOperator - The operation against the threshold that triggers alert rule. Possible values include: 'GreaterThan', 'LessThan', 'Equal', 'NotEqual' + TriggerOperator TriggerOperator `json:"triggerOperator,omitempty"` + // TriggerThreshold - The threshold triggers this alert rule. + TriggerThreshold *int32 `json:"triggerThreshold,omitempty"` + // Tactics - The tactics of the alert rule template + Tactics *[]AttackTactic `json:"tactics,omitempty"` +} + +// BasicSettings the Setting. +type BasicSettings interface { + AsToggleSettings() (*ToggleSettings, bool) + AsUebaSettings() (*UebaSettings, bool) + AsSettings() (*Settings, bool) +} + +// Settings the Setting. +type Settings struct { + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindSettings', 'KindToggleSettings', 'KindUebaSettings' + Kind KindBasicSettings `json:"kind,omitempty"` +} + +func unmarshalBasicSettings(body []byte) (BasicSettings, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindToggleSettings): + var ts ToggleSettings + err := json.Unmarshal(body, &ts) + return ts, err + case string(KindUebaSettings): + var us UebaSettings + err := json.Unmarshal(body, &us) + return us, err + default: + var s Settings + err := json.Unmarshal(body, &s) + return s, err + } +} +func unmarshalBasicSettingsArray(body []byte) ([]BasicSettings, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sArray := make([]BasicSettings, len(rawMessages)) + + for index, rawMessage := range rawMessages { + s, err := unmarshalBasicSettings(*rawMessage) + if err != nil { + return nil, err + } + sArray[index] = s + } + return sArray, nil +} + +// MarshalJSON is the custom marshaler for Settings. +func (s Settings) MarshalJSON() ([]byte, error) { + s.Kind = KindSettings + objectMap := make(map[string]interface{}) + if s.Etag != nil { + objectMap["etag"] = s.Etag + } + if s.Kind != "" { + objectMap["kind"] = s.Kind + } + return json.Marshal(objectMap) +} + +// AsToggleSettings is the BasicSettings implementation for Settings. +func (s Settings) AsToggleSettings() (*ToggleSettings, bool) { + return nil, false +} + +// AsUebaSettings is the BasicSettings implementation for Settings. +func (s Settings) AsUebaSettings() (*UebaSettings, bool) { + return nil, false +} + +// AsSettings is the BasicSettings implementation for Settings. +func (s Settings) AsSettings() (*Settings, bool) { + return &s, true +} + +// AsBasicSettings is the BasicSettings implementation for Settings. +func (s Settings) AsBasicSettings() (BasicSettings, bool) { + return &s, true +} + +// SettingsKind describes an Azure resource with kind. +type SettingsKind struct { + // Kind - The kind of the setting. Possible values include: 'SettingKindUebaSettings', 'SettingKindToggleSettings' + Kind SettingKind `json:"kind,omitempty"` +} + +// ThreatIntelligence threatIntelligence property bag. +type ThreatIntelligence struct { + // Confidence - READ-ONLY; Confidence (must be between 0 and 1) + Confidence *float64 `json:"confidence,omitempty"` + // ProviderName - READ-ONLY; Name of the provider from whom this Threat Intelligence information was received + ProviderName *string `json:"providerName,omitempty"` + // ReportLink - READ-ONLY; Report link + ReportLink *string `json:"reportLink,omitempty"` + // ThreatDescription - READ-ONLY; Threat description (free text) + ThreatDescription *string `json:"threatDescription,omitempty"` + // ThreatName - READ-ONLY; Threat name (e.g. "Jedobot malware") + ThreatName *string `json:"threatName,omitempty"` + // ThreatType - READ-ONLY; Threat type (e.g. "Botnet") + ThreatType *string `json:"threatType,omitempty"` +} + +// TIDataConnector represents threat intelligence data connector. +type TIDataConnector struct { + // TIDataConnectorProperties - TI (Threat Intelligence) data connector properties. + *TIDataConnectorProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindDataConnector', 'KindAzureActiveDirectory', 'KindAzureAdvancedThreatProtection', 'KindAzureSecurityCenter', 'KindAmazonWebServicesCloudTrail', 'KindMicrosoftCloudAppSecurity', 'KindMicrosoftDefenderAdvancedThreatProtection', 'KindOffice365', 'KindThreatIntelligence' + Kind KindBasicDataConnector `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for TIDataConnector. +func (tdc TIDataConnector) MarshalJSON() ([]byte, error) { + tdc.Kind = KindThreatIntelligence + objectMap := make(map[string]interface{}) + if tdc.TIDataConnectorProperties != nil { + objectMap["properties"] = tdc.TIDataConnectorProperties + } + if tdc.Etag != nil { + objectMap["etag"] = tdc.Etag + } + if tdc.Kind != "" { + objectMap["kind"] = tdc.Kind + } + return json.Marshal(objectMap) +} + +// AsAADDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsAADDataConnector() (*AADDataConnector, bool) { + return nil, false +} + +// AsAATPDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsAATPDataConnector() (*AATPDataConnector, bool) { + return nil, false +} + +// AsASCDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsASCDataConnector() (*ASCDataConnector, bool) { + return nil, false +} + +// AsAwsCloudTrailDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsAwsCloudTrailDataConnector() (*AwsCloudTrailDataConnector, bool) { + return nil, false +} + +// AsMCASDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsMCASDataConnector() (*MCASDataConnector, bool) { + return nil, false +} + +// AsMDATPDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsMDATPDataConnector() (*MDATPDataConnector, bool) { + return nil, false +} + +// AsOfficeDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsOfficeDataConnector() (*OfficeDataConnector, bool) { + return nil, false +} + +// AsTIDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsTIDataConnector() (*TIDataConnector, bool) { + return &tdc, true +} + +// AsDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsDataConnector() (*DataConnector, bool) { + return nil, false +} + +// AsBasicDataConnector is the BasicDataConnector implementation for TIDataConnector. +func (tdc TIDataConnector) AsBasicDataConnector() (BasicDataConnector, bool) { + return &tdc, true +} + +// UnmarshalJSON is the custom unmarshaler for TIDataConnector struct. +func (tdc *TIDataConnector) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var tIDataConnectorProperties TIDataConnectorProperties + err = json.Unmarshal(*v, &tIDataConnectorProperties) + if err != nil { + return err + } + tdc.TIDataConnectorProperties = &tIDataConnectorProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tdc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tdc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tdc.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + tdc.Etag = &etag + } + case "kind": + if v != nil { + var kind KindBasicDataConnector + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + tdc.Kind = kind + } + } + } + + return nil +} + +// TIDataConnectorDataTypes the available data types for TI (Threat Intelligence) data connector. +type TIDataConnectorDataTypes struct { + // Indicators - Data type for indicators connection. + Indicators *TIDataConnectorDataTypesIndicators `json:"indicators,omitempty"` +} + +// TIDataConnectorDataTypesIndicators data type for indicators connection. +type TIDataConnectorDataTypesIndicators struct { + // State - Describe whether this data type connection is enabled or not. Possible values include: 'Enabled', 'Disabled' + State DataTypeState `json:"state,omitempty"` +} + +// TIDataConnectorProperties TI (Threat Intelligence) data connector properties. +type TIDataConnectorProperties struct { + // DataTypes - The available data types for the connector. + DataTypes *TIDataConnectorDataTypes `json:"dataTypes,omitempty"` + // TenantID - The tenant id to connect to, and get the data from. + TenantID *string `json:"tenantId,omitempty"` +} + +// ToggleSettings settings with single toggle. +type ToggleSettings struct { + // ToggleSettingsProperties - toggle properties + *ToggleSettingsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindSettings', 'KindToggleSettings', 'KindUebaSettings' + Kind KindBasicSettings `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ToggleSettings. +func (ts ToggleSettings) MarshalJSON() ([]byte, error) { + ts.Kind = KindToggleSettings + objectMap := make(map[string]interface{}) + if ts.ToggleSettingsProperties != nil { + objectMap["properties"] = ts.ToggleSettingsProperties + } + if ts.Etag != nil { + objectMap["etag"] = ts.Etag + } + if ts.Kind != "" { + objectMap["kind"] = ts.Kind + } + return json.Marshal(objectMap) +} + +// AsToggleSettings is the BasicSettings implementation for ToggleSettings. +func (ts ToggleSettings) AsToggleSettings() (*ToggleSettings, bool) { + return &ts, true +} + +// AsUebaSettings is the BasicSettings implementation for ToggleSettings. +func (ts ToggleSettings) AsUebaSettings() (*UebaSettings, bool) { + return nil, false +} + +// AsSettings is the BasicSettings implementation for ToggleSettings. +func (ts ToggleSettings) AsSettings() (*Settings, bool) { + return nil, false +} + +// AsBasicSettings is the BasicSettings implementation for ToggleSettings. +func (ts ToggleSettings) AsBasicSettings() (BasicSettings, bool) { + return &ts, true +} + +// UnmarshalJSON is the custom unmarshaler for ToggleSettings struct. +func (ts *ToggleSettings) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var toggleSettingsProperties ToggleSettingsProperties + err = json.Unmarshal(*v, &toggleSettingsProperties) + if err != nil { + return err + } + ts.ToggleSettingsProperties = &toggleSettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ts.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ts.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ts.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + ts.Etag = &etag + } + case "kind": + if v != nil { + var kind KindBasicSettings + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ts.Kind = kind + } + } + } + + return nil +} + +// ToggleSettingsProperties toggle property bag. +type ToggleSettingsProperties struct { + // IsEnabled - Determines whether the setting is enable or disabled. + IsEnabled *bool `json:"isEnabled,omitempty"` +} + +// UebaSettings represents settings for User and Entity Behavior Analytics enablement. +type UebaSettings struct { + // UebaSettingsProperties - User and Entity Behavior Analytics settings properties + *UebaSettingsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindSettings', 'KindToggleSettings', 'KindUebaSettings' + Kind KindBasicSettings `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for UebaSettings. +func (us UebaSettings) MarshalJSON() ([]byte, error) { + us.Kind = KindUebaSettings + objectMap := make(map[string]interface{}) + if us.UebaSettingsProperties != nil { + objectMap["properties"] = us.UebaSettingsProperties + } + if us.Etag != nil { + objectMap["etag"] = us.Etag + } + if us.Kind != "" { + objectMap["kind"] = us.Kind + } + return json.Marshal(objectMap) +} + +// AsToggleSettings is the BasicSettings implementation for UebaSettings. +func (us UebaSettings) AsToggleSettings() (*ToggleSettings, bool) { + return nil, false +} + +// AsUebaSettings is the BasicSettings implementation for UebaSettings. +func (us UebaSettings) AsUebaSettings() (*UebaSettings, bool) { + return &us, true +} + +// AsSettings is the BasicSettings implementation for UebaSettings. +func (us UebaSettings) AsSettings() (*Settings, bool) { + return nil, false +} + +// AsBasicSettings is the BasicSettings implementation for UebaSettings. +func (us UebaSettings) AsBasicSettings() (BasicSettings, bool) { + return &us, true +} + +// UnmarshalJSON is the custom unmarshaler for UebaSettings struct. +func (us *UebaSettings) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var uebaSettingsProperties UebaSettingsProperties + err = json.Unmarshal(*v, &uebaSettingsProperties) + if err != nil { + return err + } + us.UebaSettingsProperties = &uebaSettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + us.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + us.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + us.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + us.Etag = &etag + } + case "kind": + if v != nil { + var kind KindBasicSettings + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + us.Kind = kind + } + } + } + + return nil +} + +// UebaSettingsProperties user and Entity Behavior Analytics settings property bag. +type UebaSettingsProperties struct { + // AtpLicenseStatus - READ-ONLY; Determines whether the tenant has ATP (Advanced Threat Protection) license. Possible values include: 'LicenseStatusEnabled', 'LicenseStatusDisabled' + AtpLicenseStatus LicenseStatus `json:"atpLicenseStatus,omitempty"` + // IsEnabled - Determines whether User and Entity Behavior Analytics is enabled for this workspace. + IsEnabled *bool `json:"isEnabled,omitempty"` + // StatusInMcas - READ-ONLY; Determines whether User and Entity Behavior Analytics is enabled from MCAS (Microsoft Cloud App Security). Possible values include: 'StatusInMcasEnabled', 'StatusInMcasDisabled' + StatusInMcas StatusInMcas `json:"statusInMcas,omitempty"` +} + +// UserInfo user information that made some action +type UserInfo struct { + // Email - READ-ONLY; The email of the user. + Email *string `json:"email,omitempty"` + // Name - READ-ONLY; The name of the user. + Name *string `json:"name,omitempty"` + // ObjectID - The object id of the user. + ObjectID *uuid.UUID `json:"objectId,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/operations.go new file mode 100644 index 0000000000000..39c94464e8aef --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/operations.go @@ -0,0 +1,147 @@ +package securityinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all operations available Azure Security Insights Resource Provider. +func (client OperationsClient) List(ctx context.Context) (result OperationsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.ol.Response.Response != nil { + sc = result.ol.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ol.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.ol, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-01-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.SecurityInsights/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationsList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationsList) (result OperationsList, err error) { + req, err := lastResults.operationsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "securityinsight.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "securityinsight.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/version.go new file mode 100644 index 0000000000000..3fb54aeb4f558 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight/version.go @@ -0,0 +1,30 @@ +package securityinsight + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + version.Number + " securityinsight/2020-01-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 265b3242490b8..8fddb0360520f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -68,6 +68,7 @@ github.com/Azure/azure-sdk-for-go/services/preview/operationsmanagement/mgmt/201 github.com/Azure/azure-sdk-for-go/services/preview/portal/mgmt/2019-01-01-preview/portal github.com/Azure/azure-sdk-for-go/services/preview/resources/mgmt/2018-03-01-preview/managementgroups github.com/Azure/azure-sdk-for-go/services/preview/security/mgmt/v1.0/security +github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight github.com/Azure/azure-sdk-for-go/services/preview/servicebus/mgmt/2018-01-01-preview/servicebus github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/2017-03-01-preview/sql github.com/Azure/azure-sdk-for-go/services/preview/sql/mgmt/v3.0/sql diff --git a/website/allowed-subcategories b/website/allowed-subcategories index 5397d02965085..372d9ef0d5c43 100644 --- a/website/allowed-subcategories +++ b/website/allowed-subcategories @@ -51,6 +51,7 @@ Recovery Services Redis Search Security Center +Sentinel Service Fabric Spring Cloud Storage diff --git a/website/azurerm.erb b/website/azurerm.erb index 2bd263ca1e846..c4102eaac3574 100644 --- a/website/azurerm.erb +++ b/website/azurerm.erb @@ -482,6 +482,10 @@ azurerm_route_table +
  • + azurerm_sentinel_alert_rule +
  • +
  • azurerm_servicebus_namespace
  • @@ -2239,6 +2243,15 @@ +
  • + Sentinel Resources + +
  • +
  • Service Fabric Resources
  • +
  • + Data Share Resources + +
  • + +
  • DevSpace Resources
  • diff --git a/website/docs/r/function_app_slot.html.markdown b/website/docs/r/function_app_slot.html.markdown new file mode 100644 index 0000000000000..d9ae3e2673f01 --- /dev/null +++ b/website/docs/r/function_app_slot.html.markdown @@ -0,0 +1,286 @@ +--- +subcategory: "App Service (Web Apps)" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_function_app_slot" +description: |- + Manages a Function App Deployment Slot. + +--- + +# azurerm_function_app_slot + +Manages a Function App deployment Slot. + +## Example Usage (with App Service Plan) + +```hcl +resource "azurerm_resource_group" "example" { + name = "azure-functions-test-rg" + location = "westus2" +} + +resource "azurerm_storage_account" "example" { + name = "functionsapptestsa" + resource_group_name = azurerm_resource_group.example.name + location = azurerm_resource_group.example.location + account_tier = "Standard" + account_replication_type = "LRS" +} + +resource "azurerm_app_service_plan" "example" { + name = "azure-functions-test-service-plan" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + + sku { + tier = "Standard" + size = "S1" + } +} + +resource "azurerm_function_app" "example" { + name = "test-azure-functions" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + app_service_plan_id = azurerm_app_service_plan.example.id + storage_connection_string = azurerm_storage_account.example.primary_connection_string +} + +resource "azurerm_function_app_slot" "example" { + name = "test-azure-functions_slot" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + app_service_plan_id = azurerm_app_service_plan.example.id + function_app_name = azurerm_function_app.example.name + storage_connection_string = azurerm_storage_account.example.primary_connection_string +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) Specifies the name of the Function App. Changing this forces a new resource to be created. + +* `resource_group_name` - (Required) The name of the resource group in which to create the Function App. + +* `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. + +* `app_service_plan_id` - (Required) The ID of the App Service Plan within which to create this Function App. + +* `storage_connection_string` - (Required) The connection string of the backend storage account which will be used by this Function App (such as the dashboard, logs). + +* `app_settings` - (Optional) A key-value pair of App Settings. + +~> **Note:** When integrating a `CI/CD pipeline` and expecting to run from a deployed package in `Azure` you must seed your `app settings` as part of terraform code for function app to be successfully deployed. `Important Default key pairs`: (`"WEBSITE_RUN_FROM_PACKAGE" = ""`, `"FUNCTIONS_WORKER_RUNTIME" = "node"` (or python, etc), `"WEBSITE_NODE_DEFAULT_VERSION" = "10.14.1"`, `"APPINSIGHTS_INSTRUMENTATIONKEY" = ""`). + +~> **Note:** When using an App Service Plan in the `Free` or `Shared` Tiers `use_32_bit_worker_process` must be set to `true`. + +* `auth_settings` - (Optional) A `auth_settings` block as defined below. + +* `enable_builtin_logging` - (Optional) Should the built-in logging of this Function App be enabled? Defaults to `true`. + +* `connection_string` - (Optional) An `connection_string` block as defined below. + +* `os_type` - (Optional) A string indicating the Operating System type for this function app. + +~> **NOTE:** This value will be `linux` for Linux Derivatives or an empty string for Windows (default). + +* `client_affinity_enabled` - (Optional) Should the Function App send session affinity cookies, which route client requests in the same session to the same instance? + +* `enabled` - (Optional) Is the Function App enabled? + +* `https_only` - (Optional) Can the Function App only be accessed via HTTPS? Defaults to `false`. + +* `version` - (Optional) The runtime version associated with the Function App. Defaults to `~1`. + +* `daily_memory_time_quota` - (Optional) The amount of memory in gigabyte-seconds that your application is allowed to consume per day. Setting this value only affects function apps under the consumption plan. Defaults to `0`. + +* `site_config` - (Optional) A `site_config` object as defined below. + +* `identity` - (Optional) An `identity` block as defined below. + +* `tags` - (Optional) A mapping of tags to assign to the resource. + +--- + +`connection_string` supports the following: + +* `name` - (Required) The name of the Connection String. +* `type` - (Required) The type of the Connection String. Possible values are `APIHub`, `Custom`, `DocDb`, `EventHub`, `MySQL`, `NotificationHub`, `PostgreSQL`, `RedisCache`, `ServiceBus`, `SQLAzure` and `SQLServer`. +* `value` - (Required) The value for the Connection String. + +--- + +`site_config` supports the following: + +* `always_on` - (Optional) Should the Function App be loaded at all times? Defaults to `false`. + +* `use_32_bit_worker_process` - (Optional) Should the Function App run in 32 bit mode, rather than 64 bit mode? Defaults to `true`. + +~> **Note:** when using an App Service Plan in the `Free` or `Shared` Tiers `use_32_bit_worker_process` must be set to `true`. + +* `websockets_enabled` - (Optional) Should WebSockets be enabled? + +* `linux_fx_version` - (Optional) Linux App Framework and version for the AppService, e.g. `DOCKER|(golang:latest)`. + +* `http2_enabled` - (Optional) Specifies whether or not the http2 protocol should be enabled. Defaults to `false`. + +* `min_tls_version` - (Optional) The minimum supported TLS version for the function app. Possible values are `1.0`, `1.1`, and `1.2`. Defaults to `1.2` for new function apps. + +* `ftps_state` - (Optional) State of FTP / FTPS service for this function app. Possible values include: `AllAllowed`, `FtpsOnly` and `Disabled`. + +* `cors` - (Optional) A `cors` block as defined below. + +* `ip_restriction` - (Optional) A [List of objects](/docs/configuration/attr-as-blocks.html) representing ip restrictions as defined below. + +--- + +A `cors` block supports the following: + +* `allowed_origins` - (Optional) A list of origins which should be able to make cross-origin calls. `*` can be used to allow all calls. + +* `support_credentials` - (Optional) Are credentials supported? + +--- + +An `identity` block supports the following: + +* `type` - (Required) Specifies the identity type of the Function App. Possible values are `SystemAssigned` (where Azure will generate a Service Principal for you), `UserAssigned` where you can specify the Service Principal IDs in the `identity_ids` field, and `SystemAssigned, UserAssigned` which assigns both a system managed identity as well as the specified user assigned identities. + +~> **NOTE:** When `type` is set to `SystemAssigned`, The assigned `principal_id` and `tenant_id` can be retrieved after the Function App has been created. More details are available below. + +* `identity_ids` - (Optional) Specifies a list of user managed identity ids to be assigned. Required if `type` is `UserAssigned`. + +--- + +An `auth_settings` block supports the following: + +* `enabled` - (Required) Is Authentication enabled? + +* `active_directory` - (Optional) A `active_directory` block as defined below. + +* `additional_login_params` - (Optional) Login parameters to send to the OpenID Connect authorization endpoint when a user logs in. Each parameter must be in the form "key=value". + +* `allowed_external_redirect_urls` - (Optional) External URLs that can be redirected to as part of logging in or logging out of the app. + +* `default_provider` - (Optional) The default provider to use when multiple providers have been set up. Possible values are `AzureActiveDirectory`, `Facebook`, `Google`, `MicrosoftAccount` and `Twitter`. + +~> **NOTE:** When using multiple providers, the default provider must be set for settings like `unauthenticated_client_action` to work. + +* `facebook` - (Optional) A `facebook` block as defined below. + +* `google` - (Optional) A `google` block as defined below. + +* `issuer` - (Optional) Issuer URI. When using Azure Active Directory, this value is the URI of the directory tenant, e.g. https://sts.windows.net/{tenant-guid}/. + +* `microsoft` - (Optional) A `microsoft` block as defined below. + +* `runtime_version` - (Optional) The runtime version of the Authentication/Authorization module. + +* `token_refresh_extension_hours` - (Optional) The number of hours after session token expiration that a session token can be used to call the token refresh API. Defaults to 72. + +* `token_store_enabled` - (Optional) If enabled the module will durably store platform-specific security tokens that are obtained during login flows. Defaults to false. + +* `twitter` - (Optional) A `twitter` block as defined below. + +* `unauthenticated_client_action` - (Optional) The action to take when an unauthenticated client attempts to access the app. Possible values are `AllowAnonymous` and `RedirectToLoginPage`. + +--- + +An `active_directory` block supports the following: + +* `client_id` - (Required) The Client ID of this relying party application. Enables OpenIDConnection authentication with Azure Active Directory. + +* `client_secret` - (Optional) The Client Secret of this relying party application. If no secret is provided, implicit flow will be used. + +* `allowed_audiences` (Optional) Allowed audience values to consider when validating JWTs issued by Azure Active Directory. + +--- + +A `facebook` block supports the following: + +* `app_id` - (Required) The App ID of the Facebook app used for login + +* `app_secret` - (Required) The App Secret of the Facebook app used for Facebook Login. + +* `oauth_scopes` (Optional) The OAuth 2.0 scopes that will be requested as part of Facebook Login authentication. https://developers.facebook.com/docs/facebook-login + +--- + +A `google` block supports the following: + +* `client_id` - (Required) The OpenID Connect Client ID for the Google web application. + +* `client_secret` - (Required) The client secret associated with the Google web application. + +* `oauth_scopes` (Optional) The OAuth 2.0 scopes that will be requested as part of Google Sign-In authentication. https://developers.google.com/identity/sign-in/web/ + +--- + +A `microsoft` block supports the following: + +* `client_id` - (Required) The OAuth 2.0 client ID that was created for the app used for authentication. + +* `client_secret` - (Required) The OAuth 2.0 client secret that was created for the app used for authentication. + +* `oauth_scopes` (Optional) The OAuth 2.0 scopes that will be requested as part of Microsoft Account authentication. https://msdn.microsoft.com/en-us/library/dn631845.aspx + +--- + +A `ip_restriction` block supports the following: + +* `ip_address` - (Optional) The IP Address CIDR notation used for this IP Restriction. + +* `subnet_id` - (Optional) The Subnet ID used for this IP Restriction. + +-> **NOTE:** One of either `ip_address` or `subnet_id` must be specified + +## Attributes Reference + +The following attributes are exported: + +* `id` - The ID of the Function App + +* `default_hostname` - The default hostname associated with the Function App - such as `mysite.azurewebsites.net` + +* `outbound_ip_addresses` - A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12` + +* `possible_outbound_ip_addresses` - A comma separated list of outbound IP addresses - such as `52.23.25.3,52.143.43.12,52.143.43.17` - not all of which are necessarily in use. Superset of `outbound_ip_addresses`. + +* `identity` - An `identity` block as defined below, which contains the Managed Service Identity information for this App Service. + +* `site_credential` - A `site_credential` block as defined below, which contains the site-level credentials used to publish to this App Service. + +* `kind` - The Function App kind - such as `functionapp,linux,container` + +--- + +The `identity` block exports the following: + +* `principal_id` - The Principal ID for the Service Principal associated with the Managed Service Identity of this App Service. + +* `tenant_id` - The Tenant ID for the Service Principal associated with the Managed Service Identity of this App Service. + + +The `site_credential` block exports the following: + +* `username` - The username which can be used to publish to this App Service +* `password` - The password associated with the username, which can be used to publish to this App Service. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the Function App Deployment Slot. +* `update` - (Defaults to 30 minutes) Used when updating the Function App Deployment Slot. +* `read` - (Defaults to 5 minutes) Used when retrieving the Function App Deployment Slot. +* `delete` - (Defaults to 30 minutes) Used when deleting the Function App Deployment Slot. + +## Import + +Function Apps Deployment Slots can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_function_app.functionapp1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Web/sites/functionapp1/slots/staging +``` From 9e8bc29beff89cc6e851a283e3901901b983f602 Mon Sep 17 00:00:00 2001 From: Aris van Ommeren Date: Mon, 13 Apr 2020 12:50:46 +0200 Subject: [PATCH 131/223] rename filename --- ...rce_arm_function_slot.go => resource_arm_function_app_slot.go} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/web/{resource_arm_function_slot.go => resource_arm_function_app_slot.go} (100%) diff --git a/azurerm/internal/services/web/resource_arm_function_slot.go b/azurerm/internal/services/web/resource_arm_function_app_slot.go similarity index 100% rename from azurerm/internal/services/web/resource_arm_function_slot.go rename to azurerm/internal/services/web/resource_arm_function_app_slot.go From bd17edd3231bfadc227473299ca485517c69207e Mon Sep 17 00:00:00 2001 From: Aris van Ommeren Date: Mon, 13 Apr 2020 23:04:30 +0200 Subject: [PATCH 132/223] extra function version test --- .../resource_arm_function_app_slot_test.go | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/azurerm/internal/services/web/tests/resource_arm_function_app_slot_test.go b/azurerm/internal/services/web/tests/resource_arm_function_app_slot_test.go index 2f8efb2f14d3c..e0394bb7636bc 100644 --- a/azurerm/internal/services/web/tests/resource_arm_function_app_slot_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_function_app_slot_test.go @@ -510,6 +510,32 @@ func TestAccAzureRMFunctionAppSlot_updateManageServiceIdentity(t *testing.T) { }) } +func TestAccAzureRMFunctionAppSlot_updateVersion(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_function_app_slot", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMFunctionAppDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMFunctionAppSlot_version(data, "~1"), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMFunctionAppSlotExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "version", "~1"), + ), + }, + { + Config: testAccAzureRMFunctionAppSlot_version(data, "~2"), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMFunctionAppSlotExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "version", "~2"), + ), + }, + }, + }) +} + func TestAccAzureRMFunctionAppSlot_userAssignedIdentity(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_function_app_slot", "test") @@ -1798,6 +1824,56 @@ resource "azurerm_function_app_slot" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomString, data.RandomInteger, data.RandomInteger) } +func testAccAzureRMFunctionAppSlot_version(data acceptance.TestData, version string) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_app_service_plan" "test" { + name = "acctestASP-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + sku { + tier = "Standard" + size = "S1" + } +} + +resource "azurerm_storage_account" "test" { + name = "acctestsa%s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" +} + +resource "azurerm_function_app" "test" { + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_connection_string = azurerm_storage_account.test.primary_connection_string +} + +resource "azurerm_function_app_slot" "test" { + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_connection_string = azurerm_storage_account.test.primary_connection_string + version = "%s" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomString, data.RandomInteger, data.RandomInteger, version) +} + func testAccAzureRMFunctionAppSlot_userAssignedIdentity(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { From d048804091bf52641856f5bb6bf7e7335c6784c8 Mon Sep 17 00:00:00 2001 From: Aris van Ommeren Date: Fri, 1 May 2020 17:46:57 +0200 Subject: [PATCH 133/223] fix comments --- .../services/web/data_source_function_app.go | 3 +- .../web/{ => parse}/function_app_slot.go | 4 +- .../services/web/resource_arm_app_service.go | 14 +- .../web/resource_arm_app_service_slot.go | 3 +- .../services/web/resource_arm_function_app.go | 3 +- .../web/resource_arm_function_app_slot.go | 217 +++++-- .../resource_arm_function_app_slot_test.go | 575 ++++++++++-------- .../services/web/validate/app_service.go | 16 + .../internal/services/web/validation_test.go | 8 +- .../docs/r/function_app_slot.html.markdown | 6 +- 10 files changed, 503 insertions(+), 346 deletions(-) rename azurerm/internal/services/web/{ => parse}/function_app_slot.go (89%) create mode 100644 azurerm/internal/services/web/validate/app_service.go diff --git a/azurerm/internal/services/web/data_source_function_app.go b/azurerm/internal/services/web/data_source_function_app.go index bf4eb6e7a738e..1c75bdd9dc6d2 100644 --- a/azurerm/internal/services/web/data_source_function_app.go +++ b/azurerm/internal/services/web/data_source_function_app.go @@ -8,6 +8,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + webValidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/web/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" @@ -25,7 +26,7 @@ func dataSourceArmFunctionApp() *schema.Resource { "name": { Type: schema.TypeString, Required: true, - ValidateFunc: validateAppServiceName, + ValidateFunc: webValidate.AppServiceName, }, "resource_group_name": azure.SchemaResourceGroupNameForDataSource(), diff --git a/azurerm/internal/services/web/function_app_slot.go b/azurerm/internal/services/web/parse/function_app_slot.go similarity index 89% rename from azurerm/internal/services/web/function_app_slot.go rename to azurerm/internal/services/web/parse/function_app_slot.go index c045bba18b1e0..5672365f70a89 100644 --- a/azurerm/internal/services/web/function_app_slot.go +++ b/azurerm/internal/services/web/parse/function_app_slot.go @@ -1,4 +1,4 @@ -package web +package parse import ( "fmt" @@ -12,7 +12,7 @@ type FunctionAppSlotResourceID struct { Name string } -func ParseFunctionAppSlotID(input string) (*FunctionAppSlotResourceID, error) { +func FunctionAppSlotID(input string) (*FunctionAppSlotResourceID, error) { id, err := azure.ParseAzureResourceID(input) if err != nil { return nil, fmt.Errorf("[ERROR] Unable to parse App Service Slot ID %q: %+v", input, err) diff --git a/azurerm/internal/services/web/resource_arm_app_service.go b/azurerm/internal/services/web/resource_arm_app_service.go index ba625f76bc479..6cc4c00455c39 100644 --- a/azurerm/internal/services/web/resource_arm_app_service.go +++ b/azurerm/internal/services/web/resource_arm_app_service.go @@ -3,7 +3,6 @@ package web import ( "fmt" "log" - "regexp" "time" "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2019-08-01/web" @@ -14,6 +13,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/web/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" azSchema "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" @@ -44,7 +44,7 @@ func resourceArmAppService() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validateAppServiceName, + ValidateFunc: validate.AppServiceName, }, "identity": azure.SchemaAppServiceIdentity(), @@ -760,16 +760,6 @@ func flattenAppServiceAppSettings(input map[string]*string) map[string]string { return output } -func validateAppServiceName(v interface{}, k string) (warnings []string, errors []error) { - value := v.(string) - - if matched := regexp.MustCompile(`^[0-9a-zA-Z-]{1,60}$`).Match([]byte(value)); !matched { - errors = append(errors, fmt.Errorf("%q may only contain alphanumeric characters and dashes and up to 60 characters in length", k)) - } - - return warnings, errors -} - func flattenAppServiceSiteCredential(input *web.UserProperties) []interface{} { results := make([]interface{}, 0) result := make(map[string]interface{}) diff --git a/azurerm/internal/services/web/resource_arm_app_service_slot.go b/azurerm/internal/services/web/resource_arm_app_service_slot.go index e134aa8b1ab10..abf2a96daf91e 100644 --- a/azurerm/internal/services/web/resource_arm_app_service_slot.go +++ b/azurerm/internal/services/web/resource_arm_app_service_slot.go @@ -13,6 +13,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + webValidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/web/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" azSchema "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" @@ -42,7 +43,7 @@ func resourceArmAppServiceSlot() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validateAppServiceName, + ValidateFunc: webValidate.AppServiceName, }, "resource_group_name": azure.SchemaResourceGroupName(), diff --git a/azurerm/internal/services/web/resource_arm_function_app.go b/azurerm/internal/services/web/resource_arm_function_app.go index fccdac4a91baf..47870acde88cb 100644 --- a/azurerm/internal/services/web/resource_arm_function_app.go +++ b/azurerm/internal/services/web/resource_arm_function_app.go @@ -17,6 +17,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage" + webValidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/web/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" azSchema "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" @@ -48,7 +49,7 @@ func resourceArmFunctionApp() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validateAppServiceName, + ValidateFunc: webValidate.AppServiceName, }, "resource_group_name": azure.SchemaResourceGroupName(), diff --git a/azurerm/internal/services/web/resource_arm_function_app_slot.go b/azurerm/internal/services/web/resource_arm_function_app_slot.go index 7bbf47e2b3d80..2fbec1ca8ec19 100644 --- a/azurerm/internal/services/web/resource_arm_function_app_slot.go +++ b/azurerm/internal/services/web/resource_arm_function_app_slot.go @@ -14,7 +14,9 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/storage" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/web/parse" + webValidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/web/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tags" azSchema "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" @@ -28,7 +30,7 @@ func resourceArmFunctionAppSlot() *schema.Resource { Update: resourceArmFunctionAppSlotUpdate, Delete: resourceArmFunctionAppSlotDelete, Importer: azSchema.ValidateResourceIDPriorToImport(func(id string) error { - _, err := ParseFunctionAppSlotID(id) + _, err := parse.FunctionAppSlotID(id) return err }), @@ -53,20 +55,17 @@ func resourceArmFunctionAppSlot() *schema.Resource { "identity": azure.SchemaAppServiceIdentity(), "function_app_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - - "kind": { - Type: schema.TypeString, - Computed: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: webValidate.AppServiceName, }, "app_service_plan_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: ValidateAppServicePlanID, }, "version": { @@ -75,11 +74,18 @@ func resourceArmFunctionAppSlot() *schema.Resource { Default: "~1", }, - "storage_connection_string": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - Sensitive: true, + "storage_account_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: storage.ValidateArmStorageAccountName, + }, + + "storage_account_access_key": { + Type: schema.TypeString, + Required: true, + Sensitive: true, + ValidateFunc: validation.NoZeroValues, }, "app_settings": { @@ -90,16 +96,27 @@ func resourceArmFunctionAppSlot() *schema.Resource { }, }, + "daily_memory_time_quota": { + Type: schema.TypeInt, + Optional: true, + }, + + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: true, + }, + "enable_builtin_logging": { Type: schema.TypeBool, Optional: true, Default: true, }, - "client_affinity_enabled": { + "https_only": { Type: schema.TypeBool, Optional: true, - Computed: true, + Default: false, }, "os_type": { @@ -111,21 +128,10 @@ func resourceArmFunctionAppSlot() *schema.Resource { }, false), }, - "https_only": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "enabled": { + "client_affinity_enabled": { Type: schema.TypeBool, Optional: true, - Default: true, - }, - - "daily_memory_time_quota": { - Type: schema.TypeInt, - Optional: true, + Computed: true, }, "connection_string": { @@ -170,6 +176,11 @@ func resourceArmFunctionAppSlot() *schema.Resource { Computed: true, }, + "kind": { + Type: schema.TypeString, + Computed: true, + }, + "outbound_ip_addresses": { Type: schema.TypeString, Computed: true, @@ -284,14 +295,17 @@ func resourceArmFunctionAppSlot() *schema.Resource { func resourceArmFunctionAppSlotCreate(d *schema.ResourceData, meta interface{}) error { client := meta.(*clients.Client).Web.AppServicesClient + endpointSuffix := meta.(*clients.Client).Account.Environment.StorageEndpointSuffix ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) defer cancel() + log.Printf("[INFO] preparing arguments for AzureRM Function App Slot creation.") + slot := d.Get("name").(string) resourceGroup := d.Get("resource_group_name").(string) functionAppName := d.Get("function_app_name").(string) - if features.ShouldResourcesBeImported() && d.IsNewResource() { + if d.IsNewResource() { existing, err := client.GetSlot(ctx, resourceGroup, functionAppName, slot) if err != nil { if !utils.ResponseWasNotFound(existing.Response) { @@ -313,18 +327,22 @@ func resourceArmFunctionAppSlotCreate(d *schema.ResourceData, meta interface{}) } } - appServicePlanId := d.Get("app_service_plan_id").(string) + appServicePlanID := d.Get("app_service_plan_id").(string) enabled := d.Get("enabled").(bool) clientAffinityEnabled := d.Get("client_affinity_enabled").(bool) httpsOnly := d.Get("https_only").(bool) dailyMemoryTimeQuota := d.Get("daily_memory_time_quota").(int) t := d.Get("tags").(map[string]interface{}) - appServiceTier, err := getFunctionAppServiceTier(ctx, appServicePlanId, meta) + appServiceTier, err := getFunctionAppServiceTier(ctx, appServicePlanID, meta) + if err != nil { + return err + } + + basicAppSettings, err := getBasicFunctionAppSlotAppSettings(d, appServiceTier, endpointSuffix) if err != nil { return err } - basicAppSettings := getBasicFunctionAppAppSettings(d, appServiceTier) siteConfig, err := expandFunctionAppSiteConfig(d) if err != nil { return fmt.Errorf("Error expanding `site_config` for Function App Slot %q (Resource Group %q): %s", slot, resourceGroup, err) @@ -337,7 +355,7 @@ func resourceArmFunctionAppSlotCreate(d *schema.ResourceData, meta interface{}) Location: &location, Tags: tags.Expand(t), SiteProperties: &web.SiteProperties{ - ServerFarmID: utils.String(appServicePlanId), + ServerFarmID: utils.String(appServicePlanID), Enabled: utils.Bool(enabled), ClientAffinityEnabled: utils.Bool(clientAffinityEnabled), HTTPSOnly: utils.Bool(httpsOnly), @@ -354,19 +372,18 @@ func resourceArmFunctionAppSlotCreate(d *schema.ResourceData, meta interface{}) createFuture, err := client.CreateOrUpdateSlot(ctx, resourceGroup, functionAppName, siteEnvelope, slot) if err != nil { - return fmt.Errorf("Error creating Slot %q (Function App %q / Resource Group %q): %s", slot, functionAppName, resourceGroup, err) + return err } err = createFuture.WaitForCompletionRef(ctx, client.Client) if err != nil { - return fmt.Errorf("Error waiting for creation of Slot %q (Function App %q / Resource Group %q): %s", slot, functionAppName, resourceGroup, err) + return err } read, err := client.GetSlot(ctx, resourceGroup, functionAppName, slot) if err != nil { - return fmt.Errorf("Error retrieving Slot %q (Function App %q / Resource Group %q): %s", slot, functionAppName, resourceGroup, err) + return err } - if read.ID == nil { return fmt.Errorf("Cannot read ID for Slot %q (Function App %q / Resource Group %q) ID", slot, functionAppName, resourceGroup) } @@ -389,10 +406,11 @@ func resourceArmFunctionAppSlotCreate(d *schema.ResourceData, meta interface{}) func resourceArmFunctionAppSlotUpdate(d *schema.ResourceData, meta interface{}) error { client := meta.(*clients.Client).Web.AppServicesClient + endpointSuffix := meta.(*clients.Client).Account.Environment.StorageEndpointSuffix ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := ParseFunctionAppSlotID(d.Id()) + id, err := parse.FunctionAppSlotID(d.Id()) if err != nil { return err } @@ -405,19 +423,23 @@ func resourceArmFunctionAppSlotUpdate(d *schema.ResourceData, meta interface{}) kind = "functionapp,linux" } } - appServicePlanId := d.Get("app_service_plan_id").(string) + appServicePlanID := d.Get("app_service_plan_id").(string) enabled := d.Get("enabled").(bool) clientAffinityEnabled := d.Get("client_affinity_enabled").(bool) httpsOnly := d.Get("https_only").(bool) dailyMemoryTimeQuota := d.Get("daily_memory_time_quota").(int) t := d.Get("tags").(map[string]interface{}) - appServiceTier, err := getFunctionAppServiceTier(ctx, appServicePlanId, meta) + appServiceTier, err := getFunctionAppServiceTier(ctx, appServicePlanID, meta) + if err != nil { + return err + } + basicAppSettings, err := getBasicFunctionAppSlotAppSettings(d, appServiceTier, endpointSuffix) if err != nil { return err } - basicAppSettings := getBasicFunctionAppAppSettings(d, appServiceTier) + siteConfig, err := expandFunctionAppSiteConfig(d) if err != nil { return fmt.Errorf("Error expanding `site_config` for Slot %q (Function App %q / Resource Group %q): %s", id.Name, id.FunctionAppName, id.ResourceGroup, err) @@ -430,7 +452,7 @@ func resourceArmFunctionAppSlotUpdate(d *schema.ResourceData, meta interface{}) Location: &location, Tags: tags.Expand(t), SiteProperties: &web.SiteProperties{ - ServerFarmID: utils.String(appServicePlanId), + ServerFarmID: utils.String(appServicePlanID), Enabled: utils.Bool(enabled), ClientAffinityEnabled: utils.Bool(clientAffinityEnabled), HTTPSOnly: utils.Bool(httpsOnly), @@ -455,7 +477,10 @@ func resourceArmFunctionAppSlotUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error waiting for update of Slot %q (Function App %q / Resource Group %q): %s", id.Name, id.FunctionAppName, id.ResourceGroup, err) } - appSettings := expandFunctionAppAppSettings(d, appServiceTier) + appSettings, err := expandFunctionAppAppSettings(d, appServiceTier, endpointSuffix) + if err != nil { + return err + } settings := web.StringDictionary{ Properties: appSettings, } @@ -510,7 +535,7 @@ func resourceArmFunctionAppSlotRead(d *schema.ResourceData, meta interface{}) er ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := ParseFunctionAppSlotID(d.Id()) + id, err := parse.FunctionAppSlotID(d.Id()) if err != nil { return err } @@ -518,27 +543,26 @@ func resourceArmFunctionAppSlotRead(d *schema.ResourceData, meta interface{}) er resp, err := client.GetSlot(ctx, id.ResourceGroup, id.FunctionAppName, id.Name) if err != nil { if utils.ResponseWasNotFound(resp.Response) { - log.Printf("[DEBUG] Slot %q (Function App %q / Resource Group %q) were not found - removing from state!", id.Name, id.FunctionAppName, id.ResourceGroup) + log.Printf("[DEBUG] Function App Slot %q (Function App %q / Resource Group %q) was not found - removing from state", id.Name, id.FunctionAppName, id.ResourceGroup) d.SetId("") return nil } - - return fmt.Errorf("Error reading Slot %q (Function App %q / Resource Group %q): %s", id.Name, id.FunctionAppName, id.ResourceGroup, err) + return fmt.Errorf("Error makeing read request on AzureRM Function App Slot %q (Function App %q / Resource Group %q): %s", id.Name, id.FunctionAppName, id.ResourceGroup, err) } appSettingsResp, err := client.ListApplicationSettingsSlot(ctx, id.ResourceGroup, id.FunctionAppName, id.Name) if err != nil { if utils.ResponseWasNotFound(appSettingsResp.Response) { - log.Printf("[DEBUG] Application Settings of Slot %q (Function App %q / Resource Group %q) were not found", id.Name, id.FunctionAppName, id.ResourceGroup) + log.Printf("[DEBUG] Application Settings of AzureRM Function App Slot %q (Function App %q / Resource Group %q) were not found", id.Name, id.FunctionAppName, id.ResourceGroup) d.SetId("") return nil } - return fmt.Errorf("Error making Read request on Slot %q (Function App %q / Resource Group %q) AppSettings: %+v", id.Name, id.FunctionAppName, id.ResourceGroup, err) + return fmt.Errorf("Error making Read request on AzureRM Function App Slot %q (Function App %q / Resource Group %q) AppSettings: %+v", id.Name, id.FunctionAppName, id.ResourceGroup, err) } connectionStringsResp, err := client.ListConnectionStringsSlot(ctx, id.ResourceGroup, id.FunctionAppName, id.Name) if err != nil { - return fmt.Errorf("Error making Read request on Slot %q (Function App %q / Resource Group %q) ConnectionStrings: %+v", id.Name, id.FunctionAppName, id.ResourceGroup, err) + return fmt.Errorf("Error making Read request on AzureRM Function App Slot %q (Function App %q / Resource Group %q) ConnectionStrings: %+v", id.Name, id.FunctionAppName, id.ResourceGroup, err) } siteCredFuture, err := client.ListPublishingCredentialsSlot(ctx, id.ResourceGroup, id.FunctionAppName, id.Name) @@ -551,11 +575,11 @@ func resourceArmFunctionAppSlotRead(d *schema.ResourceData, meta interface{}) er } siteCredResp, err := siteCredFuture.Result(*client) if err != nil { - return fmt.Errorf("Error making Read request on Slot %q (Function App %q / Resource Group %q) Site Credentials: %+v", id.Name, id.FunctionAppName, id.ResourceGroup, err) + return fmt.Errorf("Error making Read request on AzureRM Function App Slot %q (Function App %q / Resource Group %q) Site Credentials: %+v", id.Name, id.FunctionAppName, id.ResourceGroup, err) } authResp, err := client.GetAuthSettingsSlot(ctx, id.ResourceGroup, id.FunctionAppName, id.Name) if err != nil { - return fmt.Errorf("Error retrieving the AuthSettings for Slot %q (Function App %q / Resource Group %q): %+v", id.Name, id.FunctionAppName, id.ResourceGroup, err) + return fmt.Errorf("Error retrieving the AuthSettings for AzureRM Function App Slot %q (Function App %q / Resource Group %q): %+v", id.Name, id.FunctionAppName, id.ResourceGroup, err) } d.Set("name", id.Name) @@ -585,7 +609,25 @@ func resourceArmFunctionAppSlotRead(d *schema.ResourceData, meta interface{}) er appSettings := flattenAppServiceAppSettings(appSettingsResp.Properties) - d.Set("storage_connection_string", appSettings["AzureWebJobsStorage"]) + connectionString := appSettings["AzureWebJobsStorage"] + + // This teases out the necessary attributes from the storage connection string + connectionStringParts := strings.Split(connectionString, ";") + for _, part := range connectionStringParts { + if strings.HasPrefix(part, "AccountName") { + accountNameParts := strings.Split(part, "AccountName=") + if len(accountNameParts) > 1 { + d.Set("storage_account_name", accountNameParts[1]) + } + } + if strings.HasPrefix(part, "AccountKey") { + accountKeyParts := strings.Split(part, "AccountKey=") + if len(accountKeyParts) > 1 { + d.Set("storage_account_access_key", accountKeyParts[1]) + } + } + } + d.Set("version", appSettings["FUNCTIONS_EXTENSION_VERSION"]) dashboard, ok := appSettings["AzureWebJobsDashboard"] @@ -637,21 +679,74 @@ func resourceArmFunctionAppSlotDelete(d *schema.ResourceData, meta interface{}) ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) defer cancel() - id, err := ParseFunctionAppSlotID(d.Id()) + id, err := parse.FunctionAppSlotID(d.Id()) if err != nil { return err } - log.Printf("[DEBUG] Deleting Slot %q (Function App %q / Resource Group %q)", id.Name, id.FunctionAppName, id.ResourceGroup) + log.Printf("[DEBUG] Deleting Function App Slot %q (Function App %q / Resource Group %q)", id.Name, id.FunctionAppName, id.ResourceGroup) deleteMetrics := true deleteEmptyServerFarm := false resp, err := client.DeleteSlot(ctx, id.ResourceGroup, id.FunctionAppName, id.Name, &deleteMetrics, &deleteEmptyServerFarm) if err != nil { if !utils.ResponseWasNotFound(resp) { - return fmt.Errorf("Error deleting Slot %q (Function App %q / Resource Group %q): %s", id.Name, id.FunctionAppName, id.ResourceGroup, err) + return err } } return nil } + +func getBasicFunctionAppSlotAppSettings(d *schema.ResourceData, appServiceTier, endpointSuffix string) ([]web.NameValuePair, error) { + // TODO: This is a workaround since there are no public Functions API + // You may track the API request here: https://github.com/Azure/azure-rest-api-specs/issues/3750 + dashboardPropName := "AzureWebJobsDashboard" + storagePropName := "AzureWebJobsStorage" + functionVersionPropName := "FUNCTIONS_EXTENSION_VERSION" + contentSharePropName := "WEBSITE_CONTENTSHARE" + contentFileConnStringPropName := "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING" + + storageAccount := "" + if v, ok := d.GetOk("storage_account_name"); ok { + storageAccount = v.(string) + } + + connectionString := "" + if v, ok := d.GetOk("storage_account_access_key"); ok { + connectionString = v.(string) + } + + if storageAccount == "" && connectionString == "" { + return nil, fmt.Errorf("both `storage_account_name` and `storage_account_access_key` must be specified") + } + + storageConnection := fmt.Sprintf("DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s;EndpointSuffix=%s", storageAccount, connectionString, endpointSuffix) + + functionVersion := d.Get("version").(string) + contentShare := strings.ToLower(d.Get("name").(string)) + "-content" + + basicSettings := []web.NameValuePair{ + {Name: &storagePropName, Value: &storageConnection}, + {Name: &functionVersionPropName, Value: &functionVersion}, + } + + if d.Get("enable_builtin_logging").(bool) { + basicSettings = append(basicSettings, web.NameValuePair{ + Name: &dashboardPropName, + Value: &storageConnection, + }) + } + + consumptionSettings := []web.NameValuePair{ + {Name: &contentSharePropName, Value: &contentShare}, + {Name: &contentFileConnStringPropName, Value: &storageConnection}, + } + + // On consumption and premium plans include WEBSITE_CONTENT components + if strings.EqualFold(appServiceTier, "dynamic") || strings.EqualFold(appServiceTier, "elasticpremium") { + return append(basicSettings, consumptionSettings...), nil + } + + return basicSettings, nil +} diff --git a/azurerm/internal/services/web/tests/resource_arm_function_app_slot_test.go b/azurerm/internal/services/web/tests/resource_arm_function_app_slot_test.go index e0394bb7636bc..d09617445c33e 100644 --- a/azurerm/internal/services/web/tests/resource_arm_function_app_slot_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_function_app_slot_test.go @@ -151,6 +151,7 @@ func TestAccAzureRMFunctionAppSlot_clientAffinityEnabledUpdate(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "client_affinity_enabled", "true"), ), }, + data.ImportStep(), { Config: testAccAzureRMFunctionAppSlot_clientAffinityEnabled(data, false), Check: resource.ComposeTestCheckFunc( @@ -182,6 +183,7 @@ func TestAccAzureRMFunctionAppSlot_connectionStrings(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "connection_string.2442860602.type", "PostgreSQL"), ), }, + data.ImportStep(), { Config: testAccAzureRMFunctionAppSlot_connectionStringsUpdated(data), Check: resource.ComposeTestCheckFunc( @@ -714,20 +716,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomString, data.RandomInteger, data.RandomInteger) } @@ -738,12 +742,13 @@ func testAccAzureRMFunctionAppSlot_requiresImport(data acceptance.TestData) stri %s resource "azurerm_function_app_slot" "import" { - name = azurerm_function_app_slot.test.name - location = azurerm_function_app_slot.test.location - resource_group_name = azurerm_function_app_slot.test.resource_group_name - app_service_plan_id = azurerm_function_app_slot.test.app_service_plan_id - function_app_name = azurerm_function_app_slot.test.function_app_name - storage_connection_string = azurerm_function_app_slot.test.storage_connection_string + name = azurerm_function_app_slot.test.name + location = azurerm_function_app_slot.test.location + resource_group_name = azurerm_function_app_slot.test.resource_group_name + app_service_plan_id = azurerm_function_app_slot.test.app_service_plan_id + function_app_name = azurerm_function_app_slot.test.function_app_name + storage_account_name = azurerm_function_app_slot.test.name + storage_account_access_key = azurerm_function_app_slot.test.primary_access_key } `, template) } @@ -779,20 +784,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { use_32_bit_worker_process = true @@ -832,20 +839,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { always_on = true @@ -885,20 +894,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key app_settings = { "foo" = "bar" @@ -938,21 +949,23 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string - client_affinity_enabled = %t + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key + client_affinity_enabled = %t } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomString, data.RandomInteger, data.RandomInteger, clientAffinityEnabled) } @@ -988,20 +1001,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key connection_string { name = "First" @@ -1049,20 +1064,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key connection_string { name = "Second" @@ -1110,20 +1127,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { cors { @@ -1170,20 +1189,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctest-%d-func" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctest-%d-func" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key auth_settings { enabled = true @@ -1245,21 +1266,23 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string - enabled = %t + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key + enabled = %t } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomString, data.RandomInteger, data.RandomInteger, enabled) } @@ -1295,21 +1318,23 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string - https_only = %t + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key + https_only = %t } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomString, data.RandomInteger, data.RandomInteger, httpsOnly) } @@ -1345,20 +1370,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { http2_enabled = true @@ -1398,20 +1425,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { ip_restriction { @@ -1467,20 +1496,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { ip_restriction { @@ -1522,20 +1553,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { ip_restriction = [] @@ -1575,20 +1608,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { ip_restriction { @@ -1642,20 +1677,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key tags = { Hello = "World" @@ -1695,20 +1732,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key tags = { "Hello" = "World" @@ -1749,20 +1788,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { websockets_enabled = true @@ -1802,20 +1843,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key identity { type = "SystemAssigned" @@ -1855,21 +1898,23 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string - version = "%s" + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key + version = "%s" } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomString, data.RandomInteger, data.RandomInteger, version) } @@ -1911,20 +1956,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key identity { type = "UserAssigned" @@ -1965,20 +2012,22 @@ resource "azurerm_storage_account" "test" { } resource "azurerm_function_app" "test" { - name = "acctestFA-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key } resource "azurerm_function_app_slot" "test" { - name = "acctestFASlot-%d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - app_service_plan_id = azurerm_app_service_plan.test.id - function_app_name = azurerm_function_app.test.name - storage_connection_string = azurerm_storage_account.test.primary_connection_string + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key site_config { min_tls_version = "%s" diff --git a/azurerm/internal/services/web/validate/app_service.go b/azurerm/internal/services/web/validate/app_service.go new file mode 100644 index 0000000000000..71b389e716aea --- /dev/null +++ b/azurerm/internal/services/web/validate/app_service.go @@ -0,0 +1,16 @@ +package validate + +import ( + "fmt" + "regexp" +) + +func AppServiceName(v interface{}, k string) (warnings []string, errors []error) { + value := v.(string) + + if matched := regexp.MustCompile(`^[0-9a-zA-Z-]{1,60}$`).Match([]byte(value)); !matched { + errors = append(errors, fmt.Errorf("%q may only contain alphanumeric characters and dashes and up to 60 characters in length", k)) + } + + return warnings, errors +} diff --git a/azurerm/internal/services/web/validation_test.go b/azurerm/internal/services/web/validation_test.go index 212ac37d14ae7..2c185af0baacb 100644 --- a/azurerm/internal/services/web/validation_test.go +++ b/azurerm/internal/services/web/validation_test.go @@ -1,6 +1,10 @@ package web -import "testing" +import ( + "testing" + + webValidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/web/validate" +) func TestAzureRMAppServicePlanName_validation(t *testing.T) { cases := []struct { @@ -74,7 +78,7 @@ func TestAzureRMAppServiceName_validation(t *testing.T) { } for _, tc := range cases { - _, errors := validateAppServiceName(tc.Value, "azurerm_app_service") + _, errors := webValidate.AppServiceName(tc.Value, "azurerm_app_service") if len(errors) != tc.ErrCount { t.Fatalf("Expected the App Service Name to trigger a validation error for '%s'", tc.Value) diff --git a/website/docs/r/function_app_slot.html.markdown b/website/docs/r/function_app_slot.html.markdown index d9ae3e2673f01..ad5011716f4d1 100644 --- a/website/docs/r/function_app_slot.html.markdown +++ b/website/docs/r/function_app_slot.html.markdown @@ -76,11 +76,11 @@ The following arguments are supported: ~> **Note:** When using an App Service Plan in the `Free` or `Shared` Tiers `use_32_bit_worker_process` must be set to `true`. -* `auth_settings` - (Optional) A `auth_settings` block as defined below. +* `auth_settings` - (Optional) An `auth_settings` block as defined below. * `enable_builtin_logging` - (Optional) Should the built-in logging of this Function App be enabled? Defaults to `true`. -* `connection_string` - (Optional) An `connection_string` block as defined below. +* `connection_string` - (Optional) A `connection_string` block as defined below. * `os_type` - (Optional) A string indicating the Operating System type for this function app. @@ -158,7 +158,7 @@ An `auth_settings` block supports the following: * `enabled` - (Required) Is Authentication enabled? -* `active_directory` - (Optional) A `active_directory` block as defined below. +* `active_directory` - (Optional) An `active_directory` block as defined below. * `additional_login_params` - (Optional) Login parameters to send to the OpenID Connect authorization endpoint when a user logs in. Each parameter must be in the form "key=value". From 4d4ee482ce96b2dad4f785c86f74b9bf685ac9cc Mon Sep 17 00:00:00 2001 From: Aris van Ommeren Date: Tue, 5 May 2020 16:42:34 +0200 Subject: [PATCH 134/223] fix comments 2nd round --- .../web/resource_arm_function_app_slot.go | 309 ++++++++++++++++-- 1 file changed, 274 insertions(+), 35 deletions(-) diff --git a/azurerm/internal/services/web/resource_arm_function_app_slot.go b/azurerm/internal/services/web/resource_arm_function_app_slot.go index 2fbec1ca8ec19..8f0eaa4b5ddf1 100644 --- a/azurerm/internal/services/web/resource_arm_function_app_slot.go +++ b/azurerm/internal/services/web/resource_arm_function_app_slot.go @@ -1,6 +1,7 @@ package web import ( + "context" "fmt" "log" "strings" @@ -333,17 +334,14 @@ func resourceArmFunctionAppSlotCreate(d *schema.ResourceData, meta interface{}) httpsOnly := d.Get("https_only").(bool) dailyMemoryTimeQuota := d.Get("daily_memory_time_quota").(int) t := d.Get("tags").(map[string]interface{}) - appServiceTier, err := getFunctionAppServiceTier(ctx, appServicePlanID, meta) + appServiceTier, err := getFunctionAppSlotServiceTier(ctx, appServicePlanID, meta) if err != nil { return err } - basicAppSettings, err := getBasicFunctionAppSlotAppSettings(d, appServiceTier, endpointSuffix) - if err != nil { - return err - } + basicAppSettings := getBasicFunctionAppSlotAppSettings(d, appServiceTier, endpointSuffix) - siteConfig, err := expandFunctionAppSiteConfig(d) + siteConfig, err := expandFunctionAppSlotSiteConfig(d) if err != nil { return fmt.Errorf("Error expanding `site_config` for Function App Slot %q (Resource Group %q): %s", slot, resourceGroup, err) } @@ -430,17 +428,14 @@ func resourceArmFunctionAppSlotUpdate(d *schema.ResourceData, meta interface{}) dailyMemoryTimeQuota := d.Get("daily_memory_time_quota").(int) t := d.Get("tags").(map[string]interface{}) - appServiceTier, err := getFunctionAppServiceTier(ctx, appServicePlanID, meta) + appServiceTier, err := getFunctionAppSlotServiceTier(ctx, appServicePlanID, meta) if err != nil { return err } - basicAppSettings, err := getBasicFunctionAppSlotAppSettings(d, appServiceTier, endpointSuffix) - if err != nil { - return err - } + basicAppSettings := getBasicFunctionAppSlotAppSettings(d, appServiceTier, endpointSuffix) - siteConfig, err := expandFunctionAppSiteConfig(d) + siteConfig, err := expandFunctionAppSlotSiteConfig(d) if err != nil { return fmt.Errorf("Error expanding `site_config` for Slot %q (Function App %q / Resource Group %q): %s", id.Name, id.FunctionAppName, id.ResourceGroup, err) } @@ -477,7 +472,7 @@ func resourceArmFunctionAppSlotUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error waiting for update of Slot %q (Function App %q / Resource Group %q): %s", id.Name, id.FunctionAppName, id.ResourceGroup, err) } - appSettings, err := expandFunctionAppAppSettings(d, appServiceTier, endpointSuffix) + appSettings, err := expandFunctionAppSlotAppSettings(d, appServiceTier, endpointSuffix) if err != nil { return err } @@ -490,7 +485,7 @@ func resourceArmFunctionAppSlotUpdate(d *schema.ResourceData, meta interface{}) } if d.HasChange("site_config") { - siteConfig, err := expandFunctionAppSiteConfig(d) + siteConfig, err := expandFunctionAppSlotSiteConfig(d) if err != nil { return fmt.Errorf("Error expanding `site_config` for Slot %q (Function App %q / Resource Group %q): %s", id.Name, id.FunctionAppName, id.ResourceGroup, err) } @@ -517,7 +512,7 @@ func resourceArmFunctionAppSlotUpdate(d *schema.ResourceData, meta interface{}) if d.HasChange("connection_string") { // update the ConnectionStrings - connectionStrings := expandFunctionAppConnectionStrings(d) + connectionStrings := expandFunctionAppSlotConnectionStrings(d) properties := web.ConnectionStringDictionary{ Properties: connectionStrings, } @@ -642,7 +637,7 @@ func resourceArmFunctionAppSlotRead(d *schema.ResourceData, meta interface{}) er if err = d.Set("app_settings", appSettings); err != nil { return err } - if err = d.Set("connection_string", flattenFunctionAppConnectionStrings(connectionStringsResp.Properties)); err != nil { + if err = d.Set("connection_string", flattenFunctionAppSlotConnectionStrings(connectionStringsResp.Properties)); err != nil { return err } @@ -656,7 +651,7 @@ func resourceArmFunctionAppSlotRead(d *schema.ResourceData, meta interface{}) er return fmt.Errorf("Error making Read request on AzureRM Function App Configuration %q: %+v", id.Name, err) } - siteConfig := flattenFunctionAppSiteConfig(configResp.SiteConfig) + siteConfig := flattenFunctionAppSlotSiteConfig(configResp.SiteConfig) if err = d.Set("site_config", siteConfig); err != nil { return err } @@ -666,7 +661,7 @@ func resourceArmFunctionAppSlotRead(d *schema.ResourceData, meta interface{}) er return fmt.Errorf("Error setting `auth_settings`: %s", err) } - siteCred := flattenFunctionAppSiteCredential(siteCredResp.UserProperties) + siteCred := flattenFunctionAppSlotSiteCredential(siteCredResp.UserProperties) if err = d.Set("site_credential", siteCred); err != nil { return err } @@ -698,7 +693,7 @@ func resourceArmFunctionAppSlotDelete(d *schema.ResourceData, meta interface{}) return nil } -func getBasicFunctionAppSlotAppSettings(d *schema.ResourceData, appServiceTier, endpointSuffix string) ([]web.NameValuePair, error) { +func getBasicFunctionAppSlotAppSettings(d *schema.ResourceData, appServiceTier, endpointSuffix string) []web.NameValuePair { // TODO: This is a workaround since there are no public Functions API // You may track the API request here: https://github.com/Azure/azure-rest-api-specs/issues/3750 dashboardPropName := "AzureWebJobsDashboard" @@ -707,20 +702,8 @@ func getBasicFunctionAppSlotAppSettings(d *schema.ResourceData, appServiceTier, contentSharePropName := "WEBSITE_CONTENTSHARE" contentFileConnStringPropName := "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING" - storageAccount := "" - if v, ok := d.GetOk("storage_account_name"); ok { - storageAccount = v.(string) - } - - connectionString := "" - if v, ok := d.GetOk("storage_account_access_key"); ok { - connectionString = v.(string) - } - - if storageAccount == "" && connectionString == "" { - return nil, fmt.Errorf("both `storage_account_name` and `storage_account_access_key` must be specified") - } - + storageAccount := d.Get("storage_account_name").(string) + connectionString := d.Get("storage_account_access_key").(string) storageConnection := fmt.Sprintf("DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s;EndpointSuffix=%s", storageAccount, connectionString, endpointSuffix) functionVersion := d.Get("version").(string) @@ -745,8 +728,264 @@ func getBasicFunctionAppSlotAppSettings(d *schema.ResourceData, appServiceTier, // On consumption and premium plans include WEBSITE_CONTENT components if strings.EqualFold(appServiceTier, "dynamic") || strings.EqualFold(appServiceTier, "elasticpremium") { - return append(basicSettings, consumptionSettings...), nil + return append(basicSettings, consumptionSettings...) + } + + return basicSettings +} + +func getFunctionAppSlotServiceTier(ctx context.Context, appServicePlanID string, meta interface{}) (string, error) { + id, err := ParseAppServicePlanID(appServicePlanID) + if err != nil { + return "", fmt.Errorf("[ERROR] Unable to parse App Service Plan ID %q: %+v", appServicePlanID, err) + } + + log.Printf("[DEBUG] Retrieving App Service Plan %q (Resource Group %q)", id.Name, id.ResourceGroup) + + appServicePlansClient := meta.(*clients.Client).Web.AppServicePlansClient + appServicePlan, err := appServicePlansClient.Get(ctx, id.ResourceGroup, id.Name) + if err != nil { + return "", fmt.Errorf("[ERROR] Could not retrieve App Service Plan ID %q: %+v", appServicePlanID, err) + } + + if sku := appServicePlan.Sku; sku != nil { + if tier := sku.Tier; tier != nil { + return *tier, nil + } + } + return "", fmt.Errorf("No `sku` block was returned for App Service Plan ID %q", appServicePlanID) +} + +func expandFunctionAppSlotAppSettings(d *schema.ResourceData, appServiceTier, endpointSuffix string) (map[string]*string, error) { + output := expandAppServiceAppSettings(d) + + basicAppSettings, err := getBasicFunctionAppAppSettings(d, appServiceTier, endpointSuffix) + if err != nil { + return nil, err + } + for _, p := range basicAppSettings { + output[*p.Name] = p.Value + } + + return output, nil +} + +func expandFunctionAppSlotSiteConfig(d *schema.ResourceData) (web.SiteConfig, error) { + configs := d.Get("site_config").([]interface{}) + siteConfig := web.SiteConfig{} + + if len(configs) == 0 { + return siteConfig, nil + } + + config := configs[0].(map[string]interface{}) + + if v, ok := config["always_on"]; ok { + siteConfig.AlwaysOn = utils.Bool(v.(bool)) + } + + if v, ok := config["use_32_bit_worker_process"]; ok { + siteConfig.Use32BitWorkerProcess = utils.Bool(v.(bool)) + } + + if v, ok := config["websockets_enabled"]; ok { + siteConfig.WebSocketsEnabled = utils.Bool(v.(bool)) + } + + if v, ok := config["linux_fx_version"]; ok { + siteConfig.LinuxFxVersion = utils.String(v.(string)) + } + + if v, ok := config["cors"]; ok { + corsSettings := v.(interface{}) + expand := azure.ExpandWebCorsSettings(corsSettings) + siteConfig.Cors = &expand + } + + if v, ok := config["http2_enabled"]; ok { + siteConfig.HTTP20Enabled = utils.Bool(v.(bool)) + } + + if v, ok := config["ip_restriction"]; ok { + ipSecurityRestrictions := v.(interface{}) + restrictions, err := expandFunctionAppSlotIPRestriction(ipSecurityRestrictions) + if err != nil { + return siteConfig, err + } + siteConfig.IPSecurityRestrictions = &restrictions + } + + if v, ok := config["min_tls_version"]; ok { + siteConfig.MinTLSVersion = web.SupportedTLSVersions(v.(string)) + } + + if v, ok := config["ftps_state"]; ok { + siteConfig.FtpsState = web.FtpsState(v.(string)) + } + + return siteConfig, nil +} + +func flattenFunctionAppSlotSiteConfig(input *web.SiteConfig) []interface{} { + results := make([]interface{}, 0) + result := make(map[string]interface{}) + + if input == nil { + log.Printf("[DEBUG] SiteConfig is nil") + return results + } + + if input.AlwaysOn != nil { + result["always_on"] = *input.AlwaysOn + } + + if input.Use32BitWorkerProcess != nil { + result["use_32_bit_worker_process"] = *input.Use32BitWorkerProcess + } + + if input.WebSocketsEnabled != nil { + result["websockets_enabled"] = *input.WebSocketsEnabled + } + + if input.LinuxFxVersion != nil { + result["linux_fx_version"] = *input.LinuxFxVersion + } + + if input.HTTP20Enabled != nil { + result["http2_enabled"] = *input.HTTP20Enabled + } + + result["ip_restriction"] = flattenFunctionAppSlotIPRestriction(input.IPSecurityRestrictions) + + result["min_tls_version"] = string(input.MinTLSVersion) + result["ftps_state"] = string(input.FtpsState) + + result["cors"] = azure.FlattenWebCorsSettings(input.Cors) + + results = append(results, result) + return results +} + +func expandFunctionAppSlotConnectionStrings(d *schema.ResourceData) map[string]*web.ConnStringValueTypePair { + input := d.Get("connection_string").(*schema.Set).List() + output := make(map[string]*web.ConnStringValueTypePair, len(input)) + + for _, v := range input { + vals := v.(map[string]interface{}) + + csName := vals["name"].(string) + csType := vals["type"].(string) + csValue := vals["value"].(string) + + output[csName] = &web.ConnStringValueTypePair{ + Value: utils.String(csValue), + Type: web.ConnectionStringType(csType), + } + } + + return output +} + +func expandFunctionAppSlotIPRestriction(input interface{}) ([]web.IPSecurityRestriction, error) { + restrictions := make([]web.IPSecurityRestriction, 0) + + for i, r := range input.([]interface{}) { + if r == nil { + continue + } + + restriction := r.(map[string]interface{}) + + ipAddress := restriction["ip_address"].(string) + vNetSubnetID := restriction["subnet_id"].(string) + + if vNetSubnetID != "" && ipAddress != "" { + return nil, fmt.Errorf(fmt.Sprintf("only one of `ip_address` or `subnet_id` can set for `site_config.0.ip_restriction.%d`", i)) + } + + if vNetSubnetID == "" && ipAddress == "" { + return nil, fmt.Errorf(fmt.Sprintf("one of `ip_address` or `subnet_id` must be set for `site_config.0.ip_restriction.%d`", i)) + } + + ipSecurityRestriction := web.IPSecurityRestriction{} + if ipAddress == "Any" { + continue + } + + if ipAddress != "" { + ipSecurityRestriction.IPAddress = &ipAddress + } + + if vNetSubnetID != "" { + ipSecurityRestriction.VnetSubnetResourceID = &vNetSubnetID + } + + restrictions = append(restrictions, ipSecurityRestriction) + } + + return restrictions, nil +} + +func flattenFunctionAppSlotConnectionStrings(input map[string]*web.ConnStringValueTypePair) interface{} { + results := make([]interface{}, 0) + + for k, v := range input { + result := make(map[string]interface{}) + result["name"] = k + result["type"] = string(v.Type) + result["value"] = *v.Value + results = append(results, result) + } + + return results +} + +func flattenFunctionAppSlotSiteCredential(input *web.UserProperties) []interface{} { + results := make([]interface{}, 0) + result := make(map[string]interface{}) + + if input == nil { + log.Printf("[DEBUG] UserProperties is nil") + return results + } + + if input.PublishingUserName != nil { + result["username"] = *input.PublishingUserName + } + + if input.PublishingPassword != nil { + result["password"] = *input.PublishingPassword + } + + return append(results, result) +} + +func flattenFunctionAppSlotIPRestriction(input *[]web.IPSecurityRestriction) []interface{} { + restrictions := make([]interface{}, 0) + + if input == nil { + return restrictions + } + + for _, v := range *input { + ipAddress := "" + if v.IPAddress != nil { + ipAddress = *v.IPAddress + if ipAddress == "Any" { + continue + } + } + + subnetID := "" + if v.VnetSubnetResourceID != nil { + subnetID = *v.VnetSubnetResourceID + } + + restrictions = append(restrictions, map[string]interface{}{ + "ip_address": ipAddress, + "subnet_id": subnetID, + }) } - return basicSettings, nil + return restrictions } From 53218ea28671227717fea90e323f29d25272d40f Mon Sep 17 00:00:00 2001 From: Aris van Ommeren Date: Tue, 5 May 2020 22:18:15 +0200 Subject: [PATCH 135/223] add pre_warmed_instance_count --- .../web/resource_arm_function_app_slot.go | 13 +++ .../resource_arm_function_app_slot_test.go | 85 +++++++++++++++++-- .../docs/r/function_app_slot.html.markdown | 2 + 3 files changed, 92 insertions(+), 8 deletions(-) diff --git a/azurerm/internal/services/web/resource_arm_function_app_slot.go b/azurerm/internal/services/web/resource_arm_function_app_slot.go index 8f0eaa4b5ddf1..8f4a2c2df6ea4 100644 --- a/azurerm/internal/services/web/resource_arm_function_app_slot.go +++ b/azurerm/internal/services/web/resource_arm_function_app_slot.go @@ -264,6 +264,11 @@ func resourceArmFunctionAppSlot() *schema.Resource { string(web.FtpsOnly), }, false), }, + "pre_warmed_instance_count": { + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntBetween(0, 10), + }, "cors": azure.SchemaWebCorsSettings(), }, }, @@ -823,6 +828,10 @@ func expandFunctionAppSlotSiteConfig(d *schema.ResourceData) (web.SiteConfig, er siteConfig.FtpsState = web.FtpsState(v.(string)) } + if v, ok := config["pre_warmed_instance_count"]; ok { + siteConfig.PreWarmedInstanceCount = utils.Int32(int32(v.(int))) + } + return siteConfig, nil } @@ -855,6 +864,10 @@ func flattenFunctionAppSlotSiteConfig(input *web.SiteConfig) []interface{} { result["http2_enabled"] = *input.HTTP20Enabled } + if input.PreWarmedInstanceCount != nil { + result["pre_warmed_instance_count"] = *input.PreWarmedInstanceCount + } + result["ip_restriction"] = flattenFunctionAppSlotIPRestriction(input.IPSecurityRestrictions) result["min_tls_version"] = string(input.MinTLSVersion) diff --git a/azurerm/internal/services/web/tests/resource_arm_function_app_slot_test.go b/azurerm/internal/services/web/tests/resource_arm_function_app_slot_test.go index d09617445c33e..e62805c626ee6 100644 --- a/azurerm/internal/services/web/tests/resource_arm_function_app_slot_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_function_app_slot_test.go @@ -10,7 +10,6 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" - "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -33,11 +32,6 @@ func TestAccAzureRMFunctionAppSlot_basic(t *testing.T) { } func TestAccAzureRMFunctionAppSlot_requiresImport(t *testing.T) { - if !features.ShouldResourcesBeImported() { - t.Skip("Skipping since resources aren't required to be imported") - return - } - data := acceptance.BuildTestData(t, "azurerm_function_app_slot", "test") resource.ParallelTest(t, resource.TestCase{ @@ -685,6 +679,26 @@ func testCheckAzureRMFunctionAppSlotExists(slot string) resource.TestCheckFunc { } } +func TestAccAzureRMFunctionAppSlot_preWarmedInstanceCount(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_function_app_slot", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMFunctionAppDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMFunctionAppSlot_preWarmedInstanceCount(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMFunctionAppSlotExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.pre_warmed_instance_count", "1"), + ), + }, + data.ImportStep(), + }, + }) +} + func testAccAzureRMFunctionAppSlot_basic(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { @@ -747,8 +761,8 @@ resource "azurerm_function_app_slot" "import" { resource_group_name = azurerm_function_app_slot.test.resource_group_name app_service_plan_id = azurerm_function_app_slot.test.app_service_plan_id function_app_name = azurerm_function_app_slot.test.function_app_name - storage_account_name = azurerm_function_app_slot.test.name - storage_account_access_key = azurerm_function_app_slot.test.primary_access_key + storage_account_name = azurerm_function_app_slot.test.storage_account_name + storage_account_access_key = azurerm_function_app_slot.test.storage_account_access_key } `, template) } @@ -2035,3 +2049,58 @@ resource "azurerm_function_app_slot" "test" { } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomString, data.RandomInteger, data.RandomInteger, tlsVersion) } + +func testAccAzureRMFunctionAppSlot_preWarmedInstanceCount(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_storage_account" "test" { + name = "acctestsa%s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" +} + +resource "azurerm_app_service_plan" "test" { + name = "acctestASP-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + kind = "elastic" + sku { + tier = "ElasticPremium" + size = "EP1" + } +} + +resource "azurerm_function_app" "test" { + name = "acctestFA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key +} + +resource "azurerm_function_app_slot" "test" { + name = "acctestFASlot-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + function_app_name = azurerm_function_app.test.name + storage_account_name = azurerm_storage_account.test.name + storage_account_access_key = azurerm_storage_account.test.primary_access_key + + site_config { + pre_warmed_instance_count = "1" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger, data.RandomInteger, data.RandomInteger) +} diff --git a/website/docs/r/function_app_slot.html.markdown b/website/docs/r/function_app_slot.html.markdown index ad5011716f4d1..8a50974e1e045 100644 --- a/website/docs/r/function_app_slot.html.markdown +++ b/website/docs/r/function_app_slot.html.markdown @@ -130,6 +130,8 @@ The following arguments are supported: * `ftps_state` - (Optional) State of FTP / FTPS service for this function app. Possible values include: `AllAllowed`, `FtpsOnly` and `Disabled`. +* `pre_warmed_instance_count` - (Optional) The number of pre-warmed instances for this function app. Only affects apps on the Premium plan. + * `cors` - (Optional) A `cors` block as defined below. * `ip_restriction` - (Optional) A [List of objects](/docs/configuration/attr-as-blocks.html) representing ip restrictions as defined below. From dfd926d0a1538cd01d1d20455be14f97df5e2871 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Wed, 6 May 2020 09:20:39 +0800 Subject: [PATCH 136/223] Update code --- .../network/tests/resource_arm_network_interface_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azurerm/internal/services/network/tests/resource_arm_network_interface_test.go b/azurerm/internal/services/network/tests/resource_arm_network_interface_test.go index 148a8cd82a0eb..16811129fcc7e 100644 --- a/azurerm/internal/services/network/tests/resource_arm_network_interface_test.go +++ b/azurerm/internal/services/network/tests/resource_arm_network_interface_test.go @@ -513,7 +513,7 @@ resource "azurerm_network_interface" "test" { dns_servers = [ "10.0.0.5", - "10.0.0.6" + "10.0.0.7" ] ip_configuration { From 58d57c5a4df0328d12e1f6d88a3041bf440a93be Mon Sep 17 00:00:00 2001 From: rob Date: Wed, 6 May 2020 07:11:52 +0200 Subject: [PATCH 137/223] start server when it was stopped before updating it --- .../analysis_services_server_resource.go | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/azurerm/internal/services/analysisservices/analysis_services_server_resource.go b/azurerm/internal/services/analysisservices/analysis_services_server_resource.go index 0e5ab8b2704e1..8bcc213ddbca1 100644 --- a/azurerm/internal/services/analysisservices/analysis_services_server_resource.go +++ b/azurerm/internal/services/analysisservices/analysis_services_server_resource.go @@ -252,6 +252,32 @@ func resourceArmAnalysisServicesServerUpdate(d *schema.ResourceData, meta interf return err } + serverResp, err := client.GetDetails(ctx, id.ResourceGroup, id.Name) + if err != nil { + if utils.ResponseWasNotFound(serverResp.Response) { + d.SetId("") + return nil + } + return fmt.Errorf("Error retrieving Analysis Services Server %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + } + + if serverResp.State != analysisservices.StateSucceeded && serverResp.State != analysisservices.StatePaused { + return fmt.Errorf("Error updating Analysis Services Server %q (Resource Group %q): State must be either Succeeded or Paused", id.Name, id.ResourceGroup) + } + + isPaused := serverResp.State == analysisservices.StatePaused + + if isPaused { + resumeFuture, err := client.Resume(ctx, id.ResourceGroup, id.Name) + if err != nil { + return fmt.Errorf("Error starting Analysis Services Server %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + } + + if err = resumeFuture.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("Error waiting for Analysis Services Server starting completion %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + } + } + serverProperties := expandAnalysisServicesServerMutableProperties(d) sku := d.Get("sku").(string) t := d.Get("tags").(map[string]interface{}) @@ -271,6 +297,17 @@ func resourceArmAnalysisServicesServerUpdate(d *schema.ResourceData, meta interf return fmt.Errorf("Error waiting for completion of Analysis Services Server %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) } + if isPaused { + suspendFuture, err := client.Suspend(ctx, id.ResourceGroup, id.Name) + if err != nil { + return fmt.Errorf("Error pausing Analysis Services Server %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + } + + if err = suspendFuture.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("Error waiting for Analysis Services Server pausing completion %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + } + } + return resourceArmAnalysisServicesServerRead(d, meta) } From 09857dcea730200346fb76c7236032e13f26d45b Mon Sep 17 00:00:00 2001 From: rob Date: Wed, 6 May 2020 07:13:55 +0200 Subject: [PATCH 138/223] fix lintrest problem --- .../analysisservices/analysis_services_server_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azurerm/internal/services/analysisservices/analysis_services_server_resource.go b/azurerm/internal/services/analysisservices/analysis_services_server_resource.go index b88a6b3cf85b7..c5c31b67f0681 100644 --- a/azurerm/internal/services/analysisservices/analysis_services_server_resource.go +++ b/azurerm/internal/services/analysisservices/analysis_services_server_resource.go @@ -428,7 +428,7 @@ func hashAnalysisServicesServerIpv4FirewallRule(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", strings.ToLower(m["name"].(string)))) buf.WriteString(fmt.Sprintf("%s-", m["range_start"].(string))) - buf.WriteString(fmt.Sprintf("%s", m["range_end"].(string))) + buf.WriteString(m["range_end"].(string)) return hashcode.String(buf.String()) } From 15f53419150a56ff05f1df5a8d6d0e4c8d3fa096 Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Wed, 6 May 2020 14:36:20 +0800 Subject: [PATCH 139/223] Update doc for property default_action of eventhub namespace --- website/docs/r/eventhub_namespace.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/eventhub_namespace.html.markdown b/website/docs/r/eventhub_namespace.html.markdown index 7ae14af1ec139..387b26daebda9 100644 --- a/website/docs/r/eventhub_namespace.html.markdown +++ b/website/docs/r/eventhub_namespace.html.markdown @@ -57,7 +57,7 @@ The following arguments are supported: A `network_rulesets` block supports the following: -* `default_action` - (Required) The default action to take when a rule is not matched. Possible values are `Allow` and `Deny`. +* `default_action` - (Required) The default action to take when a rule is not matched. Possible values are `Allow` and `Deny`. Defaults to `Deny`. * `virtual_network_rule` - (Optional) One or more `virtual_network_rule` blocks as defined below. From 093a62ce54c6eab38bee784ff4a57d11f6673dcc Mon Sep 17 00:00:00 2001 From: Andrii Bilousko Date: Wed, 6 May 2020 10:12:05 +0300 Subject: [PATCH 140/223] Changed: notes regarding configuring 'TLS termination with Key Vault certificates' for App Gateway were added. --- website/docs/r/application_gateway.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/docs/r/application_gateway.html.markdown b/website/docs/r/application_gateway.html.markdown index 2c0b894f5754b..56b95dfc0c10c 100644 --- a/website/docs/r/application_gateway.html.markdown +++ b/website/docs/r/application_gateway.html.markdown @@ -394,6 +394,10 @@ A `ssl_certificate` block supports the following: * `key_vault_secret_id` - (Optional) Secret Id of (base-64 encoded unencrypted pfx) `Secret` or `Certificate` object stored in Azure KeyVault. You need to enable soft delete for keyvault to use this feature. Required if `data` is not set. +-> **NOTE:** TLS termination with Key Vault certificates is limited to the [v2 SKUs](https://docs.microsoft.com/en-us/azure/application-gateway/key-vault-certs). + +-> **NOTE:** For TLS termination with Key Vault certificates to work properly existing user-assigned managed identity, which Application Gateway uses to retrieve certificates from Key Vault, should be defined via `identity` block. Additionally, access policies in the Key Vault to allow the identity to be granted *get* access to the secret should be defined. + --- A `url_path_map` block supports the following: From e432fce2eaa2887dac856d6f572456c9d034092e Mon Sep 17 00:00:00 2001 From: Steve <11830746+jackofallops@users.noreply.github.com> Date: Wed, 6 May 2020 08:31:44 +0100 Subject: [PATCH 141/223] Update for #6624 --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d666f99197c38..aafe77ece8622 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,11 +12,12 @@ IMPROVEMENTS: * `azurerm_key_vault_certificate` - support for recovering a soft-deleted certificate if the `features` flag `recover_soft_deleted_key_vaults` is set to `true` [GH-6716] * `azurerm_key_vault_key` - support for recovering a soft-deleted key if the `features` flag `recover_soft_deleted_key_vaults` is set to `true` [GH-6716] * `azurerm_key_vault_secret` - support for recovering a soft-deleted secret if the `features` flag `recover_soft_deleted_key_vaults` is set to `true` [GH-6716] -* `azurerm_linux_virtual_machine_scale_set - support for configuring `create_mode` for data disks [GH-6744] -* `azurerm_windows_virtual_machine_scale_set - support for configuring `create_mode` for data disks [GH-6744] +* `azurerm_linux_virtual_machine_scale_set` - support for configuring `create_mode` for data disks [GH-6744] +* `azurerm_windows_virtual_machine_scale_set` - support for configuring `create_mode` for data disks [GH-6744] BUG FIXES: +* `azurerm_network_interface` - changes to dns servers no longer use incremental update [GH-6624] * `azurerm_policy_definition` - changes to the dynamic fields (`createdBy`, `createdOn`, `updatedBy`, `updatedOn`) keys in the `metadata` field are excluded from diff's [GH-6734] ## 2.8.0 (April 30, 2020) From 82378fcbd55a51660d01e60d564114d62078166e Mon Sep 17 00:00:00 2001 From: rob Date: Wed, 6 May 2020 12:23:55 +0200 Subject: [PATCH 142/223] fix PR recommendations --- .../analysisservices/analysis_services_server_resource.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/azurerm/internal/services/analysisservices/analysis_services_server_resource.go b/azurerm/internal/services/analysisservices/analysis_services_server_resource.go index 8bcc213ddbca1..f6a8a08768306 100644 --- a/azurerm/internal/services/analysisservices/analysis_services_server_resource.go +++ b/azurerm/internal/services/analysisservices/analysis_services_server_resource.go @@ -254,15 +254,11 @@ func resourceArmAnalysisServicesServerUpdate(d *schema.ResourceData, meta interf serverResp, err := client.GetDetails(ctx, id.ResourceGroup, id.Name) if err != nil { - if utils.ResponseWasNotFound(serverResp.Response) { - d.SetId("") - return nil - } return fmt.Errorf("Error retrieving Analysis Services Server %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) } if serverResp.State != analysisservices.StateSucceeded && serverResp.State != analysisservices.StatePaused { - return fmt.Errorf("Error updating Analysis Services Server %q (Resource Group %q): State must be either Succeeded or Paused", id.Name, id.ResourceGroup) + return fmt.Errorf("Error updating Analysis Services Server %q (Resource Group %q): State must be either Succeeded or Paused but got %q", id.Name, id.ResourceGroup, serverResp.State) } isPaused := serverResp.State == analysisservices.StatePaused @@ -300,7 +296,7 @@ func resourceArmAnalysisServicesServerUpdate(d *schema.ResourceData, meta interf if isPaused { suspendFuture, err := client.Suspend(ctx, id.ResourceGroup, id.Name) if err != nil { - return fmt.Errorf("Error pausing Analysis Services Server %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + return fmt.Errorf("Error re-pausing Analysis Services Server %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) } if err = suspendFuture.WaitForCompletionRef(ctx, client.Client); err != nil { From bc7d732a27492632532a07c53031feccae34d0c2 Mon Sep 17 00:00:00 2001 From: Steve <11830746+jackofallops@users.noreply.github.com> Date: Wed, 6 May 2020 11:47:54 +0100 Subject: [PATCH 143/223] Update for #6774 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aafe77ece8622..da1847116a857 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ IMPROVEMENTS: BUG FIXES: +* `azurerm_analysis_services_server` - ip restriction name field no longer case sensitive [GH-6774] * `azurerm_network_interface` - changes to dns servers no longer use incremental update [GH-6624] * `azurerm_policy_definition` - changes to the dynamic fields (`createdBy`, `createdOn`, `updatedBy`, `updatedOn`) keys in the `metadata` field are excluded from diff's [GH-6734] From 2c60f4017fa96859755b295b174454e167ace32d Mon Sep 17 00:00:00 2001 From: Tom Harvey Date: Wed, 6 May 2020 12:55:24 +0200 Subject: [PATCH 144/223] updating to include #6747 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index da1847116a857..5473421d1a76f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ BUG FIXES: * `azurerm_analysis_services_server` - ip restriction name field no longer case sensitive [GH-6774] * `azurerm_network_interface` - changes to dns servers no longer use incremental update [GH-6624] * `azurerm_policy_definition` - changes to the dynamic fields (`createdBy`, `createdOn`, `updatedBy`, `updatedOn`) keys in the `metadata` field are excluded from diff's [GH-6734] +* `azurerm_site_recovery_network_mapping` - handling an API Error when checking for the presence of an existing Network Mapping [GH-6747] ## 2.8.0 (April 30, 2020) From 63028d8188f747213967231bde38d559d2b91e71 Mon Sep 17 00:00:00 2001 From: Steve <11830746+jackofallops@users.noreply.github.com> Date: Wed, 6 May 2020 14:22:04 +0100 Subject: [PATCH 145/223] Update for #6435 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5473421d1a76f..d92444ac0d4f3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ FEATURES: * **New Data Source:** `azurerm_data_share_account` [GH-6575] * **New Resource:** `azurerm_data_share_account` [GH-6575] +* **New Resource:** `azurerm_function_app_slot` [GH-6435] IMPROVEMENTS: From e49fe66acc8dc4a7602c832132698663343fbce5 Mon Sep 17 00:00:00 2001 From: rob Date: Wed, 6 May 2020 15:48:03 +0200 Subject: [PATCH 146/223] add test for updating a paused analysis services server --- .../analysis_services_server_resource.go | 2 +- .../analysis_services_server_resource_test.go | 105 ++++++++++++++++++ 2 files changed, 106 insertions(+), 1 deletion(-) diff --git a/azurerm/internal/services/analysisservices/analysis_services_server_resource.go b/azurerm/internal/services/analysisservices/analysis_services_server_resource.go index f6a8a08768306..65beb2599fbdd 100644 --- a/azurerm/internal/services/analysisservices/analysis_services_server_resource.go +++ b/azurerm/internal/services/analysisservices/analysis_services_server_resource.go @@ -245,7 +245,7 @@ func resourceArmAnalysisServicesServerUpdate(d *schema.ResourceData, meta interf ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d) defer cancel() - log.Printf("[INFO] preparing arguments for Azure ARM Analysis Services Server creation.") + log.Printf("[INFO] preparing arguments for Azure ARM Analysis Services Server update.") id, err := parse.AnalysisServicesServerID(d.Id()) if err != nil { diff --git a/azurerm/internal/services/analysisservices/tests/analysis_services_server_resource_test.go b/azurerm/internal/services/analysisservices/tests/analysis_services_server_resource_test.go index 0ed72c91a83c3..17ff2b187c6d4 100644 --- a/azurerm/internal/services/analysisservices/tests/analysis_services_server_resource_test.go +++ b/azurerm/internal/services/analysisservices/tests/analysis_services_server_resource_test.go @@ -6,6 +6,7 @@ import ( "strings" "testing" + "github.com/Azure/azure-sdk-for-go/services/analysisservices/mgmt/2017-08-01/analysisservices" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" @@ -210,6 +211,33 @@ func TestAccAzureRMAnalysisServicesServer_backupBlobContainerUri(t *testing.T) { }) } +func TestAccAzureRMAnalysisServicesServer_suspended(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_analysis_services_server", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMAnalysisServicesServerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMAnalysisServicesServer_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMAnalysisServicesServerExists(data.ResourceName), + testSuspendAzureRMAnalysisServicesServer(data.ResourceName), + testCheckAzureRMAnalysisServicesServerState(data.ResourceName, analysisservices.StatePaused), + ), + }, + { + Config: testAccAzureRMAnalysisServicesServer_scale(data), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(data.ResourceName, "sku", "S1"), + testCheckAzureRMAnalysisServicesServerState(data.ResourceName, analysisservices.StatePaused), + ), + }, + }, + }) +} + func testAccAzureRMAnalysisServicesServer_basic(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { @@ -477,6 +505,26 @@ resource "azurerm_analysis_services_server" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger) } +func testAccAzureRMAnalysisServicesServer_scale(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_analysis_services_server" "test" { + name = "acctestass%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku = "S1" +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger) +} + func testCheckAzureRMAnalysisServicesServerDestroy(s *terraform.State) error { client := acceptance.AzureProvider.Meta().(*clients.Client).AnalysisServices.ServerClient ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext @@ -533,3 +581,60 @@ func testCheckAzureRMAnalysisServicesServerExists(resourceName string) resource. return nil } } + +func testSuspendAzureRMAnalysisServicesServer(resourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).AnalysisServices.ServerClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + id, err := parse.AnalysisServicesServerID(rs.Primary.ID) + if err != nil { + return err + } + + suspendFuture, err := client.Suspend(ctx, id.ResourceGroup, id.Name) + if err != nil { + return fmt.Errorf("Bad: Suspend on analysisServicesServerClient: %+v", err) + } + + err = suspendFuture.WaitForCompletionRef(ctx, client.Client) + if err != nil { + return fmt.Errorf("Bad: Wait for Suspend completion on analysisServicesServerClient: %+v", err) + } + + return nil + } +} + +func testCheckAzureRMAnalysisServicesServerState(resourceName string, state analysisservices.State) resource.TestCheckFunc { + return func(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).AnalysisServices.ServerClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + id, err := parse.AnalysisServicesServerID(rs.Primary.ID) + if err != nil { + return err + } + + resp, err := client.GetDetails(ctx, id.ResourceGroup, id.Name) + if err != nil { + return fmt.Errorf("Bad: Get on analysisServicesServerClient: %+v", err) + } + + if resp.State != state { + return fmt.Errorf("Unexpected state. Expected %s but is %s", state, resp.State) + } + + return nil + } +} From 3023af9c1c99b7de17d094dbdf497da627a2402b Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 12:46:14 -0500 Subject: [PATCH 147/223] Updates `apimanagement` --- ...ce_api_management_api.go => api_management_api_data_source.go} | 0 ..._policy.go => api_management_api_operation_policy_resource.go} | 0 ..._api_operation.go => api_management_api_operation_resource.go} | 0 ...gement_api_policy.go => api_management_api_policy_resource.go} | 0 ...e_arm_api_management_api.go => api_management_api_resource.go} | 0 ...gement_api_schema.go => api_management_api_schema_resource.go} | 0 ...rsion_set.go => api_management_api_version_set_data_source.go} | 0 ..._version_set.go => api_management_api_version_set_resource.go} | 0 ..._server.go => api_management_authorization_server_resource.go} | 0 ...i_management_backend.go => api_management_backend_resource.go} | 0 ...ment_certificate.go => api_management_certificate_resource.go} | 0 ...ata_source_api_management.go => api_management_data_source.go} | 0 ...gement_diagnostic.go => api_management_diagnostic_resource.go} | 0 ...pi_management_group.go => api_management_group_data_source.go} | 0 ...m_api_management_group.go => api_management_group_resource.go} | 0 ...gement_group_user.go => api_management_group_user_resource.go} | 0 ...er_aad.go => api_management_identity_provider_aad_resource.go} | 0 ...k.go => api_management_identity_provider_facebook_resource.go} | 0 ...gle.go => api_management_identity_provider_google_resource.go} | 0 ....go => api_management_identity_provider_microsoft_resource.go} | 0 ...er.go => api_management_identity_provider_twitter_resource.go} | 0 ...api_management_logger.go => api_management_logger_resource.go} | 0 ...ment_named_value.go => api_management_named_value_resource.go} | 0 ...ider.go => api_management_openid_connect_provider_resource.go} | 0 ...ment_product_api.go => api_management_product_api_resource.go} | 0 ...anagement_product.go => api_management_product_data_source.go} | 0 ..._product_group.go => api_management_product_group_resource.go} | 0 ...roduct_policy.go => api_management_product_policy_resource.go} | 0 ...i_management_product.go => api_management_product_resource.go} | 0 ...management_property.go => api_management_property_resource.go} | 0 ...{resource_arm_api_management.go => api_management_resource.go} | 0 ...nt_subscription.go => api_management_subscription_resource.go} | 0 ..._api_management_user.go => api_management_user_data_source.go} | 0 ...arm_api_management_user.go => api_management_user_resource.go} | 0 ...agement_api_test.go => api_management_api_data_source_test.go} | 0 ...st.go => api_management_api_operation_policy_resource_test.go} | 0 ...tion_test.go => api_management_api_operation_resource_test.go} | 0 ..._policy_test.go => api_management_api_policy_resource_test.go} | 0 ...management_api_test.go => api_management_api_resource_test.go} | 0 ..._schema_test.go => api_management_api_schema_resource_test.go} | 0 ...test.go => api_management_api_version_set_data_source_test.go} | 0 ...et_test.go => api_management_api_version_set_resource_test.go} | 0 ...st.go => api_management_authorization_server_resource_test.go} | 0 ...nt_backend_test.go => api_management_backend_resource_test.go} | 0 ...ficate_test.go => api_management_certificate_resource_test.go} | 0 ..._api_management_test.go => api_management_data_source_test.go} | 0 ...gnostic_test.go => api_management_diagnostic_resource_test.go} | 0 ...ent_group_test.go => api_management_group_data_source_test.go} | 0 ...gement_group_test.go => api_management_group_resource_test.go} | 0 ...up_user_test.go => api_management_group_user_resource_test.go} | 0 ...t.go => api_management_identity_provider_aad_resource_test.go} | 0 ...=> api_management_identity_provider_facebook_resource_test.go} | 0 ...o => api_management_identity_provider_google_resource_test.go} | 0 ...> api_management_identity_provider_microsoft_resource_test.go} | 0 ... => api_management_identity_provider_twitter_resource_test.go} | 0 ...ment_logger_test.go => api_management_logger_resource_test.go} | 0 ..._value_test.go => api_management_named_value_resource_test.go} | 0 ...go => api_management_openid_connect_provider_resource_test.go} | 0 ...ct_api_test.go => api_management_product_api_resource_test.go} | 0 ...product_test.go => api_management_product_data_source_test.go} | 0 ...roup_test.go => api_management_product_group_resource_test.go} | 0 ...icy_test.go => api_management_product_policy_resource_test.go} | 0 ...nt_product_test.go => api_management_product_resource_test.go} | 0 ..._property_test.go => api_management_property_resource_test.go} | 0 ...arm_api_management_test.go => api_management_resource_test.go} | 0 ...ption_test.go => api_management_subscription_resource_test.go} | 0 ...ement_user_test.go => api_management_user_data_source_test.go} | 0 ...nagement_user_test.go => api_management_user_resource_test.go} | 0 68 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/apimanagement/{data_source_api_management_api.go => api_management_api_data_source.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_api_operation_policy.go => api_management_api_operation_policy_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_api_operation.go => api_management_api_operation_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_api_policy.go => api_management_api_policy_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_api.go => api_management_api_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_api_schema.go => api_management_api_schema_resource.go} (100%) rename azurerm/internal/services/apimanagement/{data_source_api_management_api_version_set.go => api_management_api_version_set_data_source.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_api_version_set.go => api_management_api_version_set_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_authorization_server.go => api_management_authorization_server_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_backend.go => api_management_backend_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_certificate.go => api_management_certificate_resource.go} (100%) rename azurerm/internal/services/apimanagement/{data_source_api_management.go => api_management_data_source.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_diagnostic.go => api_management_diagnostic_resource.go} (100%) rename azurerm/internal/services/apimanagement/{data_source_api_management_group.go => api_management_group_data_source.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_group.go => api_management_group_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_group_user.go => api_management_group_user_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_identity_provider_aad.go => api_management_identity_provider_aad_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_identity_provider_facebook.go => api_management_identity_provider_facebook_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_identity_provider_google.go => api_management_identity_provider_google_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_identity_provider_microsoft.go => api_management_identity_provider_microsoft_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_identity_provider_twitter.go => api_management_identity_provider_twitter_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_logger.go => api_management_logger_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_named_value.go => api_management_named_value_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_openid_connect_provider.go => api_management_openid_connect_provider_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_product_api.go => api_management_product_api_resource.go} (100%) rename azurerm/internal/services/apimanagement/{data_source_api_management_product.go => api_management_product_data_source.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_product_group.go => api_management_product_group_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_product_policy.go => api_management_product_policy_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_product.go => api_management_product_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_property.go => api_management_property_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management.go => api_management_resource.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_subscription.go => api_management_subscription_resource.go} (100%) rename azurerm/internal/services/apimanagement/{data_source_api_management_user.go => api_management_user_data_source.go} (100%) rename azurerm/internal/services/apimanagement/{resource_arm_api_management_user.go => api_management_user_resource.go} (100%) rename azurerm/internal/services/apimanagement/tests/{data_source_api_management_api_test.go => api_management_api_data_source_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_api_operation_policy_test.go => api_management_api_operation_policy_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_api_operation_test.go => api_management_api_operation_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_api_policy_test.go => api_management_api_policy_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_api_test.go => api_management_api_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_api_schema_test.go => api_management_api_schema_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{data_source_api_management_api_version_set_test.go => api_management_api_version_set_data_source_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_api_version_set_test.go => api_management_api_version_set_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_authorization_server_test.go => api_management_authorization_server_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_backend_test.go => api_management_backend_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_certificate_test.go => api_management_certificate_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{data_source_api_management_test.go => api_management_data_source_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_diagnostic_test.go => api_management_diagnostic_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{data_source_api_management_group_test.go => api_management_group_data_source_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_group_test.go => api_management_group_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_group_user_test.go => api_management_group_user_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_identity_provider_aad_test.go => api_management_identity_provider_aad_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_identity_provider_facebook_test.go => api_management_identity_provider_facebook_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_identity_provider_google_test.go => api_management_identity_provider_google_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_identity_provider_microsoft_test.go => api_management_identity_provider_microsoft_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_identity_provider_twitter_test.go => api_management_identity_provider_twitter_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_logger_test.go => api_management_logger_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_named_value_test.go => api_management_named_value_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_openid_connect_provider_test.go => api_management_openid_connect_provider_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_product_api_test.go => api_management_product_api_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{data_source_api_management_product_test.go => api_management_product_data_source_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_product_group_test.go => api_management_product_group_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_product_policy_test.go => api_management_product_policy_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_product_test.go => api_management_product_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_property_test.go => api_management_property_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_test.go => api_management_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_subscription_test.go => api_management_subscription_resource_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{data_source_api_management_user_test.go => api_management_user_data_source_test.go} (100%) rename azurerm/internal/services/apimanagement/tests/{resource_arm_api_management_user_test.go => api_management_user_resource_test.go} (100%) diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_api.go b/azurerm/internal/services/apimanagement/api_management_api_data_source.go similarity index 100% rename from azurerm/internal/services/apimanagement/data_source_api_management_api.go rename to azurerm/internal/services/apimanagement/api_management_api_data_source.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation_policy.go b/azurerm/internal/services/apimanagement/api_management_api_operation_policy_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation_policy.go rename to azurerm/internal/services/apimanagement/api_management_api_operation_policy_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation.go b/azurerm/internal/services/apimanagement/api_management_api_operation_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_api_operation.go rename to azurerm/internal/services/apimanagement/api_management_api_operation_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_policy.go b/azurerm/internal/services/apimanagement/api_management_api_policy_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_api_policy.go rename to azurerm/internal/services/apimanagement/api_management_api_policy_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api.go b/azurerm/internal/services/apimanagement/api_management_api_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_api.go rename to azurerm/internal/services/apimanagement/api_management_api_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_schema.go b/azurerm/internal/services/apimanagement/api_management_api_schema_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_api_schema.go rename to azurerm/internal/services/apimanagement/api_management_api_schema_resource.go diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_api_version_set.go b/azurerm/internal/services/apimanagement/api_management_api_version_set_data_source.go similarity index 100% rename from azurerm/internal/services/apimanagement/data_source_api_management_api_version_set.go rename to azurerm/internal/services/apimanagement/api_management_api_version_set_data_source.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_api_version_set.go b/azurerm/internal/services/apimanagement/api_management_api_version_set_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_api_version_set.go rename to azurerm/internal/services/apimanagement/api_management_api_version_set_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_authorization_server.go b/azurerm/internal/services/apimanagement/api_management_authorization_server_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_authorization_server.go rename to azurerm/internal/services/apimanagement/api_management_authorization_server_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_backend.go b/azurerm/internal/services/apimanagement/api_management_backend_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_backend.go rename to azurerm/internal/services/apimanagement/api_management_backend_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_certificate.go b/azurerm/internal/services/apimanagement/api_management_certificate_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_certificate.go rename to azurerm/internal/services/apimanagement/api_management_certificate_resource.go diff --git a/azurerm/internal/services/apimanagement/data_source_api_management.go b/azurerm/internal/services/apimanagement/api_management_data_source.go similarity index 100% rename from azurerm/internal/services/apimanagement/data_source_api_management.go rename to azurerm/internal/services/apimanagement/api_management_data_source.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_diagnostic.go b/azurerm/internal/services/apimanagement/api_management_diagnostic_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_diagnostic.go rename to azurerm/internal/services/apimanagement/api_management_diagnostic_resource.go diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_group.go b/azurerm/internal/services/apimanagement/api_management_group_data_source.go similarity index 100% rename from azurerm/internal/services/apimanagement/data_source_api_management_group.go rename to azurerm/internal/services/apimanagement/api_management_group_data_source.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_group.go b/azurerm/internal/services/apimanagement/api_management_group_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_group.go rename to azurerm/internal/services/apimanagement/api_management_group_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_group_user.go b/azurerm/internal/services/apimanagement/api_management_group_user_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_group_user.go rename to azurerm/internal/services/apimanagement/api_management_group_user_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_aad.go b/azurerm/internal/services/apimanagement/api_management_identity_provider_aad_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_aad.go rename to azurerm/internal/services/apimanagement/api_management_identity_provider_aad_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_facebook.go b/azurerm/internal/services/apimanagement/api_management_identity_provider_facebook_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_facebook.go rename to azurerm/internal/services/apimanagement/api_management_identity_provider_facebook_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_google.go b/azurerm/internal/services/apimanagement/api_management_identity_provider_google_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_google.go rename to azurerm/internal/services/apimanagement/api_management_identity_provider_google_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_microsoft.go b/azurerm/internal/services/apimanagement/api_management_identity_provider_microsoft_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_microsoft.go rename to azurerm/internal/services/apimanagement/api_management_identity_provider_microsoft_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_twitter.go b/azurerm/internal/services/apimanagement/api_management_identity_provider_twitter_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_identity_provider_twitter.go rename to azurerm/internal/services/apimanagement/api_management_identity_provider_twitter_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_logger.go b/azurerm/internal/services/apimanagement/api_management_logger_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_logger.go rename to azurerm/internal/services/apimanagement/api_management_logger_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_named_value.go b/azurerm/internal/services/apimanagement/api_management_named_value_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_named_value.go rename to azurerm/internal/services/apimanagement/api_management_named_value_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_openid_connect_provider.go b/azurerm/internal/services/apimanagement/api_management_openid_connect_provider_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_openid_connect_provider.go rename to azurerm/internal/services/apimanagement/api_management_openid_connect_provider_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_api.go b/azurerm/internal/services/apimanagement/api_management_product_api_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_product_api.go rename to azurerm/internal/services/apimanagement/api_management_product_api_resource.go diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_product.go b/azurerm/internal/services/apimanagement/api_management_product_data_source.go similarity index 100% rename from azurerm/internal/services/apimanagement/data_source_api_management_product.go rename to azurerm/internal/services/apimanagement/api_management_product_data_source.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_group.go b/azurerm/internal/services/apimanagement/api_management_product_group_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_product_group.go rename to azurerm/internal/services/apimanagement/api_management_product_group_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_product_policy.go b/azurerm/internal/services/apimanagement/api_management_product_policy_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_product_policy.go rename to azurerm/internal/services/apimanagement/api_management_product_policy_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_product.go b/azurerm/internal/services/apimanagement/api_management_product_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_product.go rename to azurerm/internal/services/apimanagement/api_management_product_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_property.go b/azurerm/internal/services/apimanagement/api_management_property_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_property.go rename to azurerm/internal/services/apimanagement/api_management_property_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management.go b/azurerm/internal/services/apimanagement/api_management_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management.go rename to azurerm/internal/services/apimanagement/api_management_resource.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_subscription.go b/azurerm/internal/services/apimanagement/api_management_subscription_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_subscription.go rename to azurerm/internal/services/apimanagement/api_management_subscription_resource.go diff --git a/azurerm/internal/services/apimanagement/data_source_api_management_user.go b/azurerm/internal/services/apimanagement/api_management_user_data_source.go similarity index 100% rename from azurerm/internal/services/apimanagement/data_source_api_management_user.go rename to azurerm/internal/services/apimanagement/api_management_user_data_source.go diff --git a/azurerm/internal/services/apimanagement/resource_arm_api_management_user.go b/azurerm/internal/services/apimanagement/api_management_user_resource.go similarity index 100% rename from azurerm/internal/services/apimanagement/resource_arm_api_management_user.go rename to azurerm/internal/services/apimanagement/api_management_user_resource.go diff --git a/azurerm/internal/services/apimanagement/tests/data_source_api_management_api_test.go b/azurerm/internal/services/apimanagement/tests/api_management_api_data_source_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/data_source_api_management_api_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_api_data_source_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_policy_test.go b/azurerm/internal/services/apimanagement/tests/api_management_api_operation_policy_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_policy_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_api_operation_policy_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_test.go b/azurerm/internal/services/apimanagement/tests/api_management_api_operation_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_operation_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_api_operation_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_policy_test.go b/azurerm/internal/services/apimanagement/tests/api_management_api_policy_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_policy_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_api_policy_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_test.go b/azurerm/internal/services/apimanagement/tests/api_management_api_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_api_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_schema_test.go b/azurerm/internal/services/apimanagement/tests/api_management_api_schema_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_schema_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_api_schema_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/data_source_api_management_api_version_set_test.go b/azurerm/internal/services/apimanagement/tests/api_management_api_version_set_data_source_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/data_source_api_management_api_version_set_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_api_version_set_data_source_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_version_set_test.go b/azurerm/internal/services/apimanagement/tests/api_management_api_version_set_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_api_version_set_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_api_version_set_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go b/azurerm/internal/services/apimanagement/tests/api_management_authorization_server_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_authorization_server_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_authorization_server_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_backend_test.go b/azurerm/internal/services/apimanagement/tests/api_management_backend_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_backend_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_backend_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_certificate_test.go b/azurerm/internal/services/apimanagement/tests/api_management_certificate_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_certificate_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_certificate_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/data_source_api_management_test.go b/azurerm/internal/services/apimanagement/tests/api_management_data_source_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/data_source_api_management_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_data_source_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_diagnostic_test.go b/azurerm/internal/services/apimanagement/tests/api_management_diagnostic_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_diagnostic_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_diagnostic_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/data_source_api_management_group_test.go b/azurerm/internal/services/apimanagement/tests/api_management_group_data_source_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/data_source_api_management_group_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_group_data_source_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_group_test.go b/azurerm/internal/services/apimanagement/tests/api_management_group_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_group_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_group_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_group_user_test.go b/azurerm/internal/services/apimanagement/tests/api_management_group_user_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_group_user_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_group_user_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_aad_test.go b/azurerm/internal/services/apimanagement/tests/api_management_identity_provider_aad_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_aad_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_identity_provider_aad_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_facebook_test.go b/azurerm/internal/services/apimanagement/tests/api_management_identity_provider_facebook_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_facebook_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_identity_provider_facebook_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_google_test.go b/azurerm/internal/services/apimanagement/tests/api_management_identity_provider_google_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_google_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_identity_provider_google_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_microsoft_test.go b/azurerm/internal/services/apimanagement/tests/api_management_identity_provider_microsoft_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_microsoft_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_identity_provider_microsoft_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_twitter_test.go b/azurerm/internal/services/apimanagement/tests/api_management_identity_provider_twitter_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_identity_provider_twitter_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_identity_provider_twitter_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_logger_test.go b/azurerm/internal/services/apimanagement/tests/api_management_logger_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_logger_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_logger_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_named_value_test.go b/azurerm/internal/services/apimanagement/tests/api_management_named_value_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_named_value_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_named_value_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_openid_connect_provider_test.go b/azurerm/internal/services/apimanagement/tests/api_management_openid_connect_provider_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_openid_connect_provider_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_openid_connect_provider_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_api_test.go b/azurerm/internal/services/apimanagement/tests/api_management_product_api_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_api_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_product_api_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/data_source_api_management_product_test.go b/azurerm/internal/services/apimanagement/tests/api_management_product_data_source_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/data_source_api_management_product_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_product_data_source_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_group_test.go b/azurerm/internal/services/apimanagement/tests/api_management_product_group_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_group_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_product_group_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_policy_test.go b/azurerm/internal/services/apimanagement/tests/api_management_product_policy_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_policy_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_product_policy_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_test.go b/azurerm/internal/services/apimanagement/tests/api_management_product_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_product_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_product_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go b/azurerm/internal/services/apimanagement/tests/api_management_property_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_property_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_property_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_test.go b/azurerm/internal/services/apimanagement/tests/api_management_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go b/azurerm/internal/services/apimanagement/tests/api_management_subscription_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_subscription_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_subscription_resource_test.go diff --git a/azurerm/internal/services/apimanagement/tests/data_source_api_management_user_test.go b/azurerm/internal/services/apimanagement/tests/api_management_user_data_source_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/data_source_api_management_user_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_user_data_source_test.go diff --git a/azurerm/internal/services/apimanagement/tests/resource_arm_api_management_user_test.go b/azurerm/internal/services/apimanagement/tests/api_management_user_resource_test.go similarity index 100% rename from azurerm/internal/services/apimanagement/tests/resource_arm_api_management_user_test.go rename to azurerm/internal/services/apimanagement/tests/api_management_user_resource_test.go From 2602d138d20237548aa3bfd230de3bebbb2393a0 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 12:46:29 -0500 Subject: [PATCH 148/223] Updates `applicationinsights` --- ...cs_item.go => application_insights_analytics_item_resource.go} | 0 ...sights_api_key.go => application_insights_api_key_resource.go} | 0 ...pplication_insights.go => application_insights_data_source.go} | 0 ...m_application_insights.go => application_insights_resource.go} | 0 ...ghts_webtests.go => application_insights_webtests_resource.go} | 0 ...st.go => application_insights_analytics_item_resource_test.go} | 0 ..._key_test.go => application_insights_api_key_resource_test.go} | 0 ..._insights_test.go => application_insights_data_source_test.go} | 0 ...ion_insights_test.go => application_insights_resource_test.go} | 0 ...sts_test.go => application_insights_webtests_resource_test.go} | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/applicationinsights/{resource_arm_application_insights_analytics_item.go => application_insights_analytics_item_resource.go} (100%) rename azurerm/internal/services/applicationinsights/{resource_arm_application_insights_api_key.go => application_insights_api_key_resource.go} (100%) rename azurerm/internal/services/applicationinsights/{data_source_application_insights.go => application_insights_data_source.go} (100%) rename azurerm/internal/services/applicationinsights/{resource_arm_application_insights.go => application_insights_resource.go} (100%) rename azurerm/internal/services/applicationinsights/{resource_arm_application_insights_webtests.go => application_insights_webtests_resource.go} (100%) rename azurerm/internal/services/applicationinsights/tests/{resource_arm_application_insights_analytics_item_test.go => application_insights_analytics_item_resource_test.go} (100%) rename azurerm/internal/services/applicationinsights/tests/{resource_arm_application_insights_api_key_test.go => application_insights_api_key_resource_test.go} (100%) rename azurerm/internal/services/applicationinsights/tests/{data_source_application_insights_test.go => application_insights_data_source_test.go} (100%) rename azurerm/internal/services/applicationinsights/tests/{resource_arm_application_insights_test.go => application_insights_resource_test.go} (100%) rename azurerm/internal/services/applicationinsights/tests/{resource_arm_application_insights_webtests_test.go => application_insights_webtests_resource_test.go} (100%) diff --git a/azurerm/internal/services/applicationinsights/resource_arm_application_insights_analytics_item.go b/azurerm/internal/services/applicationinsights/application_insights_analytics_item_resource.go similarity index 100% rename from azurerm/internal/services/applicationinsights/resource_arm_application_insights_analytics_item.go rename to azurerm/internal/services/applicationinsights/application_insights_analytics_item_resource.go diff --git a/azurerm/internal/services/applicationinsights/resource_arm_application_insights_api_key.go b/azurerm/internal/services/applicationinsights/application_insights_api_key_resource.go similarity index 100% rename from azurerm/internal/services/applicationinsights/resource_arm_application_insights_api_key.go rename to azurerm/internal/services/applicationinsights/application_insights_api_key_resource.go diff --git a/azurerm/internal/services/applicationinsights/data_source_application_insights.go b/azurerm/internal/services/applicationinsights/application_insights_data_source.go similarity index 100% rename from azurerm/internal/services/applicationinsights/data_source_application_insights.go rename to azurerm/internal/services/applicationinsights/application_insights_data_source.go diff --git a/azurerm/internal/services/applicationinsights/resource_arm_application_insights.go b/azurerm/internal/services/applicationinsights/application_insights_resource.go similarity index 100% rename from azurerm/internal/services/applicationinsights/resource_arm_application_insights.go rename to azurerm/internal/services/applicationinsights/application_insights_resource.go diff --git a/azurerm/internal/services/applicationinsights/resource_arm_application_insights_webtests.go b/azurerm/internal/services/applicationinsights/application_insights_webtests_resource.go similarity index 100% rename from azurerm/internal/services/applicationinsights/resource_arm_application_insights_webtests.go rename to azurerm/internal/services/applicationinsights/application_insights_webtests_resource.go diff --git a/azurerm/internal/services/applicationinsights/tests/resource_arm_application_insights_analytics_item_test.go b/azurerm/internal/services/applicationinsights/tests/application_insights_analytics_item_resource_test.go similarity index 100% rename from azurerm/internal/services/applicationinsights/tests/resource_arm_application_insights_analytics_item_test.go rename to azurerm/internal/services/applicationinsights/tests/application_insights_analytics_item_resource_test.go diff --git a/azurerm/internal/services/applicationinsights/tests/resource_arm_application_insights_api_key_test.go b/azurerm/internal/services/applicationinsights/tests/application_insights_api_key_resource_test.go similarity index 100% rename from azurerm/internal/services/applicationinsights/tests/resource_arm_application_insights_api_key_test.go rename to azurerm/internal/services/applicationinsights/tests/application_insights_api_key_resource_test.go diff --git a/azurerm/internal/services/applicationinsights/tests/data_source_application_insights_test.go b/azurerm/internal/services/applicationinsights/tests/application_insights_data_source_test.go similarity index 100% rename from azurerm/internal/services/applicationinsights/tests/data_source_application_insights_test.go rename to azurerm/internal/services/applicationinsights/tests/application_insights_data_source_test.go diff --git a/azurerm/internal/services/applicationinsights/tests/resource_arm_application_insights_test.go b/azurerm/internal/services/applicationinsights/tests/application_insights_resource_test.go similarity index 100% rename from azurerm/internal/services/applicationinsights/tests/resource_arm_application_insights_test.go rename to azurerm/internal/services/applicationinsights/tests/application_insights_resource_test.go diff --git a/azurerm/internal/services/applicationinsights/tests/resource_arm_application_insights_webtests_test.go b/azurerm/internal/services/applicationinsights/tests/application_insights_webtests_resource_test.go similarity index 100% rename from azurerm/internal/services/applicationinsights/tests/resource_arm_application_insights_webtests_test.go rename to azurerm/internal/services/applicationinsights/tests/application_insights_webtests_resource_test.go From 0eedcec626d7597e6f2f0478ccd1e4cc2da86587 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 12:46:39 -0500 Subject: [PATCH 149/223] Updates `appplatform` --- ...ource_arm_spring_cloud_app.go => spring_cloud_app_resource.go} | 0 ...pring_cloud_service.go => spring_cloud_service_data_source.go} | 0 ...m_spring_cloud_service.go => spring_cloud_service_resource.go} | 0 ...spring_cloud_app_test.go => spring_cloud_app_resource_test.go} | 0 ...d_service_test.go => spring_cloud_service_data_source_test.go} | 0 ...loud_service_test.go => spring_cloud_service_resource_test.go} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/appplatform/{resource_arm_spring_cloud_app.go => spring_cloud_app_resource.go} (100%) rename azurerm/internal/services/appplatform/{data_source_spring_cloud_service.go => spring_cloud_service_data_source.go} (100%) rename azurerm/internal/services/appplatform/{resource_arm_spring_cloud_service.go => spring_cloud_service_resource.go} (100%) rename azurerm/internal/services/appplatform/tests/{resource_arm_spring_cloud_app_test.go => spring_cloud_app_resource_test.go} (100%) rename azurerm/internal/services/appplatform/tests/{data_source_spring_cloud_service_test.go => spring_cloud_service_data_source_test.go} (100%) rename azurerm/internal/services/appplatform/tests/{resource_arm_spring_cloud_service_test.go => spring_cloud_service_resource_test.go} (100%) diff --git a/azurerm/internal/services/appplatform/resource_arm_spring_cloud_app.go b/azurerm/internal/services/appplatform/spring_cloud_app_resource.go similarity index 100% rename from azurerm/internal/services/appplatform/resource_arm_spring_cloud_app.go rename to azurerm/internal/services/appplatform/spring_cloud_app_resource.go diff --git a/azurerm/internal/services/appplatform/data_source_spring_cloud_service.go b/azurerm/internal/services/appplatform/spring_cloud_service_data_source.go similarity index 100% rename from azurerm/internal/services/appplatform/data_source_spring_cloud_service.go rename to azurerm/internal/services/appplatform/spring_cloud_service_data_source.go diff --git a/azurerm/internal/services/appplatform/resource_arm_spring_cloud_service.go b/azurerm/internal/services/appplatform/spring_cloud_service_resource.go similarity index 100% rename from azurerm/internal/services/appplatform/resource_arm_spring_cloud_service.go rename to azurerm/internal/services/appplatform/spring_cloud_service_resource.go diff --git a/azurerm/internal/services/appplatform/tests/resource_arm_spring_cloud_app_test.go b/azurerm/internal/services/appplatform/tests/spring_cloud_app_resource_test.go similarity index 100% rename from azurerm/internal/services/appplatform/tests/resource_arm_spring_cloud_app_test.go rename to azurerm/internal/services/appplatform/tests/spring_cloud_app_resource_test.go diff --git a/azurerm/internal/services/appplatform/tests/data_source_spring_cloud_service_test.go b/azurerm/internal/services/appplatform/tests/spring_cloud_service_data_source_test.go similarity index 100% rename from azurerm/internal/services/appplatform/tests/data_source_spring_cloud_service_test.go rename to azurerm/internal/services/appplatform/tests/spring_cloud_service_data_source_test.go diff --git a/azurerm/internal/services/appplatform/tests/resource_arm_spring_cloud_service_test.go b/azurerm/internal/services/appplatform/tests/spring_cloud_service_resource_test.go similarity index 100% rename from azurerm/internal/services/appplatform/tests/resource_arm_spring_cloud_service_test.go rename to azurerm/internal/services/appplatform/tests/spring_cloud_service_resource_test.go From 06d0fb6dcb283a01c76da908789178ca8012f3d5 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 12:46:52 -0500 Subject: [PATCH 150/223] Updates `authorization` --- ...{data_source_client_config.go => client_config_data_source.go} | 0 ...esource_arm_role_assignment.go => role_assignment_resource.go} | 0 ...a_source_role_definition.go => role_definition_data_source.go} | 0 ...esource_arm_role_definition.go => role_definition_resource.go} | 0 ...ce_client_config_test.go => client_config_data_source_test.go} | 0 ...m_role_assignment_test.go => role_assignment_resource_test.go} | 0 ...ole_definition_test.go => role_definition_data_source_test.go} | 0 ...m_role_definition_test.go => role_definition_resource_test.go} | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/authorization/{data_source_client_config.go => client_config_data_source.go} (100%) rename azurerm/internal/services/authorization/{resource_arm_role_assignment.go => role_assignment_resource.go} (100%) rename azurerm/internal/services/authorization/{data_source_role_definition.go => role_definition_data_source.go} (100%) rename azurerm/internal/services/authorization/{resource_arm_role_definition.go => role_definition_resource.go} (100%) rename azurerm/internal/services/authorization/tests/{data_source_client_config_test.go => client_config_data_source_test.go} (100%) rename azurerm/internal/services/authorization/tests/{resource_arm_role_assignment_test.go => role_assignment_resource_test.go} (100%) rename azurerm/internal/services/authorization/tests/{data_source_role_definition_test.go => role_definition_data_source_test.go} (100%) rename azurerm/internal/services/authorization/tests/{resource_arm_role_definition_test.go => role_definition_resource_test.go} (100%) diff --git a/azurerm/internal/services/authorization/data_source_client_config.go b/azurerm/internal/services/authorization/client_config_data_source.go similarity index 100% rename from azurerm/internal/services/authorization/data_source_client_config.go rename to azurerm/internal/services/authorization/client_config_data_source.go diff --git a/azurerm/internal/services/authorization/resource_arm_role_assignment.go b/azurerm/internal/services/authorization/role_assignment_resource.go similarity index 100% rename from azurerm/internal/services/authorization/resource_arm_role_assignment.go rename to azurerm/internal/services/authorization/role_assignment_resource.go diff --git a/azurerm/internal/services/authorization/data_source_role_definition.go b/azurerm/internal/services/authorization/role_definition_data_source.go similarity index 100% rename from azurerm/internal/services/authorization/data_source_role_definition.go rename to azurerm/internal/services/authorization/role_definition_data_source.go diff --git a/azurerm/internal/services/authorization/resource_arm_role_definition.go b/azurerm/internal/services/authorization/role_definition_resource.go similarity index 100% rename from azurerm/internal/services/authorization/resource_arm_role_definition.go rename to azurerm/internal/services/authorization/role_definition_resource.go diff --git a/azurerm/internal/services/authorization/tests/data_source_client_config_test.go b/azurerm/internal/services/authorization/tests/client_config_data_source_test.go similarity index 100% rename from azurerm/internal/services/authorization/tests/data_source_client_config_test.go rename to azurerm/internal/services/authorization/tests/client_config_data_source_test.go diff --git a/azurerm/internal/services/authorization/tests/resource_arm_role_assignment_test.go b/azurerm/internal/services/authorization/tests/role_assignment_resource_test.go similarity index 100% rename from azurerm/internal/services/authorization/tests/resource_arm_role_assignment_test.go rename to azurerm/internal/services/authorization/tests/role_assignment_resource_test.go diff --git a/azurerm/internal/services/authorization/tests/data_source_role_definition_test.go b/azurerm/internal/services/authorization/tests/role_definition_data_source_test.go similarity index 100% rename from azurerm/internal/services/authorization/tests/data_source_role_definition_test.go rename to azurerm/internal/services/authorization/tests/role_definition_data_source_test.go diff --git a/azurerm/internal/services/authorization/tests/resource_arm_role_definition_test.go b/azurerm/internal/services/authorization/tests/role_definition_resource_test.go similarity index 100% rename from azurerm/internal/services/authorization/tests/resource_arm_role_definition_test.go rename to azurerm/internal/services/authorization/tests/role_definition_resource_test.go From e04002537edd0479833c34598d42e98c4b467e0a Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 12:47:01 -0500 Subject: [PATCH 151/223] Updates `automation` --- ...ce_automation_account.go => automation_account_data_source.go} | 0 ...e_arm_automation_account.go => automation_account_resource.go} | 0 ...tomation_certificate.go => automation_certificate_resource.go} | 0 ...automation_credential.go => automation_credential_resource.go} | 0 ..._configuration.go => automation_dsc_configuration_resource.go} | 0 ...figuration.go => automation_dsc_nodeconfiguration_resource.go} | 0 ...mation_job_schedule.go => automation_job_schedule_resource.go} | 0 ...rce_arm_automation_module.go => automation_module_resource.go} | 0 ...e_arm_automation_runbook.go => automation_runbook_resource.go} | 0 ...arm_automation_schedule.go => automation_schedule_resource.go} | 0 ...n_variable_bool.go => automation_variable_bool_data_source.go} | 0 ...tion_variable_bool.go => automation_variable_bool_resource.go} | 0 ...le_datetime.go => automation_variable_datetime_data_source.go} | 0 ...iable_datetime.go => automation_variable_datetime_resource.go} | 0 ...ion_variable_int.go => automation_variable_int_data_source.go} | 0 ...mation_variable_int.go => automation_variable_int_resource.go} | 0 ...riable_string.go => automation_variable_string_data_source.go} | 0 ..._variable_string.go => automation_variable_string_resource.go} | 0 ...ion_account_test.go => automation_account_data_source_test.go} | 0 ...mation_account_test.go => automation_account_resource_test.go} | 0 ...ertificate_test.go => automation_certificate_resource_test.go} | 0 ..._credential_test.go => automation_credential_resource_test.go} | 0 ...tion_test.go => automation_dsc_configuration_resource_test.go} | 0 ..._test.go => automation_dsc_nodeconfiguration_resource_test.go} | 0 ..._schedule_test.go => automation_job_schedule_resource_test.go} | 0 ...tomation_module_test.go => automation_module_resource_test.go} | 0 ...mation_runbook_test.go => automation_runbook_resource_test.go} | 0 ...tion_schedule_test.go => automation_schedule_resource_test.go} | 0 ..._bool_test.go => automation_variable_bool_data_source_test.go} | 0 ...ble_bool_test.go => automation_variable_bool_resource_test.go} | 0 ...e_test.go => automation_variable_datetime_data_source_test.go} | 0 ...time_test.go => automation_variable_datetime_resource_test.go} | 0 ...le_int_test.go => automation_variable_int_data_source_test.go} | 0 ...iable_int_test.go => automation_variable_int_resource_test.go} | 0 ...ing_test.go => automation_variable_string_data_source_test.go} | 0 ...string_test.go => automation_variable_string_resource_test.go} | 0 36 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/automation/{data_source_automation_account.go => automation_account_data_source.go} (100%) rename azurerm/internal/services/automation/{resource_arm_automation_account.go => automation_account_resource.go} (100%) rename azurerm/internal/services/automation/{resource_arm_automation_certificate.go => automation_certificate_resource.go} (100%) rename azurerm/internal/services/automation/{resource_arm_automation_credential.go => automation_credential_resource.go} (100%) rename azurerm/internal/services/automation/{resource_arm_automation_dsc_configuration.go => automation_dsc_configuration_resource.go} (100%) rename azurerm/internal/services/automation/{resource_arm_automation_dsc_nodeconfiguration.go => automation_dsc_nodeconfiguration_resource.go} (100%) rename azurerm/internal/services/automation/{resource_arm_automation_job_schedule.go => automation_job_schedule_resource.go} (100%) rename azurerm/internal/services/automation/{resource_arm_automation_module.go => automation_module_resource.go} (100%) rename azurerm/internal/services/automation/{resource_arm_automation_runbook.go => automation_runbook_resource.go} (100%) rename azurerm/internal/services/automation/{resource_arm_automation_schedule.go => automation_schedule_resource.go} (100%) rename azurerm/internal/services/automation/{data_source_automation_variable_bool.go => automation_variable_bool_data_source.go} (100%) rename azurerm/internal/services/automation/{resource_arm_automation_variable_bool.go => automation_variable_bool_resource.go} (100%) rename azurerm/internal/services/automation/{data_source_automation_variable_datetime.go => automation_variable_datetime_data_source.go} (100%) rename azurerm/internal/services/automation/{resource_arm_automation_variable_datetime.go => automation_variable_datetime_resource.go} (100%) rename azurerm/internal/services/automation/{data_source_automation_variable_int.go => automation_variable_int_data_source.go} (100%) rename azurerm/internal/services/automation/{resource_arm_automation_variable_int.go => automation_variable_int_resource.go} (100%) rename azurerm/internal/services/automation/{data_source_automation_variable_string.go => automation_variable_string_data_source.go} (100%) rename azurerm/internal/services/automation/{resource_arm_automation_variable_string.go => automation_variable_string_resource.go} (100%) rename azurerm/internal/services/automation/tests/{data_source_automation_account_test.go => automation_account_data_source_test.go} (100%) rename azurerm/internal/services/automation/tests/{resource_arm_automation_account_test.go => automation_account_resource_test.go} (100%) rename azurerm/internal/services/automation/tests/{resource_arm_automation_certificate_test.go => automation_certificate_resource_test.go} (100%) rename azurerm/internal/services/automation/tests/{resource_arm_automation_credential_test.go => automation_credential_resource_test.go} (100%) rename azurerm/internal/services/automation/tests/{resource_arm_automation_dsc_configuration_test.go => automation_dsc_configuration_resource_test.go} (100%) rename azurerm/internal/services/automation/tests/{resource_arm_automation_dsc_nodeconfiguration_test.go => automation_dsc_nodeconfiguration_resource_test.go} (100%) rename azurerm/internal/services/automation/tests/{resource_arm_automation_job_schedule_test.go => automation_job_schedule_resource_test.go} (100%) rename azurerm/internal/services/automation/tests/{resource_arm_automation_module_test.go => automation_module_resource_test.go} (100%) rename azurerm/internal/services/automation/tests/{resource_arm_automation_runbook_test.go => automation_runbook_resource_test.go} (100%) rename azurerm/internal/services/automation/tests/{resource_arm_automation_schedule_test.go => automation_schedule_resource_test.go} (100%) rename azurerm/internal/services/automation/tests/{data_source_automation_variable_bool_test.go => automation_variable_bool_data_source_test.go} (100%) rename azurerm/internal/services/automation/tests/{resource_arm_automation_variable_bool_test.go => automation_variable_bool_resource_test.go} (100%) rename azurerm/internal/services/automation/tests/{data_source_automation_variable_datetime_test.go => automation_variable_datetime_data_source_test.go} (100%) rename azurerm/internal/services/automation/tests/{resource_arm_automation_variable_datetime_test.go => automation_variable_datetime_resource_test.go} (100%) rename azurerm/internal/services/automation/tests/{data_source_automation_variable_int_test.go => automation_variable_int_data_source_test.go} (100%) rename azurerm/internal/services/automation/tests/{resource_arm_automation_variable_int_test.go => automation_variable_int_resource_test.go} (100%) rename azurerm/internal/services/automation/tests/{data_source_automation_variable_string_test.go => automation_variable_string_data_source_test.go} (100%) rename azurerm/internal/services/automation/tests/{resource_arm_automation_variable_string_test.go => automation_variable_string_resource_test.go} (100%) diff --git a/azurerm/internal/services/automation/data_source_automation_account.go b/azurerm/internal/services/automation/automation_account_data_source.go similarity index 100% rename from azurerm/internal/services/automation/data_source_automation_account.go rename to azurerm/internal/services/automation/automation_account_data_source.go diff --git a/azurerm/internal/services/automation/resource_arm_automation_account.go b/azurerm/internal/services/automation/automation_account_resource.go similarity index 100% rename from azurerm/internal/services/automation/resource_arm_automation_account.go rename to azurerm/internal/services/automation/automation_account_resource.go diff --git a/azurerm/internal/services/automation/resource_arm_automation_certificate.go b/azurerm/internal/services/automation/automation_certificate_resource.go similarity index 100% rename from azurerm/internal/services/automation/resource_arm_automation_certificate.go rename to azurerm/internal/services/automation/automation_certificate_resource.go diff --git a/azurerm/internal/services/automation/resource_arm_automation_credential.go b/azurerm/internal/services/automation/automation_credential_resource.go similarity index 100% rename from azurerm/internal/services/automation/resource_arm_automation_credential.go rename to azurerm/internal/services/automation/automation_credential_resource.go diff --git a/azurerm/internal/services/automation/resource_arm_automation_dsc_configuration.go b/azurerm/internal/services/automation/automation_dsc_configuration_resource.go similarity index 100% rename from azurerm/internal/services/automation/resource_arm_automation_dsc_configuration.go rename to azurerm/internal/services/automation/automation_dsc_configuration_resource.go diff --git a/azurerm/internal/services/automation/resource_arm_automation_dsc_nodeconfiguration.go b/azurerm/internal/services/automation/automation_dsc_nodeconfiguration_resource.go similarity index 100% rename from azurerm/internal/services/automation/resource_arm_automation_dsc_nodeconfiguration.go rename to azurerm/internal/services/automation/automation_dsc_nodeconfiguration_resource.go diff --git a/azurerm/internal/services/automation/resource_arm_automation_job_schedule.go b/azurerm/internal/services/automation/automation_job_schedule_resource.go similarity index 100% rename from azurerm/internal/services/automation/resource_arm_automation_job_schedule.go rename to azurerm/internal/services/automation/automation_job_schedule_resource.go diff --git a/azurerm/internal/services/automation/resource_arm_automation_module.go b/azurerm/internal/services/automation/automation_module_resource.go similarity index 100% rename from azurerm/internal/services/automation/resource_arm_automation_module.go rename to azurerm/internal/services/automation/automation_module_resource.go diff --git a/azurerm/internal/services/automation/resource_arm_automation_runbook.go b/azurerm/internal/services/automation/automation_runbook_resource.go similarity index 100% rename from azurerm/internal/services/automation/resource_arm_automation_runbook.go rename to azurerm/internal/services/automation/automation_runbook_resource.go diff --git a/azurerm/internal/services/automation/resource_arm_automation_schedule.go b/azurerm/internal/services/automation/automation_schedule_resource.go similarity index 100% rename from azurerm/internal/services/automation/resource_arm_automation_schedule.go rename to azurerm/internal/services/automation/automation_schedule_resource.go diff --git a/azurerm/internal/services/automation/data_source_automation_variable_bool.go b/azurerm/internal/services/automation/automation_variable_bool_data_source.go similarity index 100% rename from azurerm/internal/services/automation/data_source_automation_variable_bool.go rename to azurerm/internal/services/automation/automation_variable_bool_data_source.go diff --git a/azurerm/internal/services/automation/resource_arm_automation_variable_bool.go b/azurerm/internal/services/automation/automation_variable_bool_resource.go similarity index 100% rename from azurerm/internal/services/automation/resource_arm_automation_variable_bool.go rename to azurerm/internal/services/automation/automation_variable_bool_resource.go diff --git a/azurerm/internal/services/automation/data_source_automation_variable_datetime.go b/azurerm/internal/services/automation/automation_variable_datetime_data_source.go similarity index 100% rename from azurerm/internal/services/automation/data_source_automation_variable_datetime.go rename to azurerm/internal/services/automation/automation_variable_datetime_data_source.go diff --git a/azurerm/internal/services/automation/resource_arm_automation_variable_datetime.go b/azurerm/internal/services/automation/automation_variable_datetime_resource.go similarity index 100% rename from azurerm/internal/services/automation/resource_arm_automation_variable_datetime.go rename to azurerm/internal/services/automation/automation_variable_datetime_resource.go diff --git a/azurerm/internal/services/automation/data_source_automation_variable_int.go b/azurerm/internal/services/automation/automation_variable_int_data_source.go similarity index 100% rename from azurerm/internal/services/automation/data_source_automation_variable_int.go rename to azurerm/internal/services/automation/automation_variable_int_data_source.go diff --git a/azurerm/internal/services/automation/resource_arm_automation_variable_int.go b/azurerm/internal/services/automation/automation_variable_int_resource.go similarity index 100% rename from azurerm/internal/services/automation/resource_arm_automation_variable_int.go rename to azurerm/internal/services/automation/automation_variable_int_resource.go diff --git a/azurerm/internal/services/automation/data_source_automation_variable_string.go b/azurerm/internal/services/automation/automation_variable_string_data_source.go similarity index 100% rename from azurerm/internal/services/automation/data_source_automation_variable_string.go rename to azurerm/internal/services/automation/automation_variable_string_data_source.go diff --git a/azurerm/internal/services/automation/resource_arm_automation_variable_string.go b/azurerm/internal/services/automation/automation_variable_string_resource.go similarity index 100% rename from azurerm/internal/services/automation/resource_arm_automation_variable_string.go rename to azurerm/internal/services/automation/automation_variable_string_resource.go diff --git a/azurerm/internal/services/automation/tests/data_source_automation_account_test.go b/azurerm/internal/services/automation/tests/automation_account_data_source_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/data_source_automation_account_test.go rename to azurerm/internal/services/automation/tests/automation_account_data_source_test.go diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_account_test.go b/azurerm/internal/services/automation/tests/automation_account_resource_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/resource_arm_automation_account_test.go rename to azurerm/internal/services/automation/tests/automation_account_resource_test.go diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_certificate_test.go b/azurerm/internal/services/automation/tests/automation_certificate_resource_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/resource_arm_automation_certificate_test.go rename to azurerm/internal/services/automation/tests/automation_certificate_resource_test.go diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_credential_test.go b/azurerm/internal/services/automation/tests/automation_credential_resource_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/resource_arm_automation_credential_test.go rename to azurerm/internal/services/automation/tests/automation_credential_resource_test.go diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_dsc_configuration_test.go b/azurerm/internal/services/automation/tests/automation_dsc_configuration_resource_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/resource_arm_automation_dsc_configuration_test.go rename to azurerm/internal/services/automation/tests/automation_dsc_configuration_resource_test.go diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_dsc_nodeconfiguration_test.go b/azurerm/internal/services/automation/tests/automation_dsc_nodeconfiguration_resource_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/resource_arm_automation_dsc_nodeconfiguration_test.go rename to azurerm/internal/services/automation/tests/automation_dsc_nodeconfiguration_resource_test.go diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_job_schedule_test.go b/azurerm/internal/services/automation/tests/automation_job_schedule_resource_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/resource_arm_automation_job_schedule_test.go rename to azurerm/internal/services/automation/tests/automation_job_schedule_resource_test.go diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_module_test.go b/azurerm/internal/services/automation/tests/automation_module_resource_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/resource_arm_automation_module_test.go rename to azurerm/internal/services/automation/tests/automation_module_resource_test.go diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_runbook_test.go b/azurerm/internal/services/automation/tests/automation_runbook_resource_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/resource_arm_automation_runbook_test.go rename to azurerm/internal/services/automation/tests/automation_runbook_resource_test.go diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_schedule_test.go b/azurerm/internal/services/automation/tests/automation_schedule_resource_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/resource_arm_automation_schedule_test.go rename to azurerm/internal/services/automation/tests/automation_schedule_resource_test.go diff --git a/azurerm/internal/services/automation/tests/data_source_automation_variable_bool_test.go b/azurerm/internal/services/automation/tests/automation_variable_bool_data_source_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/data_source_automation_variable_bool_test.go rename to azurerm/internal/services/automation/tests/automation_variable_bool_data_source_test.go diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_variable_bool_test.go b/azurerm/internal/services/automation/tests/automation_variable_bool_resource_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/resource_arm_automation_variable_bool_test.go rename to azurerm/internal/services/automation/tests/automation_variable_bool_resource_test.go diff --git a/azurerm/internal/services/automation/tests/data_source_automation_variable_datetime_test.go b/azurerm/internal/services/automation/tests/automation_variable_datetime_data_source_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/data_source_automation_variable_datetime_test.go rename to azurerm/internal/services/automation/tests/automation_variable_datetime_data_source_test.go diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_variable_datetime_test.go b/azurerm/internal/services/automation/tests/automation_variable_datetime_resource_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/resource_arm_automation_variable_datetime_test.go rename to azurerm/internal/services/automation/tests/automation_variable_datetime_resource_test.go diff --git a/azurerm/internal/services/automation/tests/data_source_automation_variable_int_test.go b/azurerm/internal/services/automation/tests/automation_variable_int_data_source_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/data_source_automation_variable_int_test.go rename to azurerm/internal/services/automation/tests/automation_variable_int_data_source_test.go diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_variable_int_test.go b/azurerm/internal/services/automation/tests/automation_variable_int_resource_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/resource_arm_automation_variable_int_test.go rename to azurerm/internal/services/automation/tests/automation_variable_int_resource_test.go diff --git a/azurerm/internal/services/automation/tests/data_source_automation_variable_string_test.go b/azurerm/internal/services/automation/tests/automation_variable_string_data_source_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/data_source_automation_variable_string_test.go rename to azurerm/internal/services/automation/tests/automation_variable_string_data_source_test.go diff --git a/azurerm/internal/services/automation/tests/resource_arm_automation_variable_string_test.go b/azurerm/internal/services/automation/tests/automation_variable_string_resource_test.go similarity index 100% rename from azurerm/internal/services/automation/tests/resource_arm_automation_variable_string_test.go rename to azurerm/internal/services/automation/tests/automation_variable_string_resource_test.go From 4b92512faa538881a8c819d8c9f4e6f0aeb43463 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 12:47:54 -0500 Subject: [PATCH 152/223] Updates `batch` --- ...{data_source_batch_account.go => batch_account_data_source.go} | 0 .../{resource_arm_batch_account.go => batch_account_resource.go} | 0 ...rce_arm_batch_application.go => batch_application_resource.go} | 0 ...urce_batch_certificate.go => batch_certificate_data_source.go} | 0 ...rce_arm_batch_certificate.go => batch_certificate_resource.go} | 0 .../{data_source_batch_pool.go => batch_pool_data_source.go} | 0 .../batch/{resource_arm_batch_pool.go => batch_pool_resource.go} | 0 ...ce_batch_account_test.go => batch_account_data_source_test.go} | 0 ...e_arm_batch_account_test.go => batch_account_resource_test.go} | 0 ...tch_application_test.go => batch_application_resource_test.go} | 0 ..._certificate_test.go => batch_certificate_data_source_test.go} | 0 ...tch_certificate_test.go => batch_certificate_resource_test.go} | 0 ...a_source_batch_pool_test.go => batch_pool_data_source_test.go} | 0 ...esource_arm_batch_pool_test.go => batch_pool_resource_test.go} | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/batch/{data_source_batch_account.go => batch_account_data_source.go} (100%) rename azurerm/internal/services/batch/{resource_arm_batch_account.go => batch_account_resource.go} (100%) rename azurerm/internal/services/batch/{resource_arm_batch_application.go => batch_application_resource.go} (100%) rename azurerm/internal/services/batch/{data_source_batch_certificate.go => batch_certificate_data_source.go} (100%) rename azurerm/internal/services/batch/{resource_arm_batch_certificate.go => batch_certificate_resource.go} (100%) rename azurerm/internal/services/batch/{data_source_batch_pool.go => batch_pool_data_source.go} (100%) rename azurerm/internal/services/batch/{resource_arm_batch_pool.go => batch_pool_resource.go} (100%) rename azurerm/internal/services/batch/tests/{data_source_batch_account_test.go => batch_account_data_source_test.go} (100%) rename azurerm/internal/services/batch/tests/{resource_arm_batch_account_test.go => batch_account_resource_test.go} (100%) rename azurerm/internal/services/batch/tests/{resource_arm_batch_application_test.go => batch_application_resource_test.go} (100%) rename azurerm/internal/services/batch/tests/{data_source_batch_certificate_test.go => batch_certificate_data_source_test.go} (100%) rename azurerm/internal/services/batch/tests/{resource_arm_batch_certificate_test.go => batch_certificate_resource_test.go} (100%) rename azurerm/internal/services/batch/tests/{data_source_batch_pool_test.go => batch_pool_data_source_test.go} (100%) rename azurerm/internal/services/batch/tests/{resource_arm_batch_pool_test.go => batch_pool_resource_test.go} (100%) diff --git a/azurerm/internal/services/batch/data_source_batch_account.go b/azurerm/internal/services/batch/batch_account_data_source.go similarity index 100% rename from azurerm/internal/services/batch/data_source_batch_account.go rename to azurerm/internal/services/batch/batch_account_data_source.go diff --git a/azurerm/internal/services/batch/resource_arm_batch_account.go b/azurerm/internal/services/batch/batch_account_resource.go similarity index 100% rename from azurerm/internal/services/batch/resource_arm_batch_account.go rename to azurerm/internal/services/batch/batch_account_resource.go diff --git a/azurerm/internal/services/batch/resource_arm_batch_application.go b/azurerm/internal/services/batch/batch_application_resource.go similarity index 100% rename from azurerm/internal/services/batch/resource_arm_batch_application.go rename to azurerm/internal/services/batch/batch_application_resource.go diff --git a/azurerm/internal/services/batch/data_source_batch_certificate.go b/azurerm/internal/services/batch/batch_certificate_data_source.go similarity index 100% rename from azurerm/internal/services/batch/data_source_batch_certificate.go rename to azurerm/internal/services/batch/batch_certificate_data_source.go diff --git a/azurerm/internal/services/batch/resource_arm_batch_certificate.go b/azurerm/internal/services/batch/batch_certificate_resource.go similarity index 100% rename from azurerm/internal/services/batch/resource_arm_batch_certificate.go rename to azurerm/internal/services/batch/batch_certificate_resource.go diff --git a/azurerm/internal/services/batch/data_source_batch_pool.go b/azurerm/internal/services/batch/batch_pool_data_source.go similarity index 100% rename from azurerm/internal/services/batch/data_source_batch_pool.go rename to azurerm/internal/services/batch/batch_pool_data_source.go diff --git a/azurerm/internal/services/batch/resource_arm_batch_pool.go b/azurerm/internal/services/batch/batch_pool_resource.go similarity index 100% rename from azurerm/internal/services/batch/resource_arm_batch_pool.go rename to azurerm/internal/services/batch/batch_pool_resource.go diff --git a/azurerm/internal/services/batch/tests/data_source_batch_account_test.go b/azurerm/internal/services/batch/tests/batch_account_data_source_test.go similarity index 100% rename from azurerm/internal/services/batch/tests/data_source_batch_account_test.go rename to azurerm/internal/services/batch/tests/batch_account_data_source_test.go diff --git a/azurerm/internal/services/batch/tests/resource_arm_batch_account_test.go b/azurerm/internal/services/batch/tests/batch_account_resource_test.go similarity index 100% rename from azurerm/internal/services/batch/tests/resource_arm_batch_account_test.go rename to azurerm/internal/services/batch/tests/batch_account_resource_test.go diff --git a/azurerm/internal/services/batch/tests/resource_arm_batch_application_test.go b/azurerm/internal/services/batch/tests/batch_application_resource_test.go similarity index 100% rename from azurerm/internal/services/batch/tests/resource_arm_batch_application_test.go rename to azurerm/internal/services/batch/tests/batch_application_resource_test.go diff --git a/azurerm/internal/services/batch/tests/data_source_batch_certificate_test.go b/azurerm/internal/services/batch/tests/batch_certificate_data_source_test.go similarity index 100% rename from azurerm/internal/services/batch/tests/data_source_batch_certificate_test.go rename to azurerm/internal/services/batch/tests/batch_certificate_data_source_test.go diff --git a/azurerm/internal/services/batch/tests/resource_arm_batch_certificate_test.go b/azurerm/internal/services/batch/tests/batch_certificate_resource_test.go similarity index 100% rename from azurerm/internal/services/batch/tests/resource_arm_batch_certificate_test.go rename to azurerm/internal/services/batch/tests/batch_certificate_resource_test.go diff --git a/azurerm/internal/services/batch/tests/data_source_batch_pool_test.go b/azurerm/internal/services/batch/tests/batch_pool_data_source_test.go similarity index 100% rename from azurerm/internal/services/batch/tests/data_source_batch_pool_test.go rename to azurerm/internal/services/batch/tests/batch_pool_data_source_test.go diff --git a/azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go b/azurerm/internal/services/batch/tests/batch_pool_resource_test.go similarity index 100% rename from azurerm/internal/services/batch/tests/resource_arm_batch_pool_test.go rename to azurerm/internal/services/batch/tests/batch_pool_resource_test.go From 9bd602db7859a52aa7a9aa2b08409b05de60fa70 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 12:48:09 -0500 Subject: [PATCH 153/223] Updates `bot` --- ...t_channel_directline.go => bot_channel_directline_resource.go} | 0 ...rce_arm_bot_channel_email.go => bot_channel_email_resource.go} | 0 ...m_bot_channel_ms_teams.go => bot_channel_ms_teams_resource.go} | 0 ...rce_arm_bot_channel_slack.go => bot_channel_slack_resource.go} | 0 ...nels_registration.go => bot_channels_registration_resource.go} | 0 ...{resource_arm_bot_connection.go => bot_connection_resource.go} | 0 .../bot/{resource_arm_bot_web_app.go => bot_web_app_resource.go} | 0 ...directline_test.go => bot_channel_directline_resource_test.go} | 0 ...t_channel_email_test.go => bot_channel_email_resource_test.go} | 0 ...nel_ms_teams_test.go => bot_channel_ms_teams_resource_test.go} | 0 ...t_channel_slack_test.go => bot_channel_slack_resource_test.go} | 0 ...tration_test.go => bot_channels_registration_resource_test.go} | 0 ...arm_bot_connection_test.go => bot_connection_resource_test.go} | 0 ...ource_arm_bot_web_app_test.go => bot_web_app_resource_test.go} | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/bot/{resource_arm_bot_channel_directline.go => bot_channel_directline_resource.go} (100%) rename azurerm/internal/services/bot/{resource_arm_bot_channel_email.go => bot_channel_email_resource.go} (100%) rename azurerm/internal/services/bot/{resource_arm_bot_channel_ms_teams.go => bot_channel_ms_teams_resource.go} (100%) rename azurerm/internal/services/bot/{resource_arm_bot_channel_slack.go => bot_channel_slack_resource.go} (100%) rename azurerm/internal/services/bot/{resource_arm_bot_channels_registration.go => bot_channels_registration_resource.go} (100%) rename azurerm/internal/services/bot/{resource_arm_bot_connection.go => bot_connection_resource.go} (100%) rename azurerm/internal/services/bot/{resource_arm_bot_web_app.go => bot_web_app_resource.go} (100%) rename azurerm/internal/services/bot/tests/{resource_arm_bot_channel_directline_test.go => bot_channel_directline_resource_test.go} (100%) rename azurerm/internal/services/bot/tests/{resource_arm_bot_channel_email_test.go => bot_channel_email_resource_test.go} (100%) rename azurerm/internal/services/bot/tests/{resource_arm_bot_channel_ms_teams_test.go => bot_channel_ms_teams_resource_test.go} (100%) rename azurerm/internal/services/bot/tests/{resource_arm_bot_channel_slack_test.go => bot_channel_slack_resource_test.go} (100%) rename azurerm/internal/services/bot/tests/{resource_arm_bot_channels_registration_test.go => bot_channels_registration_resource_test.go} (100%) rename azurerm/internal/services/bot/tests/{resource_arm_bot_connection_test.go => bot_connection_resource_test.go} (100%) rename azurerm/internal/services/bot/tests/{resource_arm_bot_web_app_test.go => bot_web_app_resource_test.go} (100%) diff --git a/azurerm/internal/services/bot/resource_arm_bot_channel_directline.go b/azurerm/internal/services/bot/bot_channel_directline_resource.go similarity index 100% rename from azurerm/internal/services/bot/resource_arm_bot_channel_directline.go rename to azurerm/internal/services/bot/bot_channel_directline_resource.go diff --git a/azurerm/internal/services/bot/resource_arm_bot_channel_email.go b/azurerm/internal/services/bot/bot_channel_email_resource.go similarity index 100% rename from azurerm/internal/services/bot/resource_arm_bot_channel_email.go rename to azurerm/internal/services/bot/bot_channel_email_resource.go diff --git a/azurerm/internal/services/bot/resource_arm_bot_channel_ms_teams.go b/azurerm/internal/services/bot/bot_channel_ms_teams_resource.go similarity index 100% rename from azurerm/internal/services/bot/resource_arm_bot_channel_ms_teams.go rename to azurerm/internal/services/bot/bot_channel_ms_teams_resource.go diff --git a/azurerm/internal/services/bot/resource_arm_bot_channel_slack.go b/azurerm/internal/services/bot/bot_channel_slack_resource.go similarity index 100% rename from azurerm/internal/services/bot/resource_arm_bot_channel_slack.go rename to azurerm/internal/services/bot/bot_channel_slack_resource.go diff --git a/azurerm/internal/services/bot/resource_arm_bot_channels_registration.go b/azurerm/internal/services/bot/bot_channels_registration_resource.go similarity index 100% rename from azurerm/internal/services/bot/resource_arm_bot_channels_registration.go rename to azurerm/internal/services/bot/bot_channels_registration_resource.go diff --git a/azurerm/internal/services/bot/resource_arm_bot_connection.go b/azurerm/internal/services/bot/bot_connection_resource.go similarity index 100% rename from azurerm/internal/services/bot/resource_arm_bot_connection.go rename to azurerm/internal/services/bot/bot_connection_resource.go diff --git a/azurerm/internal/services/bot/resource_arm_bot_web_app.go b/azurerm/internal/services/bot/bot_web_app_resource.go similarity index 100% rename from azurerm/internal/services/bot/resource_arm_bot_web_app.go rename to azurerm/internal/services/bot/bot_web_app_resource.go diff --git a/azurerm/internal/services/bot/tests/resource_arm_bot_channel_directline_test.go b/azurerm/internal/services/bot/tests/bot_channel_directline_resource_test.go similarity index 100% rename from azurerm/internal/services/bot/tests/resource_arm_bot_channel_directline_test.go rename to azurerm/internal/services/bot/tests/bot_channel_directline_resource_test.go diff --git a/azurerm/internal/services/bot/tests/resource_arm_bot_channel_email_test.go b/azurerm/internal/services/bot/tests/bot_channel_email_resource_test.go similarity index 100% rename from azurerm/internal/services/bot/tests/resource_arm_bot_channel_email_test.go rename to azurerm/internal/services/bot/tests/bot_channel_email_resource_test.go diff --git a/azurerm/internal/services/bot/tests/resource_arm_bot_channel_ms_teams_test.go b/azurerm/internal/services/bot/tests/bot_channel_ms_teams_resource_test.go similarity index 100% rename from azurerm/internal/services/bot/tests/resource_arm_bot_channel_ms_teams_test.go rename to azurerm/internal/services/bot/tests/bot_channel_ms_teams_resource_test.go diff --git a/azurerm/internal/services/bot/tests/resource_arm_bot_channel_slack_test.go b/azurerm/internal/services/bot/tests/bot_channel_slack_resource_test.go similarity index 100% rename from azurerm/internal/services/bot/tests/resource_arm_bot_channel_slack_test.go rename to azurerm/internal/services/bot/tests/bot_channel_slack_resource_test.go diff --git a/azurerm/internal/services/bot/tests/resource_arm_bot_channels_registration_test.go b/azurerm/internal/services/bot/tests/bot_channels_registration_resource_test.go similarity index 100% rename from azurerm/internal/services/bot/tests/resource_arm_bot_channels_registration_test.go rename to azurerm/internal/services/bot/tests/bot_channels_registration_resource_test.go diff --git a/azurerm/internal/services/bot/tests/resource_arm_bot_connection_test.go b/azurerm/internal/services/bot/tests/bot_connection_resource_test.go similarity index 100% rename from azurerm/internal/services/bot/tests/resource_arm_bot_connection_test.go rename to azurerm/internal/services/bot/tests/bot_connection_resource_test.go diff --git a/azurerm/internal/services/bot/tests/resource_arm_bot_web_app_test.go b/azurerm/internal/services/bot/tests/bot_web_app_resource_test.go similarity index 100% rename from azurerm/internal/services/bot/tests/resource_arm_bot_web_app_test.go rename to azurerm/internal/services/bot/tests/bot_web_app_resource_test.go From d48eacfba0b17933536878cfbb5df00f9b3a195b Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 12:48:17 -0500 Subject: [PATCH 154/223] Updates `cdn` --- .../{resource_arm_cdn_endpoint.go => cdn_endpoint_resource.go} | 0 .../{data_source_cdn_profile.go => cdn_profile_data_source.go} | 0 .../cdn/{resource_arm_cdn_profile.go => cdn_profile_resource.go} | 0 ...rce_arm_cdn_endpoint_test.go => cdn_endpoint_resource_test.go} | 0 ...source_cdn_profile_test.go => cdn_profile_data_source_test.go} | 0 ...ource_arm_cdn_profile_test.go => cdn_profile_resource_test.go} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/cdn/{resource_arm_cdn_endpoint.go => cdn_endpoint_resource.go} (100%) rename azurerm/internal/services/cdn/{data_source_cdn_profile.go => cdn_profile_data_source.go} (100%) rename azurerm/internal/services/cdn/{resource_arm_cdn_profile.go => cdn_profile_resource.go} (100%) rename azurerm/internal/services/cdn/tests/{resource_arm_cdn_endpoint_test.go => cdn_endpoint_resource_test.go} (100%) rename azurerm/internal/services/cdn/tests/{data_source_cdn_profile_test.go => cdn_profile_data_source_test.go} (100%) rename azurerm/internal/services/cdn/tests/{resource_arm_cdn_profile_test.go => cdn_profile_resource_test.go} (100%) diff --git a/azurerm/internal/services/cdn/resource_arm_cdn_endpoint.go b/azurerm/internal/services/cdn/cdn_endpoint_resource.go similarity index 100% rename from azurerm/internal/services/cdn/resource_arm_cdn_endpoint.go rename to azurerm/internal/services/cdn/cdn_endpoint_resource.go diff --git a/azurerm/internal/services/cdn/data_source_cdn_profile.go b/azurerm/internal/services/cdn/cdn_profile_data_source.go similarity index 100% rename from azurerm/internal/services/cdn/data_source_cdn_profile.go rename to azurerm/internal/services/cdn/cdn_profile_data_source.go diff --git a/azurerm/internal/services/cdn/resource_arm_cdn_profile.go b/azurerm/internal/services/cdn/cdn_profile_resource.go similarity index 100% rename from azurerm/internal/services/cdn/resource_arm_cdn_profile.go rename to azurerm/internal/services/cdn/cdn_profile_resource.go diff --git a/azurerm/internal/services/cdn/tests/resource_arm_cdn_endpoint_test.go b/azurerm/internal/services/cdn/tests/cdn_endpoint_resource_test.go similarity index 100% rename from azurerm/internal/services/cdn/tests/resource_arm_cdn_endpoint_test.go rename to azurerm/internal/services/cdn/tests/cdn_endpoint_resource_test.go diff --git a/azurerm/internal/services/cdn/tests/data_source_cdn_profile_test.go b/azurerm/internal/services/cdn/tests/cdn_profile_data_source_test.go similarity index 100% rename from azurerm/internal/services/cdn/tests/data_source_cdn_profile_test.go rename to azurerm/internal/services/cdn/tests/cdn_profile_data_source_test.go diff --git a/azurerm/internal/services/cdn/tests/resource_arm_cdn_profile_test.go b/azurerm/internal/services/cdn/tests/cdn_profile_resource_test.go similarity index 100% rename from azurerm/internal/services/cdn/tests/resource_arm_cdn_profile_test.go rename to azurerm/internal/services/cdn/tests/cdn_profile_resource_test.go From 983c0d5691d534d94860d4d080f874e5068a866c Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 12:48:25 -0500 Subject: [PATCH 155/223] Updates `cognitive` --- ...rce_arm_cognitive_account.go => cognitive_account_resource.go} | 0 ...gnitive_account_test.go => cognitive_account_resource_test.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/cognitive/{resource_arm_cognitive_account.go => cognitive_account_resource.go} (100%) rename azurerm/internal/services/cognitive/tests/{resource_arm_cognitive_account_test.go => cognitive_account_resource_test.go} (100%) diff --git a/azurerm/internal/services/cognitive/resource_arm_cognitive_account.go b/azurerm/internal/services/cognitive/cognitive_account_resource.go similarity index 100% rename from azurerm/internal/services/cognitive/resource_arm_cognitive_account.go rename to azurerm/internal/services/cognitive/cognitive_account_resource.go diff --git a/azurerm/internal/services/cognitive/tests/resource_arm_cognitive_account_test.go b/azurerm/internal/services/cognitive/tests/cognitive_account_resource_test.go similarity index 100% rename from azurerm/internal/services/cognitive/tests/resource_arm_cognitive_account_test.go rename to azurerm/internal/services/cognitive/tests/cognitive_account_resource_test.go From 20ac9e0821a13a9be35d8e88514dbf0e8a0cd8dd Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:13:06 -0500 Subject: [PATCH 156/223] Updates `compute` --- ...source_availability_set.go => availability_set_data_source.go} | 0 ...ource_arm_availability_set.go => availability_set_resource.go} | 0 ...ata_source_dedicated_host.go => dedicated_host_data_source.go} | 0 ...edicated_host_group.go => dedicated_host_group_data_source.go} | 0 ...m_dedicated_host_group.go => dedicated_host_group_resource.go} | 0 ...{resource_arm_dedicated_host.go => dedicated_host_resource.go} | 0 ..._disk_encryption_set.go => disk_encryption_set_data_source.go} | 0 ...arm_disk_encryption_set.go => disk_encryption_set_resource.go} | 0 .../compute/{data_source_image.go => image_data_source.go} | 0 .../services/compute/{resource_arm_image.go => image_resource.go} | 0 ...e_scale_set.go => linux_virtual_machine_scale_set_resource.go} | 0 .../{data_source_managed_disk.go => managed_disk_data_source.go} | 0 .../{resource_arm_managed_disk.go => managed_disk_resource.go} | 0 ...marketplace_agreement.go => marketplace_agreement_resource.go} | 0 ...ata_source_platform_image.go => platform_image_data_source.go} | 0 ...lacement_group.go => proximity_placement_group_data_source.go} | 0 ...y_placement_group.go => proximity_placement_group_resource.go} | 0 .../{data_source_shared_image.go => shared_image_data_source.go} | 0 ...hared_image_gallery.go => shared_image_gallery_data_source.go} | 0 ...m_shared_image_gallery.go => shared_image_gallery_resource.go} | 0 .../{resource_arm_shared_image.go => shared_image_resource.go} | 0 ...hared_image_version.go => shared_image_version_data_source.go} | 0 ...m_shared_image_version.go => shared_image_version_resource.go} | 0 ...red_image_versions.go => shared_image_versions_data_source.go} | 0 .../compute/{data_source_snapshot.go => snapshot_data_source.go} | 0 .../compute/{resource_arm_snapshot.go => snapshot_resource.go} | 0 ...ilability_set_test.go => availability_set_data_source_test.go} | 0 ...availability_set_test.go => availability_set_resource_test.go} | 0 ..._dedicated_host_test.go => dedicated_host_data_source_test.go} | 0 ...ost_group_test.go => dedicated_host_group_data_source_test.go} | 0 ...d_host_group_test.go => dedicated_host_group_resource_test.go} | 0 ...arm_dedicated_host_test.go => dedicated_host_resource_test.go} | 0 ...yption_set_test.go => disk_encryption_set_data_source_test.go} | 0 ...ncryption_set_test.go => disk_encryption_set_resource_test.go} | 0 .../{data_source_image_test.go => image_data_source_test.go} | 0 .../tests/{resource_arm_image_test.go => image_resource_test.go} | 0 ...t.go => linux_virtual_machine_scale_set_auth_resource_test.go} | 0 ...=> linux_virtual_machine_scale_set_disk_data_resource_test.go} | 0 ...o => linux_virtual_machine_scale_set_disk_os_resource_test.go} | 0 ... => linux_virtual_machine_scale_set_identity_resource_test.go} | 0 ...go => linux_virtual_machine_scale_set_images_resource_test.go} | 0 ...o => linux_virtual_machine_scale_set_network_resource_test.go} | 0 ....go => linux_virtual_machine_scale_set_other_resource_test.go} | 0 ...t_test.go => linux_virtual_machine_scale_set_resource_test.go} | 0 ...o => linux_virtual_machine_scale_set_scaling_resource_test.go} | 0 ...urce_managed_disk_test.go => managed_disk_data_source_test.go} | 0 ...rce_arm_managed_disk_test.go => managed_disk_resource_test.go} | 0 ...e_agreement_test.go => marketplace_agreement_resource_test.go} | 0 ..._platform_image_test.go => platform_image_data_source_test.go} | 0 ...roup_test.go => proximity_placement_group_data_source_test.go} | 0 ...t_group_test.go => proximity_placement_group_resource_test.go} | 0 ...urce_shared_image_test.go => shared_image_data_source_test.go} | 0 ...e_gallery_test.go => shared_image_gallery_data_source_test.go} | 0 ...mage_gallery_test.go => shared_image_gallery_resource_test.go} | 0 ...rce_arm_shared_image_test.go => shared_image_resource_test.go} | 0 ...e_version_test.go => shared_image_version_data_source_test.go} | 0 ...mage_version_test.go => shared_image_version_resource_test.go} | 0 ...versions_test.go => shared_image_versions_data_source_test.go} | 0 ...{data_source_snapshot_test.go => snapshot_data_source_test.go} | 0 .../{resource_arm_snapshot_test.go => snapshot_resource_test.go} | 0 ...t.go => virtual_machine_data_disk_attachment_resource_test.go} | 0 ...irtual_machine_test.go => virtual_machine_data_source_test.go} | 0 ...tension_test.go => virtual_machine_extension_resource_test.go} | 0 ...sks_test.go => virtual_machine_managed_disks_resource_test.go} | 0 ...m_virtual_machine_test.go => virtual_machine_resource_test.go} | 0 ...st.go => virtual_machine_scale_set_extension_resource_test.go} | 0 ...ale_set_test.go => virtual_machine_scale_set_resource_test.go} | 0 ...s_test.go => virtual_machine_unmanaged_disks_resource_test.go} | 0 ...go => windows_virtual_machine_scale_set_auth_resource_test.go} | 0 ... windows_virtual_machine_scale_set_disk_data_resource_test.go} | 0 ...=> windows_virtual_machine_scale_set_disk_os_resource_test.go} | 0 ...> windows_virtual_machine_scale_set_identity_resource_test.go} | 0 ... => windows_virtual_machine_scale_set_images_resource_test.go} | 0 ...=> windows_virtual_machine_scale_set_network_resource_test.go} | 0 ...o => windows_virtual_machine_scale_set_other_resource_test.go} | 0 ...test.go => windows_virtual_machine_scale_set_resource_test.go} | 0 ...=> windows_virtual_machine_scale_set_scaling_resource_test.go} | 0 ...chment.go => virtual_machine_data_disk_attachment_resource.go} | 0 ...a_source_virtual_machine.go => virtual_machine_data_source.go} | 0 ...machine_extension.go => virtual_machine_extension_resource.go} | 0 ...esource_arm_virtual_machine.go => virtual_machine_resource.go} | 0 ...tension.go => virtual_machine_scale_set_extension_resource.go} | 0 ...gration.go => virtual_machine_scale_set_migration_resource.go} | 0 ...machine_scale_set.go => virtual_machine_scale_set_resource.go} | 0 ...scale_set.go => windows_virtual_machine_scale_set_resource.go} | 0 85 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/compute/{data_source_availability_set.go => availability_set_data_source.go} (100%) rename azurerm/internal/services/compute/{resource_arm_availability_set.go => availability_set_resource.go} (100%) rename azurerm/internal/services/compute/{data_source_dedicated_host.go => dedicated_host_data_source.go} (100%) rename azurerm/internal/services/compute/{data_source_dedicated_host_group.go => dedicated_host_group_data_source.go} (100%) rename azurerm/internal/services/compute/{resource_arm_dedicated_host_group.go => dedicated_host_group_resource.go} (100%) rename azurerm/internal/services/compute/{resource_arm_dedicated_host.go => dedicated_host_resource.go} (100%) rename azurerm/internal/services/compute/{data_source_disk_encryption_set.go => disk_encryption_set_data_source.go} (100%) rename azurerm/internal/services/compute/{resource_arm_disk_encryption_set.go => disk_encryption_set_resource.go} (100%) rename azurerm/internal/services/compute/{data_source_image.go => image_data_source.go} (100%) rename azurerm/internal/services/compute/{resource_arm_image.go => image_resource.go} (100%) rename azurerm/internal/services/compute/{resource_arm_linux_virtual_machine_scale_set.go => linux_virtual_machine_scale_set_resource.go} (100%) rename azurerm/internal/services/compute/{data_source_managed_disk.go => managed_disk_data_source.go} (100%) rename azurerm/internal/services/compute/{resource_arm_managed_disk.go => managed_disk_resource.go} (100%) rename azurerm/internal/services/compute/{resource_arm_marketplace_agreement.go => marketplace_agreement_resource.go} (100%) rename azurerm/internal/services/compute/{data_source_platform_image.go => platform_image_data_source.go} (100%) rename azurerm/internal/services/compute/{data_source_proximity_placement_group.go => proximity_placement_group_data_source.go} (100%) rename azurerm/internal/services/compute/{resource_arm_proximity_placement_group.go => proximity_placement_group_resource.go} (100%) rename azurerm/internal/services/compute/{data_source_shared_image.go => shared_image_data_source.go} (100%) rename azurerm/internal/services/compute/{data_source_shared_image_gallery.go => shared_image_gallery_data_source.go} (100%) rename azurerm/internal/services/compute/{resource_arm_shared_image_gallery.go => shared_image_gallery_resource.go} (100%) rename azurerm/internal/services/compute/{resource_arm_shared_image.go => shared_image_resource.go} (100%) rename azurerm/internal/services/compute/{data_source_shared_image_version.go => shared_image_version_data_source.go} (100%) rename azurerm/internal/services/compute/{resource_arm_shared_image_version.go => shared_image_version_resource.go} (100%) rename azurerm/internal/services/compute/{data_source_shared_image_versions.go => shared_image_versions_data_source.go} (100%) rename azurerm/internal/services/compute/{data_source_snapshot.go => snapshot_data_source.go} (100%) rename azurerm/internal/services/compute/{resource_arm_snapshot.go => snapshot_resource.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_availability_set_test.go => availability_set_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_availability_set_test.go => availability_set_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_dedicated_host_test.go => dedicated_host_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_dedicated_host_group_test.go => dedicated_host_group_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_dedicated_host_group_test.go => dedicated_host_group_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_dedicated_host_test.go => dedicated_host_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_disk_encryption_set_test.go => disk_encryption_set_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_disk_encryption_set_test.go => disk_encryption_set_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_image_test.go => image_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_image_test.go => image_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_linux_virtual_machine_scale_set_auth_test.go => linux_virtual_machine_scale_set_auth_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_linux_virtual_machine_scale_set_disk_data_test.go => linux_virtual_machine_scale_set_disk_data_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_linux_virtual_machine_scale_set_disk_os_test.go => linux_virtual_machine_scale_set_disk_os_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_linux_virtual_machine_scale_set_identity_test.go => linux_virtual_machine_scale_set_identity_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_linux_virtual_machine_scale_set_images_test.go => linux_virtual_machine_scale_set_images_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_linux_virtual_machine_scale_set_network_test.go => linux_virtual_machine_scale_set_network_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_linux_virtual_machine_scale_set_other_test.go => linux_virtual_machine_scale_set_other_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_linux_virtual_machine_scale_set_test.go => linux_virtual_machine_scale_set_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_linux_virtual_machine_scale_set_scaling_test.go => linux_virtual_machine_scale_set_scaling_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_managed_disk_test.go => managed_disk_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_managed_disk_test.go => managed_disk_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_marketplace_agreement_test.go => marketplace_agreement_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_platform_image_test.go => platform_image_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_proximity_placement_group_test.go => proximity_placement_group_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_proximity_placement_group_test.go => proximity_placement_group_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_shared_image_test.go => shared_image_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_shared_image_gallery_test.go => shared_image_gallery_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_shared_image_gallery_test.go => shared_image_gallery_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_shared_image_test.go => shared_image_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_shared_image_version_test.go => shared_image_version_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_shared_image_version_test.go => shared_image_version_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_shared_image_versions_test.go => shared_image_versions_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_snapshot_test.go => snapshot_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_snapshot_test.go => snapshot_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_virtual_machine_data_disk_attachment_test.go => virtual_machine_data_disk_attachment_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{data_source_virtual_machine_test.go => virtual_machine_data_source_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_virtual_machine_extension_test.go => virtual_machine_extension_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_virtual_machine_managed_disks_test.go => virtual_machine_managed_disks_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_virtual_machine_test.go => virtual_machine_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_virtual_machine_scale_set_extension_test.go => virtual_machine_scale_set_extension_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_virtual_machine_scale_set_test.go => virtual_machine_scale_set_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_virtual_machine_unmanaged_disks_test.go => virtual_machine_unmanaged_disks_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_windows_virtual_machine_scale_set_auth_test.go => windows_virtual_machine_scale_set_auth_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_windows_virtual_machine_scale_set_disk_data_test.go => windows_virtual_machine_scale_set_disk_data_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_windows_virtual_machine_scale_set_disk_os_test.go => windows_virtual_machine_scale_set_disk_os_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_windows_virtual_machine_scale_set_identity_test.go => windows_virtual_machine_scale_set_identity_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_windows_virtual_machine_scale_set_images_test.go => windows_virtual_machine_scale_set_images_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_windows_virtual_machine_scale_set_network_test.go => windows_virtual_machine_scale_set_network_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_windows_virtual_machine_scale_set_other_test.go => windows_virtual_machine_scale_set_other_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_windows_virtual_machine_scale_set_test.go => windows_virtual_machine_scale_set_resource_test.go} (100%) rename azurerm/internal/services/compute/tests/{resource_arm_windows_virtual_machine_scale_set_scaling_test.go => windows_virtual_machine_scale_set_scaling_resource_test.go} (100%) rename azurerm/internal/services/compute/{resource_arm_virtual_machine_data_disk_attachment.go => virtual_machine_data_disk_attachment_resource.go} (100%) rename azurerm/internal/services/compute/{data_source_virtual_machine.go => virtual_machine_data_source.go} (100%) rename azurerm/internal/services/compute/{resource_arm_virtual_machine_extension.go => virtual_machine_extension_resource.go} (100%) rename azurerm/internal/services/compute/{resource_arm_virtual_machine.go => virtual_machine_resource.go} (100%) rename azurerm/internal/services/compute/{resource_arm_virtual_machine_scale_set_extension.go => virtual_machine_scale_set_extension_resource.go} (100%) rename azurerm/internal/services/compute/{resource_arm_virtual_machine_scale_set_migration.go => virtual_machine_scale_set_migration_resource.go} (100%) rename azurerm/internal/services/compute/{resource_arm_virtual_machine_scale_set.go => virtual_machine_scale_set_resource.go} (100%) rename azurerm/internal/services/compute/{resource_arm_windows_virtual_machine_scale_set.go => windows_virtual_machine_scale_set_resource.go} (100%) diff --git a/azurerm/internal/services/compute/data_source_availability_set.go b/azurerm/internal/services/compute/availability_set_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_availability_set.go rename to azurerm/internal/services/compute/availability_set_data_source.go diff --git a/azurerm/internal/services/compute/resource_arm_availability_set.go b/azurerm/internal/services/compute/availability_set_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_availability_set.go rename to azurerm/internal/services/compute/availability_set_resource.go diff --git a/azurerm/internal/services/compute/data_source_dedicated_host.go b/azurerm/internal/services/compute/dedicated_host_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_dedicated_host.go rename to azurerm/internal/services/compute/dedicated_host_data_source.go diff --git a/azurerm/internal/services/compute/data_source_dedicated_host_group.go b/azurerm/internal/services/compute/dedicated_host_group_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_dedicated_host_group.go rename to azurerm/internal/services/compute/dedicated_host_group_data_source.go diff --git a/azurerm/internal/services/compute/resource_arm_dedicated_host_group.go b/azurerm/internal/services/compute/dedicated_host_group_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_dedicated_host_group.go rename to azurerm/internal/services/compute/dedicated_host_group_resource.go diff --git a/azurerm/internal/services/compute/resource_arm_dedicated_host.go b/azurerm/internal/services/compute/dedicated_host_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_dedicated_host.go rename to azurerm/internal/services/compute/dedicated_host_resource.go diff --git a/azurerm/internal/services/compute/data_source_disk_encryption_set.go b/azurerm/internal/services/compute/disk_encryption_set_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_disk_encryption_set.go rename to azurerm/internal/services/compute/disk_encryption_set_data_source.go diff --git a/azurerm/internal/services/compute/resource_arm_disk_encryption_set.go b/azurerm/internal/services/compute/disk_encryption_set_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_disk_encryption_set.go rename to azurerm/internal/services/compute/disk_encryption_set_resource.go diff --git a/azurerm/internal/services/compute/data_source_image.go b/azurerm/internal/services/compute/image_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_image.go rename to azurerm/internal/services/compute/image_data_source.go diff --git a/azurerm/internal/services/compute/resource_arm_image.go b/azurerm/internal/services/compute/image_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_image.go rename to azurerm/internal/services/compute/image_resource.go diff --git a/azurerm/internal/services/compute/resource_arm_linux_virtual_machine_scale_set.go b/azurerm/internal/services/compute/linux_virtual_machine_scale_set_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_linux_virtual_machine_scale_set.go rename to azurerm/internal/services/compute/linux_virtual_machine_scale_set_resource.go diff --git a/azurerm/internal/services/compute/data_source_managed_disk.go b/azurerm/internal/services/compute/managed_disk_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_managed_disk.go rename to azurerm/internal/services/compute/managed_disk_data_source.go diff --git a/azurerm/internal/services/compute/resource_arm_managed_disk.go b/azurerm/internal/services/compute/managed_disk_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_managed_disk.go rename to azurerm/internal/services/compute/managed_disk_resource.go diff --git a/azurerm/internal/services/compute/resource_arm_marketplace_agreement.go b/azurerm/internal/services/compute/marketplace_agreement_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_marketplace_agreement.go rename to azurerm/internal/services/compute/marketplace_agreement_resource.go diff --git a/azurerm/internal/services/compute/data_source_platform_image.go b/azurerm/internal/services/compute/platform_image_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_platform_image.go rename to azurerm/internal/services/compute/platform_image_data_source.go diff --git a/azurerm/internal/services/compute/data_source_proximity_placement_group.go b/azurerm/internal/services/compute/proximity_placement_group_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_proximity_placement_group.go rename to azurerm/internal/services/compute/proximity_placement_group_data_source.go diff --git a/azurerm/internal/services/compute/resource_arm_proximity_placement_group.go b/azurerm/internal/services/compute/proximity_placement_group_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_proximity_placement_group.go rename to azurerm/internal/services/compute/proximity_placement_group_resource.go diff --git a/azurerm/internal/services/compute/data_source_shared_image.go b/azurerm/internal/services/compute/shared_image_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_shared_image.go rename to azurerm/internal/services/compute/shared_image_data_source.go diff --git a/azurerm/internal/services/compute/data_source_shared_image_gallery.go b/azurerm/internal/services/compute/shared_image_gallery_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_shared_image_gallery.go rename to azurerm/internal/services/compute/shared_image_gallery_data_source.go diff --git a/azurerm/internal/services/compute/resource_arm_shared_image_gallery.go b/azurerm/internal/services/compute/shared_image_gallery_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_shared_image_gallery.go rename to azurerm/internal/services/compute/shared_image_gallery_resource.go diff --git a/azurerm/internal/services/compute/resource_arm_shared_image.go b/azurerm/internal/services/compute/shared_image_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_shared_image.go rename to azurerm/internal/services/compute/shared_image_resource.go diff --git a/azurerm/internal/services/compute/data_source_shared_image_version.go b/azurerm/internal/services/compute/shared_image_version_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_shared_image_version.go rename to azurerm/internal/services/compute/shared_image_version_data_source.go diff --git a/azurerm/internal/services/compute/resource_arm_shared_image_version.go b/azurerm/internal/services/compute/shared_image_version_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_shared_image_version.go rename to azurerm/internal/services/compute/shared_image_version_resource.go diff --git a/azurerm/internal/services/compute/data_source_shared_image_versions.go b/azurerm/internal/services/compute/shared_image_versions_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_shared_image_versions.go rename to azurerm/internal/services/compute/shared_image_versions_data_source.go diff --git a/azurerm/internal/services/compute/data_source_snapshot.go b/azurerm/internal/services/compute/snapshot_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_snapshot.go rename to azurerm/internal/services/compute/snapshot_data_source.go diff --git a/azurerm/internal/services/compute/resource_arm_snapshot.go b/azurerm/internal/services/compute/snapshot_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_snapshot.go rename to azurerm/internal/services/compute/snapshot_resource.go diff --git a/azurerm/internal/services/compute/tests/data_source_availability_set_test.go b/azurerm/internal/services/compute/tests/availability_set_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_availability_set_test.go rename to azurerm/internal/services/compute/tests/availability_set_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_availability_set_test.go b/azurerm/internal/services/compute/tests/availability_set_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_availability_set_test.go rename to azurerm/internal/services/compute/tests/availability_set_resource_test.go diff --git a/azurerm/internal/services/compute/tests/data_source_dedicated_host_test.go b/azurerm/internal/services/compute/tests/dedicated_host_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_dedicated_host_test.go rename to azurerm/internal/services/compute/tests/dedicated_host_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/data_source_dedicated_host_group_test.go b/azurerm/internal/services/compute/tests/dedicated_host_group_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_dedicated_host_group_test.go rename to azurerm/internal/services/compute/tests/dedicated_host_group_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_dedicated_host_group_test.go b/azurerm/internal/services/compute/tests/dedicated_host_group_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_dedicated_host_group_test.go rename to azurerm/internal/services/compute/tests/dedicated_host_group_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_dedicated_host_test.go b/azurerm/internal/services/compute/tests/dedicated_host_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_dedicated_host_test.go rename to azurerm/internal/services/compute/tests/dedicated_host_resource_test.go diff --git a/azurerm/internal/services/compute/tests/data_source_disk_encryption_set_test.go b/azurerm/internal/services/compute/tests/disk_encryption_set_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_disk_encryption_set_test.go rename to azurerm/internal/services/compute/tests/disk_encryption_set_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_disk_encryption_set_test.go b/azurerm/internal/services/compute/tests/disk_encryption_set_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_disk_encryption_set_test.go rename to azurerm/internal/services/compute/tests/disk_encryption_set_resource_test.go diff --git a/azurerm/internal/services/compute/tests/data_source_image_test.go b/azurerm/internal/services/compute/tests/image_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_image_test.go rename to azurerm/internal/services/compute/tests/image_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_image_test.go b/azurerm/internal/services/compute/tests/image_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_image_test.go rename to azurerm/internal/services/compute/tests/image_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_auth_test.go b/azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_auth_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_auth_test.go rename to azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_auth_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_disk_data_test.go b/azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_disk_data_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_disk_data_test.go rename to azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_disk_data_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_disk_os_test.go b/azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_disk_os_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_disk_os_test.go rename to azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_disk_os_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_identity_test.go b/azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_identity_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_identity_test.go rename to azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_identity_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_images_test.go b/azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_images_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_images_test.go rename to azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_images_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_network_test.go b/azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_network_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_network_test.go rename to azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_network_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_other_test.go b/azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_other_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_other_test.go rename to azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_other_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_test.go b/azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_test.go rename to azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_scaling_test.go b/azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_scaling_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_linux_virtual_machine_scale_set_scaling_test.go rename to azurerm/internal/services/compute/tests/linux_virtual_machine_scale_set_scaling_resource_test.go diff --git a/azurerm/internal/services/compute/tests/data_source_managed_disk_test.go b/azurerm/internal/services/compute/tests/managed_disk_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_managed_disk_test.go rename to azurerm/internal/services/compute/tests/managed_disk_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_managed_disk_test.go b/azurerm/internal/services/compute/tests/managed_disk_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_managed_disk_test.go rename to azurerm/internal/services/compute/tests/managed_disk_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_marketplace_agreement_test.go b/azurerm/internal/services/compute/tests/marketplace_agreement_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_marketplace_agreement_test.go rename to azurerm/internal/services/compute/tests/marketplace_agreement_resource_test.go diff --git a/azurerm/internal/services/compute/tests/data_source_platform_image_test.go b/azurerm/internal/services/compute/tests/platform_image_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_platform_image_test.go rename to azurerm/internal/services/compute/tests/platform_image_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/data_source_proximity_placement_group_test.go b/azurerm/internal/services/compute/tests/proximity_placement_group_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_proximity_placement_group_test.go rename to azurerm/internal/services/compute/tests/proximity_placement_group_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_proximity_placement_group_test.go b/azurerm/internal/services/compute/tests/proximity_placement_group_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_proximity_placement_group_test.go rename to azurerm/internal/services/compute/tests/proximity_placement_group_resource_test.go diff --git a/azurerm/internal/services/compute/tests/data_source_shared_image_test.go b/azurerm/internal/services/compute/tests/shared_image_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_shared_image_test.go rename to azurerm/internal/services/compute/tests/shared_image_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/data_source_shared_image_gallery_test.go b/azurerm/internal/services/compute/tests/shared_image_gallery_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_shared_image_gallery_test.go rename to azurerm/internal/services/compute/tests/shared_image_gallery_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_shared_image_gallery_test.go b/azurerm/internal/services/compute/tests/shared_image_gallery_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_shared_image_gallery_test.go rename to azurerm/internal/services/compute/tests/shared_image_gallery_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_shared_image_test.go b/azurerm/internal/services/compute/tests/shared_image_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_shared_image_test.go rename to azurerm/internal/services/compute/tests/shared_image_resource_test.go diff --git a/azurerm/internal/services/compute/tests/data_source_shared_image_version_test.go b/azurerm/internal/services/compute/tests/shared_image_version_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_shared_image_version_test.go rename to azurerm/internal/services/compute/tests/shared_image_version_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_shared_image_version_test.go b/azurerm/internal/services/compute/tests/shared_image_version_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_shared_image_version_test.go rename to azurerm/internal/services/compute/tests/shared_image_version_resource_test.go diff --git a/azurerm/internal/services/compute/tests/data_source_shared_image_versions_test.go b/azurerm/internal/services/compute/tests/shared_image_versions_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_shared_image_versions_test.go rename to azurerm/internal/services/compute/tests/shared_image_versions_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/data_source_snapshot_test.go b/azurerm/internal/services/compute/tests/snapshot_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_snapshot_test.go rename to azurerm/internal/services/compute/tests/snapshot_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_snapshot_test.go b/azurerm/internal/services/compute/tests/snapshot_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_snapshot_test.go rename to azurerm/internal/services/compute/tests/snapshot_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_virtual_machine_data_disk_attachment_test.go b/azurerm/internal/services/compute/tests/virtual_machine_data_disk_attachment_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_virtual_machine_data_disk_attachment_test.go rename to azurerm/internal/services/compute/tests/virtual_machine_data_disk_attachment_resource_test.go diff --git a/azurerm/internal/services/compute/tests/data_source_virtual_machine_test.go b/azurerm/internal/services/compute/tests/virtual_machine_data_source_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/data_source_virtual_machine_test.go rename to azurerm/internal/services/compute/tests/virtual_machine_data_source_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_virtual_machine_extension_test.go b/azurerm/internal/services/compute/tests/virtual_machine_extension_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_virtual_machine_extension_test.go rename to azurerm/internal/services/compute/tests/virtual_machine_extension_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_virtual_machine_managed_disks_test.go b/azurerm/internal/services/compute/tests/virtual_machine_managed_disks_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_virtual_machine_managed_disks_test.go rename to azurerm/internal/services/compute/tests/virtual_machine_managed_disks_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_virtual_machine_test.go b/azurerm/internal/services/compute/tests/virtual_machine_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_virtual_machine_test.go rename to azurerm/internal/services/compute/tests/virtual_machine_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_virtual_machine_scale_set_extension_test.go b/azurerm/internal/services/compute/tests/virtual_machine_scale_set_extension_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_virtual_machine_scale_set_extension_test.go rename to azurerm/internal/services/compute/tests/virtual_machine_scale_set_extension_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_virtual_machine_scale_set_test.go b/azurerm/internal/services/compute/tests/virtual_machine_scale_set_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_virtual_machine_scale_set_test.go rename to azurerm/internal/services/compute/tests/virtual_machine_scale_set_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_virtual_machine_unmanaged_disks_test.go b/azurerm/internal/services/compute/tests/virtual_machine_unmanaged_disks_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_virtual_machine_unmanaged_disks_test.go rename to azurerm/internal/services/compute/tests/virtual_machine_unmanaged_disks_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_auth_test.go b/azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_auth_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_auth_test.go rename to azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_auth_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_disk_data_test.go b/azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_disk_data_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_disk_data_test.go rename to azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_disk_data_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_disk_os_test.go b/azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_disk_os_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_disk_os_test.go rename to azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_disk_os_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_identity_test.go b/azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_identity_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_identity_test.go rename to azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_identity_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_images_test.go b/azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_images_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_images_test.go rename to azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_images_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_network_test.go b/azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_network_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_network_test.go rename to azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_network_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_other_test.go b/azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_other_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_other_test.go rename to azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_other_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_test.go b/azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_test.go rename to azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_resource_test.go diff --git a/azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_scaling_test.go b/azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_scaling_resource_test.go similarity index 100% rename from azurerm/internal/services/compute/tests/resource_arm_windows_virtual_machine_scale_set_scaling_test.go rename to azurerm/internal/services/compute/tests/windows_virtual_machine_scale_set_scaling_resource_test.go diff --git a/azurerm/internal/services/compute/resource_arm_virtual_machine_data_disk_attachment.go b/azurerm/internal/services/compute/virtual_machine_data_disk_attachment_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_virtual_machine_data_disk_attachment.go rename to azurerm/internal/services/compute/virtual_machine_data_disk_attachment_resource.go diff --git a/azurerm/internal/services/compute/data_source_virtual_machine.go b/azurerm/internal/services/compute/virtual_machine_data_source.go similarity index 100% rename from azurerm/internal/services/compute/data_source_virtual_machine.go rename to azurerm/internal/services/compute/virtual_machine_data_source.go diff --git a/azurerm/internal/services/compute/resource_arm_virtual_machine_extension.go b/azurerm/internal/services/compute/virtual_machine_extension_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_virtual_machine_extension.go rename to azurerm/internal/services/compute/virtual_machine_extension_resource.go diff --git a/azurerm/internal/services/compute/resource_arm_virtual_machine.go b/azurerm/internal/services/compute/virtual_machine_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_virtual_machine.go rename to azurerm/internal/services/compute/virtual_machine_resource.go diff --git a/azurerm/internal/services/compute/resource_arm_virtual_machine_scale_set_extension.go b/azurerm/internal/services/compute/virtual_machine_scale_set_extension_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_virtual_machine_scale_set_extension.go rename to azurerm/internal/services/compute/virtual_machine_scale_set_extension_resource.go diff --git a/azurerm/internal/services/compute/resource_arm_virtual_machine_scale_set_migration.go b/azurerm/internal/services/compute/virtual_machine_scale_set_migration_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_virtual_machine_scale_set_migration.go rename to azurerm/internal/services/compute/virtual_machine_scale_set_migration_resource.go diff --git a/azurerm/internal/services/compute/resource_arm_virtual_machine_scale_set.go b/azurerm/internal/services/compute/virtual_machine_scale_set_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_virtual_machine_scale_set.go rename to azurerm/internal/services/compute/virtual_machine_scale_set_resource.go diff --git a/azurerm/internal/services/compute/resource_arm_windows_virtual_machine_scale_set.go b/azurerm/internal/services/compute/windows_virtual_machine_scale_set_resource.go similarity index 100% rename from azurerm/internal/services/compute/resource_arm_windows_virtual_machine_scale_set.go rename to azurerm/internal/services/compute/windows_virtual_machine_scale_set_resource.go From 471f5bcd9e51a0034e890897a56ee80442dfead1 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:13:20 -0500 Subject: [PATCH 157/223] Updates `containers` --- ...esource_arm_container_group.go => container_group_resource.go} | 0 ...ce_container_registry.go => container_registry_data_source.go} | 0 ...registry_migrate.go => container_registry_migrate_resource.go} | 0 ...e_arm_container_registry.go => container_registry_resource.go} | 0 ...registry_webhook.go => container_registry_webhook_resource.go} | 0 ...ce_kubernetes_cluster.go => kubernetes_cluster_data_source.go} | 0 ...ster_node_pool.go => kubernetes_cluster_node_pool_resource.go} | 0 ...e_arm_kubernetes_cluster.go => kubernetes_cluster_resource.go} | 0 ...rvice_version.go => kubernetes_service_version_data_source.go} | 0 ...m_container_group_test.go => container_group_resource_test.go} | 0 ...er_registry_test.go => container_registry_data_source_test.go} | 0 ...igrate_test.go => container_registry_migrate_resource_test.go} | 0 ...ainer_registry_test.go => container_registry_resource_test.go} | 0 ...ebhook_test.go => container_registry_webhook_resource_test.go} | 0 ..._addons_test.go => kubernetes_cluster_addons_resource_test.go} | 0 ...ster_auth_test.go => kubernetes_cluster_auth_resource_test.go} | 0 ...tes_cluster_test.go => kubernetes_cluster_data_source_test.go} | 0 ...etwork_test.go => kubernetes_cluster_network_resource_test.go} | 0 ...pool_test.go => kubernetes_cluster_node_pool_resource_test.go} | 0 ...er_other_test.go => kubernetes_cluster_other_resource_test.go} | 0 ...rnetes_cluster_test.go => kubernetes_cluster_resource_test.go} | 0 ...caling_test.go => kubernetes_cluster_scaling_resource_test.go} | 0 ...ion_test.go => kubernetes_service_version_data_source_test.go} | 0 23 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/containers/{resource_arm_container_group.go => container_group_resource.go} (100%) rename azurerm/internal/services/containers/{data_source_container_registry.go => container_registry_data_source.go} (100%) rename azurerm/internal/services/containers/{resource_arm_container_registry_migrate.go => container_registry_migrate_resource.go} (100%) rename azurerm/internal/services/containers/{resource_arm_container_registry.go => container_registry_resource.go} (100%) rename azurerm/internal/services/containers/{resource_arm_container_registry_webhook.go => container_registry_webhook_resource.go} (100%) rename azurerm/internal/services/containers/{data_source_kubernetes_cluster.go => kubernetes_cluster_data_source.go} (100%) rename azurerm/internal/services/containers/{resource_arm_kubernetes_cluster_node_pool.go => kubernetes_cluster_node_pool_resource.go} (100%) rename azurerm/internal/services/containers/{resource_arm_kubernetes_cluster.go => kubernetes_cluster_resource.go} (100%) rename azurerm/internal/services/containers/{data_source_kubernetes_service_version.go => kubernetes_service_version_data_source.go} (100%) rename azurerm/internal/services/containers/tests/{resource_arm_container_group_test.go => container_group_resource_test.go} (100%) rename azurerm/internal/services/containers/tests/{data_source_container_registry_test.go => container_registry_data_source_test.go} (100%) rename azurerm/internal/services/containers/tests/{resource_arm_container_registry_migrate_test.go => container_registry_migrate_resource_test.go} (100%) rename azurerm/internal/services/containers/tests/{resource_arm_container_registry_test.go => container_registry_resource_test.go} (100%) rename azurerm/internal/services/containers/tests/{resource_arm_container_registry_webhook_test.go => container_registry_webhook_resource_test.go} (100%) rename azurerm/internal/services/containers/tests/{resource_arm_kubernetes_cluster_addons_test.go => kubernetes_cluster_addons_resource_test.go} (100%) rename azurerm/internal/services/containers/tests/{resource_arm_kubernetes_cluster_auth_test.go => kubernetes_cluster_auth_resource_test.go} (100%) rename azurerm/internal/services/containers/tests/{data_source_kubernetes_cluster_test.go => kubernetes_cluster_data_source_test.go} (100%) rename azurerm/internal/services/containers/tests/{resource_arm_kubernetes_cluster_network_test.go => kubernetes_cluster_network_resource_test.go} (100%) rename azurerm/internal/services/containers/tests/{resource_arm_kubernetes_cluster_node_pool_test.go => kubernetes_cluster_node_pool_resource_test.go} (100%) rename azurerm/internal/services/containers/tests/{resource_arm_kubernetes_cluster_other_test.go => kubernetes_cluster_other_resource_test.go} (100%) rename azurerm/internal/services/containers/tests/{resource_arm_kubernetes_cluster_test.go => kubernetes_cluster_resource_test.go} (100%) rename azurerm/internal/services/containers/tests/{resource_arm_kubernetes_cluster_scaling_test.go => kubernetes_cluster_scaling_resource_test.go} (100%) rename azurerm/internal/services/containers/tests/{data_source_kubernetes_service_version_test.go => kubernetes_service_version_data_source_test.go} (100%) diff --git a/azurerm/internal/services/containers/resource_arm_container_group.go b/azurerm/internal/services/containers/container_group_resource.go similarity index 100% rename from azurerm/internal/services/containers/resource_arm_container_group.go rename to azurerm/internal/services/containers/container_group_resource.go diff --git a/azurerm/internal/services/containers/data_source_container_registry.go b/azurerm/internal/services/containers/container_registry_data_source.go similarity index 100% rename from azurerm/internal/services/containers/data_source_container_registry.go rename to azurerm/internal/services/containers/container_registry_data_source.go diff --git a/azurerm/internal/services/containers/resource_arm_container_registry_migrate.go b/azurerm/internal/services/containers/container_registry_migrate_resource.go similarity index 100% rename from azurerm/internal/services/containers/resource_arm_container_registry_migrate.go rename to azurerm/internal/services/containers/container_registry_migrate_resource.go diff --git a/azurerm/internal/services/containers/resource_arm_container_registry.go b/azurerm/internal/services/containers/container_registry_resource.go similarity index 100% rename from azurerm/internal/services/containers/resource_arm_container_registry.go rename to azurerm/internal/services/containers/container_registry_resource.go diff --git a/azurerm/internal/services/containers/resource_arm_container_registry_webhook.go b/azurerm/internal/services/containers/container_registry_webhook_resource.go similarity index 100% rename from azurerm/internal/services/containers/resource_arm_container_registry_webhook.go rename to azurerm/internal/services/containers/container_registry_webhook_resource.go diff --git a/azurerm/internal/services/containers/data_source_kubernetes_cluster.go b/azurerm/internal/services/containers/kubernetes_cluster_data_source.go similarity index 100% rename from azurerm/internal/services/containers/data_source_kubernetes_cluster.go rename to azurerm/internal/services/containers/kubernetes_cluster_data_source.go diff --git a/azurerm/internal/services/containers/resource_arm_kubernetes_cluster_node_pool.go b/azurerm/internal/services/containers/kubernetes_cluster_node_pool_resource.go similarity index 100% rename from azurerm/internal/services/containers/resource_arm_kubernetes_cluster_node_pool.go rename to azurerm/internal/services/containers/kubernetes_cluster_node_pool_resource.go diff --git a/azurerm/internal/services/containers/resource_arm_kubernetes_cluster.go b/azurerm/internal/services/containers/kubernetes_cluster_resource.go similarity index 100% rename from azurerm/internal/services/containers/resource_arm_kubernetes_cluster.go rename to azurerm/internal/services/containers/kubernetes_cluster_resource.go diff --git a/azurerm/internal/services/containers/data_source_kubernetes_service_version.go b/azurerm/internal/services/containers/kubernetes_service_version_data_source.go similarity index 100% rename from azurerm/internal/services/containers/data_source_kubernetes_service_version.go rename to azurerm/internal/services/containers/kubernetes_service_version_data_source.go diff --git a/azurerm/internal/services/containers/tests/resource_arm_container_group_test.go b/azurerm/internal/services/containers/tests/container_group_resource_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/resource_arm_container_group_test.go rename to azurerm/internal/services/containers/tests/container_group_resource_test.go diff --git a/azurerm/internal/services/containers/tests/data_source_container_registry_test.go b/azurerm/internal/services/containers/tests/container_registry_data_source_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/data_source_container_registry_test.go rename to azurerm/internal/services/containers/tests/container_registry_data_source_test.go diff --git a/azurerm/internal/services/containers/tests/resource_arm_container_registry_migrate_test.go b/azurerm/internal/services/containers/tests/container_registry_migrate_resource_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/resource_arm_container_registry_migrate_test.go rename to azurerm/internal/services/containers/tests/container_registry_migrate_resource_test.go diff --git a/azurerm/internal/services/containers/tests/resource_arm_container_registry_test.go b/azurerm/internal/services/containers/tests/container_registry_resource_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/resource_arm_container_registry_test.go rename to azurerm/internal/services/containers/tests/container_registry_resource_test.go diff --git a/azurerm/internal/services/containers/tests/resource_arm_container_registry_webhook_test.go b/azurerm/internal/services/containers/tests/container_registry_webhook_resource_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/resource_arm_container_registry_webhook_test.go rename to azurerm/internal/services/containers/tests/container_registry_webhook_resource_test.go diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_addons_test.go b/azurerm/internal/services/containers/tests/kubernetes_cluster_addons_resource_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_addons_test.go rename to azurerm/internal/services/containers/tests/kubernetes_cluster_addons_resource_test.go diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_auth_test.go b/azurerm/internal/services/containers/tests/kubernetes_cluster_auth_resource_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_auth_test.go rename to azurerm/internal/services/containers/tests/kubernetes_cluster_auth_resource_test.go diff --git a/azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go b/azurerm/internal/services/containers/tests/kubernetes_cluster_data_source_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/data_source_kubernetes_cluster_test.go rename to azurerm/internal/services/containers/tests/kubernetes_cluster_data_source_test.go diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_network_test.go b/azurerm/internal/services/containers/tests/kubernetes_cluster_network_resource_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_network_test.go rename to azurerm/internal/services/containers/tests/kubernetes_cluster_network_resource_test.go diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_node_pool_test.go b/azurerm/internal/services/containers/tests/kubernetes_cluster_node_pool_resource_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_node_pool_test.go rename to azurerm/internal/services/containers/tests/kubernetes_cluster_node_pool_resource_test.go diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_other_test.go b/azurerm/internal/services/containers/tests/kubernetes_cluster_other_resource_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_other_test.go rename to azurerm/internal/services/containers/tests/kubernetes_cluster_other_resource_test.go diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_test.go b/azurerm/internal/services/containers/tests/kubernetes_cluster_resource_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_test.go rename to azurerm/internal/services/containers/tests/kubernetes_cluster_resource_test.go diff --git a/azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_scaling_test.go b/azurerm/internal/services/containers/tests/kubernetes_cluster_scaling_resource_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/resource_arm_kubernetes_cluster_scaling_test.go rename to azurerm/internal/services/containers/tests/kubernetes_cluster_scaling_resource_test.go diff --git a/azurerm/internal/services/containers/tests/data_source_kubernetes_service_version_test.go b/azurerm/internal/services/containers/tests/kubernetes_service_version_data_source_test.go similarity index 100% rename from azurerm/internal/services/containers/tests/data_source_kubernetes_service_version_test.go rename to azurerm/internal/services/containers/tests/kubernetes_service_version_data_source_test.go From 6958f21de8f32d0e3294dedfd4408e05c7738792 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:13:32 -0500 Subject: [PATCH 158/223] Updates `cosmos` --- ...urce_cosmos_db_account.go => cosmos_db_account_data_source.go} | 0 ...ource_arm_cosmosdb_account.go => cosmosdb_account_resource.go} | 0 ...sandra_keyspace.go => cosmosdb_cassandra_keyspace_resource.go} | 0 ..._gremlin_database.go => cosmosdb_gremlin_database_resource.go} | 0 ...smosdb_gremlin_graph.go => cosmosdb_gremlin_graph_resource.go} | 0 ..._mongo_collection.go => cosmosdb_mongo_collection_resource.go} | 0 ...osdb_mongo_database.go => cosmosdb_mongo_database_resource.go} | 0 ...smosdb_sql_container.go => cosmosdb_sql_container_resource.go} | 0 ...cosmosdb_sql_database.go => cosmosdb_sql_database_resource.go} | 0 ...{resource_arm_cosmosdb_table.go => cosmosdb_table_resource.go} | 0 ...s_db_account_test.go => cosmos_db_account_data_source_test.go} | 0 ...ailover_test.go => cosmosdb_account_failover_resource_test.go} | 0 ...cosmosdb_account_test.go => cosmosdb_account_resource_test.go} | 0 ...space_test.go => cosmosdb_cassandra_keyspace_resource_test.go} | 0 ...atabase_test.go => cosmosdb_gremlin_database_resource_test.go} | 0 ...mlin_graph_test.go => cosmosdb_gremlin_graph_resource_test.go} | 0 ...lection_test.go => cosmosdb_mongo_collection_resource_test.go} | 0 ..._database_test.go => cosmosdb_mongo_database_resource_test.go} | 0 ..._container_test.go => cosmosdb_sql_container_resource_test.go} | 0 ...ql_database_test.go => cosmosdb_sql_database_resource_test.go} | 0 ...arm_cosmosdb_table_test.go => cosmosdb_table_resource_test.go} | 0 21 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/cosmos/{data_source_cosmos_db_account.go => cosmos_db_account_data_source.go} (100%) rename azurerm/internal/services/cosmos/{resource_arm_cosmosdb_account.go => cosmosdb_account_resource.go} (100%) rename azurerm/internal/services/cosmos/{resource_arm_cosmosdb_cassandra_keyspace.go => cosmosdb_cassandra_keyspace_resource.go} (100%) rename azurerm/internal/services/cosmos/{resource_arm_cosmosdb_gremlin_database.go => cosmosdb_gremlin_database_resource.go} (100%) rename azurerm/internal/services/cosmos/{resource_arm_cosmosdb_gremlin_graph.go => cosmosdb_gremlin_graph_resource.go} (100%) rename azurerm/internal/services/cosmos/{resource_arm_cosmosdb_mongo_collection.go => cosmosdb_mongo_collection_resource.go} (100%) rename azurerm/internal/services/cosmos/{resource_arm_cosmosdb_mongo_database.go => cosmosdb_mongo_database_resource.go} (100%) rename azurerm/internal/services/cosmos/{resource_arm_cosmosdb_sql_container.go => cosmosdb_sql_container_resource.go} (100%) rename azurerm/internal/services/cosmos/{resource_arm_cosmosdb_sql_database.go => cosmosdb_sql_database_resource.go} (100%) rename azurerm/internal/services/cosmos/{resource_arm_cosmosdb_table.go => cosmosdb_table_resource.go} (100%) rename azurerm/internal/services/cosmos/tests/{data_source_cosmos_db_account_test.go => cosmos_db_account_data_source_test.go} (100%) rename azurerm/internal/services/cosmos/tests/{resource_arm_cosmosdb_account_failover_test.go => cosmosdb_account_failover_resource_test.go} (100%) rename azurerm/internal/services/cosmos/tests/{resource_arm_cosmosdb_account_test.go => cosmosdb_account_resource_test.go} (100%) rename azurerm/internal/services/cosmos/tests/{resource_arm_cosmosdb_cassandra_keyspace_test.go => cosmosdb_cassandra_keyspace_resource_test.go} (100%) rename azurerm/internal/services/cosmos/tests/{resource_arm_cosmosdb_gremlin_database_test.go => cosmosdb_gremlin_database_resource_test.go} (100%) rename azurerm/internal/services/cosmos/tests/{resource_arm_cosmosdb_gremlin_graph_test.go => cosmosdb_gremlin_graph_resource_test.go} (100%) rename azurerm/internal/services/cosmos/tests/{resource_arm_cosmosdb_mongo_collection_test.go => cosmosdb_mongo_collection_resource_test.go} (100%) rename azurerm/internal/services/cosmos/tests/{resource_arm_cosmosdb_mongo_database_test.go => cosmosdb_mongo_database_resource_test.go} (100%) rename azurerm/internal/services/cosmos/tests/{resource_arm_cosmosdb_sql_container_test.go => cosmosdb_sql_container_resource_test.go} (100%) rename azurerm/internal/services/cosmos/tests/{resource_arm_cosmosdb_sql_database_test.go => cosmosdb_sql_database_resource_test.go} (100%) rename azurerm/internal/services/cosmos/tests/{resource_arm_cosmosdb_table_test.go => cosmosdb_table_resource_test.go} (100%) diff --git a/azurerm/internal/services/cosmos/data_source_cosmos_db_account.go b/azurerm/internal/services/cosmos/cosmos_db_account_data_source.go similarity index 100% rename from azurerm/internal/services/cosmos/data_source_cosmos_db_account.go rename to azurerm/internal/services/cosmos/cosmos_db_account_data_source.go diff --git a/azurerm/internal/services/cosmos/resource_arm_cosmosdb_account.go b/azurerm/internal/services/cosmos/cosmosdb_account_resource.go similarity index 100% rename from azurerm/internal/services/cosmos/resource_arm_cosmosdb_account.go rename to azurerm/internal/services/cosmos/cosmosdb_account_resource.go diff --git a/azurerm/internal/services/cosmos/resource_arm_cosmosdb_cassandra_keyspace.go b/azurerm/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource.go similarity index 100% rename from azurerm/internal/services/cosmos/resource_arm_cosmosdb_cassandra_keyspace.go rename to azurerm/internal/services/cosmos/cosmosdb_cassandra_keyspace_resource.go diff --git a/azurerm/internal/services/cosmos/resource_arm_cosmosdb_gremlin_database.go b/azurerm/internal/services/cosmos/cosmosdb_gremlin_database_resource.go similarity index 100% rename from azurerm/internal/services/cosmos/resource_arm_cosmosdb_gremlin_database.go rename to azurerm/internal/services/cosmos/cosmosdb_gremlin_database_resource.go diff --git a/azurerm/internal/services/cosmos/resource_arm_cosmosdb_gremlin_graph.go b/azurerm/internal/services/cosmos/cosmosdb_gremlin_graph_resource.go similarity index 100% rename from azurerm/internal/services/cosmos/resource_arm_cosmosdb_gremlin_graph.go rename to azurerm/internal/services/cosmos/cosmosdb_gremlin_graph_resource.go diff --git a/azurerm/internal/services/cosmos/resource_arm_cosmosdb_mongo_collection.go b/azurerm/internal/services/cosmos/cosmosdb_mongo_collection_resource.go similarity index 100% rename from azurerm/internal/services/cosmos/resource_arm_cosmosdb_mongo_collection.go rename to azurerm/internal/services/cosmos/cosmosdb_mongo_collection_resource.go diff --git a/azurerm/internal/services/cosmos/resource_arm_cosmosdb_mongo_database.go b/azurerm/internal/services/cosmos/cosmosdb_mongo_database_resource.go similarity index 100% rename from azurerm/internal/services/cosmos/resource_arm_cosmosdb_mongo_database.go rename to azurerm/internal/services/cosmos/cosmosdb_mongo_database_resource.go diff --git a/azurerm/internal/services/cosmos/resource_arm_cosmosdb_sql_container.go b/azurerm/internal/services/cosmos/cosmosdb_sql_container_resource.go similarity index 100% rename from azurerm/internal/services/cosmos/resource_arm_cosmosdb_sql_container.go rename to azurerm/internal/services/cosmos/cosmosdb_sql_container_resource.go diff --git a/azurerm/internal/services/cosmos/resource_arm_cosmosdb_sql_database.go b/azurerm/internal/services/cosmos/cosmosdb_sql_database_resource.go similarity index 100% rename from azurerm/internal/services/cosmos/resource_arm_cosmosdb_sql_database.go rename to azurerm/internal/services/cosmos/cosmosdb_sql_database_resource.go diff --git a/azurerm/internal/services/cosmos/resource_arm_cosmosdb_table.go b/azurerm/internal/services/cosmos/cosmosdb_table_resource.go similarity index 100% rename from azurerm/internal/services/cosmos/resource_arm_cosmosdb_table.go rename to azurerm/internal/services/cosmos/cosmosdb_table_resource.go diff --git a/azurerm/internal/services/cosmos/tests/data_source_cosmos_db_account_test.go b/azurerm/internal/services/cosmos/tests/cosmos_db_account_data_source_test.go similarity index 100% rename from azurerm/internal/services/cosmos/tests/data_source_cosmos_db_account_test.go rename to azurerm/internal/services/cosmos/tests/cosmos_db_account_data_source_test.go diff --git a/azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_account_failover_test.go b/azurerm/internal/services/cosmos/tests/cosmosdb_account_failover_resource_test.go similarity index 100% rename from azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_account_failover_test.go rename to azurerm/internal/services/cosmos/tests/cosmosdb_account_failover_resource_test.go diff --git a/azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_account_test.go b/azurerm/internal/services/cosmos/tests/cosmosdb_account_resource_test.go similarity index 100% rename from azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_account_test.go rename to azurerm/internal/services/cosmos/tests/cosmosdb_account_resource_test.go diff --git a/azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_cassandra_keyspace_test.go b/azurerm/internal/services/cosmos/tests/cosmosdb_cassandra_keyspace_resource_test.go similarity index 100% rename from azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_cassandra_keyspace_test.go rename to azurerm/internal/services/cosmos/tests/cosmosdb_cassandra_keyspace_resource_test.go diff --git a/azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_gremlin_database_test.go b/azurerm/internal/services/cosmos/tests/cosmosdb_gremlin_database_resource_test.go similarity index 100% rename from azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_gremlin_database_test.go rename to azurerm/internal/services/cosmos/tests/cosmosdb_gremlin_database_resource_test.go diff --git a/azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_gremlin_graph_test.go b/azurerm/internal/services/cosmos/tests/cosmosdb_gremlin_graph_resource_test.go similarity index 100% rename from azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_gremlin_graph_test.go rename to azurerm/internal/services/cosmos/tests/cosmosdb_gremlin_graph_resource_test.go diff --git a/azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_mongo_collection_test.go b/azurerm/internal/services/cosmos/tests/cosmosdb_mongo_collection_resource_test.go similarity index 100% rename from azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_mongo_collection_test.go rename to azurerm/internal/services/cosmos/tests/cosmosdb_mongo_collection_resource_test.go diff --git a/azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_mongo_database_test.go b/azurerm/internal/services/cosmos/tests/cosmosdb_mongo_database_resource_test.go similarity index 100% rename from azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_mongo_database_test.go rename to azurerm/internal/services/cosmos/tests/cosmosdb_mongo_database_resource_test.go diff --git a/azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_sql_container_test.go b/azurerm/internal/services/cosmos/tests/cosmosdb_sql_container_resource_test.go similarity index 100% rename from azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_sql_container_test.go rename to azurerm/internal/services/cosmos/tests/cosmosdb_sql_container_resource_test.go diff --git a/azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_sql_database_test.go b/azurerm/internal/services/cosmos/tests/cosmosdb_sql_database_resource_test.go similarity index 100% rename from azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_sql_database_test.go rename to azurerm/internal/services/cosmos/tests/cosmosdb_sql_database_resource_test.go diff --git a/azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_table_test.go b/azurerm/internal/services/cosmos/tests/cosmosdb_table_resource_test.go similarity index 100% rename from azurerm/internal/services/cosmos/tests/resource_arm_cosmosdb_table_test.go rename to azurerm/internal/services/cosmos/tests/cosmosdb_table_resource_test.go From b08468effe4f1dc4d546030bcd85fdf22b3e5b21 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:13:44 -0500 Subject: [PATCH 159/223] Updates `costmanagement` --- ...group.go => cost_management_export_resource_group_resource.go} | 0 ....go => cost_management_export_resource_group_resource_test.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/costmanagement/{resource_arm_cost_management_export_resource_group.go => cost_management_export_resource_group_resource.go} (100%) rename azurerm/internal/services/costmanagement/tests/{resource_arm_cost_management_export_resource_group_test.go => cost_management_export_resource_group_resource_test.go} (100%) diff --git a/azurerm/internal/services/costmanagement/resource_arm_cost_management_export_resource_group.go b/azurerm/internal/services/costmanagement/cost_management_export_resource_group_resource.go similarity index 100% rename from azurerm/internal/services/costmanagement/resource_arm_cost_management_export_resource_group.go rename to azurerm/internal/services/costmanagement/cost_management_export_resource_group_resource.go diff --git a/azurerm/internal/services/costmanagement/tests/resource_arm_cost_management_export_resource_group_test.go b/azurerm/internal/services/costmanagement/tests/cost_management_export_resource_group_resource_test.go similarity index 100% rename from azurerm/internal/services/costmanagement/tests/resource_arm_cost_management_export_resource_group_test.go rename to azurerm/internal/services/costmanagement/tests/cost_management_export_resource_group_resource_test.go From 89e295d9d91de20000716752c0d309a6ed1f797d Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:13:56 -0500 Subject: [PATCH 160/223] Updates `customproviders` --- ...esource_arm_custom_provider.go => custom_provider_resource.go} | 0 ...m_custom_provider_test.go => custom_provider_resource_test.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/customproviders/{resource_arm_custom_provider.go => custom_provider_resource.go} (100%) rename azurerm/internal/services/customproviders/tests/{resource_arm_custom_provider_test.go => custom_provider_resource_test.go} (100%) diff --git a/azurerm/internal/services/customproviders/resource_arm_custom_provider.go b/azurerm/internal/services/customproviders/custom_provider_resource.go similarity index 100% rename from azurerm/internal/services/customproviders/resource_arm_custom_provider.go rename to azurerm/internal/services/customproviders/custom_provider_resource.go diff --git a/azurerm/internal/services/customproviders/tests/resource_arm_custom_provider_test.go b/azurerm/internal/services/customproviders/tests/custom_provider_resource_test.go similarity index 100% rename from azurerm/internal/services/customproviders/tests/resource_arm_custom_provider_test.go rename to azurerm/internal/services/customproviders/tests/custom_provider_resource_test.go From 901f22f335656a5fc0add515b9a29d3abb73cdf0 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:14:06 -0500 Subject: [PATCH 161/223] Updates `databasemigration` --- ...ation_project.go => database_migration_project_data_source.go} | 0 ...igration_project.go => database_migration_project_resource.go} | 0 ...ation_service.go => database_migration_service_data_source.go} | 0 ...igration_service.go => database_migration_service_resource.go} | 0 ...ect_test.go => database_migration_project_data_source_test.go} | 0 ...roject_test.go => database_migration_project_resource_test.go} | 0 ...ice_test.go => database_migration_service_data_source_test.go} | 0 ...ervice_test.go => database_migration_service_resource_test.go} | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/databasemigration/{data_source_database_migration_project.go => database_migration_project_data_source.go} (100%) rename azurerm/internal/services/databasemigration/{resource_arm_database_migration_project.go => database_migration_project_resource.go} (100%) rename azurerm/internal/services/databasemigration/{data_source_database_migration_service.go => database_migration_service_data_source.go} (100%) rename azurerm/internal/services/databasemigration/{resource_arm_database_migration_service.go => database_migration_service_resource.go} (100%) rename azurerm/internal/services/databasemigration/tests/{data_source_database_migration_project_test.go => database_migration_project_data_source_test.go} (100%) rename azurerm/internal/services/databasemigration/tests/{resource_arm_database_migration_project_test.go => database_migration_project_resource_test.go} (100%) rename azurerm/internal/services/databasemigration/tests/{data_source_database_migration_service_test.go => database_migration_service_data_source_test.go} (100%) rename azurerm/internal/services/databasemigration/tests/{resource_arm_database_migration_service_test.go => database_migration_service_resource_test.go} (100%) diff --git a/azurerm/internal/services/databasemigration/data_source_database_migration_project.go b/azurerm/internal/services/databasemigration/database_migration_project_data_source.go similarity index 100% rename from azurerm/internal/services/databasemigration/data_source_database_migration_project.go rename to azurerm/internal/services/databasemigration/database_migration_project_data_source.go diff --git a/azurerm/internal/services/databasemigration/resource_arm_database_migration_project.go b/azurerm/internal/services/databasemigration/database_migration_project_resource.go similarity index 100% rename from azurerm/internal/services/databasemigration/resource_arm_database_migration_project.go rename to azurerm/internal/services/databasemigration/database_migration_project_resource.go diff --git a/azurerm/internal/services/databasemigration/data_source_database_migration_service.go b/azurerm/internal/services/databasemigration/database_migration_service_data_source.go similarity index 100% rename from azurerm/internal/services/databasemigration/data_source_database_migration_service.go rename to azurerm/internal/services/databasemigration/database_migration_service_data_source.go diff --git a/azurerm/internal/services/databasemigration/resource_arm_database_migration_service.go b/azurerm/internal/services/databasemigration/database_migration_service_resource.go similarity index 100% rename from azurerm/internal/services/databasemigration/resource_arm_database_migration_service.go rename to azurerm/internal/services/databasemigration/database_migration_service_resource.go diff --git a/azurerm/internal/services/databasemigration/tests/data_source_database_migration_project_test.go b/azurerm/internal/services/databasemigration/tests/database_migration_project_data_source_test.go similarity index 100% rename from azurerm/internal/services/databasemigration/tests/data_source_database_migration_project_test.go rename to azurerm/internal/services/databasemigration/tests/database_migration_project_data_source_test.go diff --git a/azurerm/internal/services/databasemigration/tests/resource_arm_database_migration_project_test.go b/azurerm/internal/services/databasemigration/tests/database_migration_project_resource_test.go similarity index 100% rename from azurerm/internal/services/databasemigration/tests/resource_arm_database_migration_project_test.go rename to azurerm/internal/services/databasemigration/tests/database_migration_project_resource_test.go diff --git a/azurerm/internal/services/databasemigration/tests/data_source_database_migration_service_test.go b/azurerm/internal/services/databasemigration/tests/database_migration_service_data_source_test.go similarity index 100% rename from azurerm/internal/services/databasemigration/tests/data_source_database_migration_service_test.go rename to azurerm/internal/services/databasemigration/tests/database_migration_service_data_source_test.go diff --git a/azurerm/internal/services/databasemigration/tests/resource_arm_database_migration_service_test.go b/azurerm/internal/services/databasemigration/tests/database_migration_service_resource_test.go similarity index 100% rename from azurerm/internal/services/databasemigration/tests/resource_arm_database_migration_service_test.go rename to azurerm/internal/services/databasemigration/tests/database_migration_service_resource_test.go From 17abdd3426941dad547fbce6ac506a15a99b1387 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:14:15 -0500 Subject: [PATCH 162/223] Updates `databricks` --- ...m_databricks_workspace.go => databricks_workspace_resource.go} | 0 ...ks_workspace_test.go => databricks_workspace_resource_test.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/databricks/{resource_arm_databricks_workspace.go => databricks_workspace_resource.go} (100%) rename azurerm/internal/services/databricks/tests/{resource_arm_databricks_workspace_test.go => databricks_workspace_resource_test.go} (100%) diff --git a/azurerm/internal/services/databricks/resource_arm_databricks_workspace.go b/azurerm/internal/services/databricks/databricks_workspace_resource.go similarity index 100% rename from azurerm/internal/services/databricks/resource_arm_databricks_workspace.go rename to azurerm/internal/services/databricks/databricks_workspace_resource.go diff --git a/azurerm/internal/services/databricks/tests/resource_arm_databricks_workspace_test.go b/azurerm/internal/services/databricks/tests/databricks_workspace_resource_test.go similarity index 100% rename from azurerm/internal/services/databricks/tests/resource_arm_databricks_workspace_test.go rename to azurerm/internal/services/databricks/tests/databricks_workspace_resource_test.go From 50def81289bb5a83c8105683f35f5007e1c16120 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:14:27 -0500 Subject: [PATCH 163/223] updates `datafactory` --- .../{data_source_data_factory.go => data_factory_data_source.go} | 0 ...ry_dataset_mysql.go => data_factory_dataset_mysql_resource.go} | 0 ..._postgresql.go => data_factory_dataset_postgresql_resource.go} | 0 ...table.go => data_factory_dataset_sql_server_table_resource.go} | 0 ...ed.go => data_factory_integration_runtime_managed_resource.go} | 0 ...ata_factory_linked_service_data_lake_storage_gen2_resource.go} | 0 ...ice_mysql.go => data_factory_linked_service_mysql_resource.go} | 0 ...esql.go => data_factory_linked_service_postgresql_resource.go} | 0 ...rver.go => data_factory_linked_service_sql_server_resource.go} | 0 ...data_factory_pipeline.go => data_factory_pipeline_resource.go} | 0 .../{resource_arm_data_factory.go => data_factory_resource.go} | 0 ...gger_schedule.go => data_factory_trigger_schedule_resource.go} | 0 ...urce_data_factory_test.go => data_factory_data_source_test.go} | 0 ..._mysql_test.go => data_factory_dataset_mysql_resource_test.go} | 0 ...l_test.go => data_factory_dataset_postgresql_resource_test.go} | 0 ....go => data_factory_dataset_sql_server_table_resource_test.go} | 0 ... => data_factory_integration_runtime_managed_resource_test.go} | 0 ...actory_linked_service_data_lake_storage_gen2_resource_test.go} | 0 ...test.go => data_factory_linked_service_mysql_resource_test.go} | 0 ...go => data_factory_linked_service_postgresql_resource_test.go} | 0 ...go => data_factory_linked_service_sql_server_resource_test.go} | 0 ...ry_pipeline_test.go => data_factory_pipeline_resource_test.go} | 0 ...rce_arm_data_factory_test.go => data_factory_resource_test.go} | 0 ...ule_test.go => data_factory_trigger_schedule_resource_test.go} | 0 24 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/datafactory/{data_source_data_factory.go => data_factory_data_source.go} (100%) rename azurerm/internal/services/datafactory/{resource_arm_data_factory_dataset_mysql.go => data_factory_dataset_mysql_resource.go} (100%) rename azurerm/internal/services/datafactory/{resource_arm_data_factory_dataset_postgresql.go => data_factory_dataset_postgresql_resource.go} (100%) rename azurerm/internal/services/datafactory/{resource_arm_data_factory_dataset_sql_server_table.go => data_factory_dataset_sql_server_table_resource.go} (100%) rename azurerm/internal/services/datafactory/{resource_arm_data_factory_integration_runtime_managed.go => data_factory_integration_runtime_managed_resource.go} (100%) rename azurerm/internal/services/datafactory/{resource_arm_data_factory_linked_service_data_lake_storage_gen2.go => data_factory_linked_service_data_lake_storage_gen2_resource.go} (100%) rename azurerm/internal/services/datafactory/{resource_arm_data_factory_linked_service_mysql.go => data_factory_linked_service_mysql_resource.go} (100%) rename azurerm/internal/services/datafactory/{resource_arm_data_factory_linked_service_postgresql.go => data_factory_linked_service_postgresql_resource.go} (100%) rename azurerm/internal/services/datafactory/{resource_arm_data_factory_linked_service_sql_server.go => data_factory_linked_service_sql_server_resource.go} (100%) rename azurerm/internal/services/datafactory/{resource_arm_data_factory_pipeline.go => data_factory_pipeline_resource.go} (100%) rename azurerm/internal/services/datafactory/{resource_arm_data_factory.go => data_factory_resource.go} (100%) rename azurerm/internal/services/datafactory/{resource_arm_data_factory_trigger_schedule.go => data_factory_trigger_schedule_resource.go} (100%) rename azurerm/internal/services/datafactory/tests/{data_source_data_factory_test.go => data_factory_data_source_test.go} (100%) rename azurerm/internal/services/datafactory/tests/{resource_arm_data_factory_dataset_mysql_test.go => data_factory_dataset_mysql_resource_test.go} (100%) rename azurerm/internal/services/datafactory/tests/{resource_arm_data_factory_dataset_postgresql_test.go => data_factory_dataset_postgresql_resource_test.go} (100%) rename azurerm/internal/services/datafactory/tests/{resource_arm_data_factory_dataset_sql_server_table_test.go => data_factory_dataset_sql_server_table_resource_test.go} (100%) rename azurerm/internal/services/datafactory/tests/{resource_arm_data_factory_integration_runtime_managed_test.go => data_factory_integration_runtime_managed_resource_test.go} (100%) rename azurerm/internal/services/datafactory/tests/{resource_arm_data_factory_linked_service_data_lake_storage_gen2_test.go => data_factory_linked_service_data_lake_storage_gen2_resource_test.go} (100%) rename azurerm/internal/services/datafactory/tests/{resource_arm_data_factory_linked_service_mysql_test.go => data_factory_linked_service_mysql_resource_test.go} (100%) rename azurerm/internal/services/datafactory/tests/{resource_arm_data_factory_linked_service_postgresql_test.go => data_factory_linked_service_postgresql_resource_test.go} (100%) rename azurerm/internal/services/datafactory/tests/{resource_arm_data_factory_linked_service_sql_server_test.go => data_factory_linked_service_sql_server_resource_test.go} (100%) rename azurerm/internal/services/datafactory/tests/{resource_arm_data_factory_pipeline_test.go => data_factory_pipeline_resource_test.go} (100%) rename azurerm/internal/services/datafactory/tests/{resource_arm_data_factory_test.go => data_factory_resource_test.go} (100%) rename azurerm/internal/services/datafactory/tests/{resource_arm_data_factory_trigger_schedule_test.go => data_factory_trigger_schedule_resource_test.go} (100%) diff --git a/azurerm/internal/services/datafactory/data_source_data_factory.go b/azurerm/internal/services/datafactory/data_factory_data_source.go similarity index 100% rename from azurerm/internal/services/datafactory/data_source_data_factory.go rename to azurerm/internal/services/datafactory/data_factory_data_source.go diff --git a/azurerm/internal/services/datafactory/resource_arm_data_factory_dataset_mysql.go b/azurerm/internal/services/datafactory/data_factory_dataset_mysql_resource.go similarity index 100% rename from azurerm/internal/services/datafactory/resource_arm_data_factory_dataset_mysql.go rename to azurerm/internal/services/datafactory/data_factory_dataset_mysql_resource.go diff --git a/azurerm/internal/services/datafactory/resource_arm_data_factory_dataset_postgresql.go b/azurerm/internal/services/datafactory/data_factory_dataset_postgresql_resource.go similarity index 100% rename from azurerm/internal/services/datafactory/resource_arm_data_factory_dataset_postgresql.go rename to azurerm/internal/services/datafactory/data_factory_dataset_postgresql_resource.go diff --git a/azurerm/internal/services/datafactory/resource_arm_data_factory_dataset_sql_server_table.go b/azurerm/internal/services/datafactory/data_factory_dataset_sql_server_table_resource.go similarity index 100% rename from azurerm/internal/services/datafactory/resource_arm_data_factory_dataset_sql_server_table.go rename to azurerm/internal/services/datafactory/data_factory_dataset_sql_server_table_resource.go diff --git a/azurerm/internal/services/datafactory/resource_arm_data_factory_integration_runtime_managed.go b/azurerm/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go similarity index 100% rename from azurerm/internal/services/datafactory/resource_arm_data_factory_integration_runtime_managed.go rename to azurerm/internal/services/datafactory/data_factory_integration_runtime_managed_resource.go diff --git a/azurerm/internal/services/datafactory/resource_arm_data_factory_linked_service_data_lake_storage_gen2.go b/azurerm/internal/services/datafactory/data_factory_linked_service_data_lake_storage_gen2_resource.go similarity index 100% rename from azurerm/internal/services/datafactory/resource_arm_data_factory_linked_service_data_lake_storage_gen2.go rename to azurerm/internal/services/datafactory/data_factory_linked_service_data_lake_storage_gen2_resource.go diff --git a/azurerm/internal/services/datafactory/resource_arm_data_factory_linked_service_mysql.go b/azurerm/internal/services/datafactory/data_factory_linked_service_mysql_resource.go similarity index 100% rename from azurerm/internal/services/datafactory/resource_arm_data_factory_linked_service_mysql.go rename to azurerm/internal/services/datafactory/data_factory_linked_service_mysql_resource.go diff --git a/azurerm/internal/services/datafactory/resource_arm_data_factory_linked_service_postgresql.go b/azurerm/internal/services/datafactory/data_factory_linked_service_postgresql_resource.go similarity index 100% rename from azurerm/internal/services/datafactory/resource_arm_data_factory_linked_service_postgresql.go rename to azurerm/internal/services/datafactory/data_factory_linked_service_postgresql_resource.go diff --git a/azurerm/internal/services/datafactory/resource_arm_data_factory_linked_service_sql_server.go b/azurerm/internal/services/datafactory/data_factory_linked_service_sql_server_resource.go similarity index 100% rename from azurerm/internal/services/datafactory/resource_arm_data_factory_linked_service_sql_server.go rename to azurerm/internal/services/datafactory/data_factory_linked_service_sql_server_resource.go diff --git a/azurerm/internal/services/datafactory/resource_arm_data_factory_pipeline.go b/azurerm/internal/services/datafactory/data_factory_pipeline_resource.go similarity index 100% rename from azurerm/internal/services/datafactory/resource_arm_data_factory_pipeline.go rename to azurerm/internal/services/datafactory/data_factory_pipeline_resource.go diff --git a/azurerm/internal/services/datafactory/resource_arm_data_factory.go b/azurerm/internal/services/datafactory/data_factory_resource.go similarity index 100% rename from azurerm/internal/services/datafactory/resource_arm_data_factory.go rename to azurerm/internal/services/datafactory/data_factory_resource.go diff --git a/azurerm/internal/services/datafactory/resource_arm_data_factory_trigger_schedule.go b/azurerm/internal/services/datafactory/data_factory_trigger_schedule_resource.go similarity index 100% rename from azurerm/internal/services/datafactory/resource_arm_data_factory_trigger_schedule.go rename to azurerm/internal/services/datafactory/data_factory_trigger_schedule_resource.go diff --git a/azurerm/internal/services/datafactory/tests/data_source_data_factory_test.go b/azurerm/internal/services/datafactory/tests/data_factory_data_source_test.go similarity index 100% rename from azurerm/internal/services/datafactory/tests/data_source_data_factory_test.go rename to azurerm/internal/services/datafactory/tests/data_factory_data_source_test.go diff --git a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_dataset_mysql_test.go b/azurerm/internal/services/datafactory/tests/data_factory_dataset_mysql_resource_test.go similarity index 100% rename from azurerm/internal/services/datafactory/tests/resource_arm_data_factory_dataset_mysql_test.go rename to azurerm/internal/services/datafactory/tests/data_factory_dataset_mysql_resource_test.go diff --git a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_dataset_postgresql_test.go b/azurerm/internal/services/datafactory/tests/data_factory_dataset_postgresql_resource_test.go similarity index 100% rename from azurerm/internal/services/datafactory/tests/resource_arm_data_factory_dataset_postgresql_test.go rename to azurerm/internal/services/datafactory/tests/data_factory_dataset_postgresql_resource_test.go diff --git a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_dataset_sql_server_table_test.go b/azurerm/internal/services/datafactory/tests/data_factory_dataset_sql_server_table_resource_test.go similarity index 100% rename from azurerm/internal/services/datafactory/tests/resource_arm_data_factory_dataset_sql_server_table_test.go rename to azurerm/internal/services/datafactory/tests/data_factory_dataset_sql_server_table_resource_test.go diff --git a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_integration_runtime_managed_test.go b/azurerm/internal/services/datafactory/tests/data_factory_integration_runtime_managed_resource_test.go similarity index 100% rename from azurerm/internal/services/datafactory/tests/resource_arm_data_factory_integration_runtime_managed_test.go rename to azurerm/internal/services/datafactory/tests/data_factory_integration_runtime_managed_resource_test.go diff --git a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_linked_service_data_lake_storage_gen2_test.go b/azurerm/internal/services/datafactory/tests/data_factory_linked_service_data_lake_storage_gen2_resource_test.go similarity index 100% rename from azurerm/internal/services/datafactory/tests/resource_arm_data_factory_linked_service_data_lake_storage_gen2_test.go rename to azurerm/internal/services/datafactory/tests/data_factory_linked_service_data_lake_storage_gen2_resource_test.go diff --git a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_linked_service_mysql_test.go b/azurerm/internal/services/datafactory/tests/data_factory_linked_service_mysql_resource_test.go similarity index 100% rename from azurerm/internal/services/datafactory/tests/resource_arm_data_factory_linked_service_mysql_test.go rename to azurerm/internal/services/datafactory/tests/data_factory_linked_service_mysql_resource_test.go diff --git a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_linked_service_postgresql_test.go b/azurerm/internal/services/datafactory/tests/data_factory_linked_service_postgresql_resource_test.go similarity index 100% rename from azurerm/internal/services/datafactory/tests/resource_arm_data_factory_linked_service_postgresql_test.go rename to azurerm/internal/services/datafactory/tests/data_factory_linked_service_postgresql_resource_test.go diff --git a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_linked_service_sql_server_test.go b/azurerm/internal/services/datafactory/tests/data_factory_linked_service_sql_server_resource_test.go similarity index 100% rename from azurerm/internal/services/datafactory/tests/resource_arm_data_factory_linked_service_sql_server_test.go rename to azurerm/internal/services/datafactory/tests/data_factory_linked_service_sql_server_resource_test.go diff --git a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_pipeline_test.go b/azurerm/internal/services/datafactory/tests/data_factory_pipeline_resource_test.go similarity index 100% rename from azurerm/internal/services/datafactory/tests/resource_arm_data_factory_pipeline_test.go rename to azurerm/internal/services/datafactory/tests/data_factory_pipeline_resource_test.go diff --git a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_test.go b/azurerm/internal/services/datafactory/tests/data_factory_resource_test.go similarity index 100% rename from azurerm/internal/services/datafactory/tests/resource_arm_data_factory_test.go rename to azurerm/internal/services/datafactory/tests/data_factory_resource_test.go diff --git a/azurerm/internal/services/datafactory/tests/resource_arm_data_factory_trigger_schedule_test.go b/azurerm/internal/services/datafactory/tests/data_factory_trigger_schedule_resource_test.go similarity index 100% rename from azurerm/internal/services/datafactory/tests/resource_arm_data_factory_trigger_schedule_test.go rename to azurerm/internal/services/datafactory/tests/data_factory_trigger_schedule_resource_test.go From a0e7d98d0a125f17e8fbf3fe39b6fbee930ce830 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:14:38 -0500 Subject: [PATCH 164/223] Updates `datalake` --- ...alytics_account.go => data_lake_analytics_account_resource.go} | 0 ...wall_rule.go => data_lake_analytics_firewall_rule_resource.go} | 0 ...a_source_data_lake_store.go => data_lake_store_data_source.go} | 0 ...le_migration.go => data_lake_store_file_migration_resource.go} | 0 ...m_data_lake_store_file.go => data_lake_store_file_resource.go} | 0 ...firewall_rule.go => data_lake_store_firewall_rule_resource.go} | 0 ...esource_arm_data_lake_store.go => data_lake_store_resource.go} | 0 ...count_test.go => data_lake_analytics_account_resource_test.go} | 0 ...test.go => data_lake_analytics_firewall_rule_resource_test.go} | 0 ...ata_lake_store_test.go => data_lake_store_data_source_test.go} | 0 ...on_test.go => data_lake_store_file_migration_resource_test.go} | 0 ...e_store_file_test.go => data_lake_store_file_resource_test.go} | 0 ...ule_test.go => data_lake_store_firewall_rule_resource_test.go} | 0 ...m_data_lake_store_test.go => data_lake_store_resource_test.go} | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/datalake/{resource_arm_data_lake_analytics_account.go => data_lake_analytics_account_resource.go} (100%) rename azurerm/internal/services/datalake/{resource_arm_data_lake_analytics_firewall_rule.go => data_lake_analytics_firewall_rule_resource.go} (100%) rename azurerm/internal/services/datalake/{data_source_data_lake_store.go => data_lake_store_data_source.go} (100%) rename azurerm/internal/services/datalake/{resource_arm_data_lake_store_file_migration.go => data_lake_store_file_migration_resource.go} (100%) rename azurerm/internal/services/datalake/{resource_arm_data_lake_store_file.go => data_lake_store_file_resource.go} (100%) rename azurerm/internal/services/datalake/{resource_arm_data_lake_store_firewall_rule.go => data_lake_store_firewall_rule_resource.go} (100%) rename azurerm/internal/services/datalake/{resource_arm_data_lake_store.go => data_lake_store_resource.go} (100%) rename azurerm/internal/services/datalake/tests/{resource_arm_data_lake_analytics_account_test.go => data_lake_analytics_account_resource_test.go} (100%) rename azurerm/internal/services/datalake/tests/{resource_arm_data_lake_analytics_firewall_rule_test.go => data_lake_analytics_firewall_rule_resource_test.go} (100%) rename azurerm/internal/services/datalake/tests/{data_source_data_lake_store_test.go => data_lake_store_data_source_test.go} (100%) rename azurerm/internal/services/datalake/tests/{resource_arm_data_lake_store_file_migration_test.go => data_lake_store_file_migration_resource_test.go} (100%) rename azurerm/internal/services/datalake/tests/{resource_arm_data_lake_store_file_test.go => data_lake_store_file_resource_test.go} (100%) rename azurerm/internal/services/datalake/tests/{resource_arm_data_lake_store_firewall_rule_test.go => data_lake_store_firewall_rule_resource_test.go} (100%) rename azurerm/internal/services/datalake/tests/{resource_arm_data_lake_store_test.go => data_lake_store_resource_test.go} (100%) diff --git a/azurerm/internal/services/datalake/resource_arm_data_lake_analytics_account.go b/azurerm/internal/services/datalake/data_lake_analytics_account_resource.go similarity index 100% rename from azurerm/internal/services/datalake/resource_arm_data_lake_analytics_account.go rename to azurerm/internal/services/datalake/data_lake_analytics_account_resource.go diff --git a/azurerm/internal/services/datalake/resource_arm_data_lake_analytics_firewall_rule.go b/azurerm/internal/services/datalake/data_lake_analytics_firewall_rule_resource.go similarity index 100% rename from azurerm/internal/services/datalake/resource_arm_data_lake_analytics_firewall_rule.go rename to azurerm/internal/services/datalake/data_lake_analytics_firewall_rule_resource.go diff --git a/azurerm/internal/services/datalake/data_source_data_lake_store.go b/azurerm/internal/services/datalake/data_lake_store_data_source.go similarity index 100% rename from azurerm/internal/services/datalake/data_source_data_lake_store.go rename to azurerm/internal/services/datalake/data_lake_store_data_source.go diff --git a/azurerm/internal/services/datalake/resource_arm_data_lake_store_file_migration.go b/azurerm/internal/services/datalake/data_lake_store_file_migration_resource.go similarity index 100% rename from azurerm/internal/services/datalake/resource_arm_data_lake_store_file_migration.go rename to azurerm/internal/services/datalake/data_lake_store_file_migration_resource.go diff --git a/azurerm/internal/services/datalake/resource_arm_data_lake_store_file.go b/azurerm/internal/services/datalake/data_lake_store_file_resource.go similarity index 100% rename from azurerm/internal/services/datalake/resource_arm_data_lake_store_file.go rename to azurerm/internal/services/datalake/data_lake_store_file_resource.go diff --git a/azurerm/internal/services/datalake/resource_arm_data_lake_store_firewall_rule.go b/azurerm/internal/services/datalake/data_lake_store_firewall_rule_resource.go similarity index 100% rename from azurerm/internal/services/datalake/resource_arm_data_lake_store_firewall_rule.go rename to azurerm/internal/services/datalake/data_lake_store_firewall_rule_resource.go diff --git a/azurerm/internal/services/datalake/resource_arm_data_lake_store.go b/azurerm/internal/services/datalake/data_lake_store_resource.go similarity index 100% rename from azurerm/internal/services/datalake/resource_arm_data_lake_store.go rename to azurerm/internal/services/datalake/data_lake_store_resource.go diff --git a/azurerm/internal/services/datalake/tests/resource_arm_data_lake_analytics_account_test.go b/azurerm/internal/services/datalake/tests/data_lake_analytics_account_resource_test.go similarity index 100% rename from azurerm/internal/services/datalake/tests/resource_arm_data_lake_analytics_account_test.go rename to azurerm/internal/services/datalake/tests/data_lake_analytics_account_resource_test.go diff --git a/azurerm/internal/services/datalake/tests/resource_arm_data_lake_analytics_firewall_rule_test.go b/azurerm/internal/services/datalake/tests/data_lake_analytics_firewall_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/datalake/tests/resource_arm_data_lake_analytics_firewall_rule_test.go rename to azurerm/internal/services/datalake/tests/data_lake_analytics_firewall_rule_resource_test.go diff --git a/azurerm/internal/services/datalake/tests/data_source_data_lake_store_test.go b/azurerm/internal/services/datalake/tests/data_lake_store_data_source_test.go similarity index 100% rename from azurerm/internal/services/datalake/tests/data_source_data_lake_store_test.go rename to azurerm/internal/services/datalake/tests/data_lake_store_data_source_test.go diff --git a/azurerm/internal/services/datalake/tests/resource_arm_data_lake_store_file_migration_test.go b/azurerm/internal/services/datalake/tests/data_lake_store_file_migration_resource_test.go similarity index 100% rename from azurerm/internal/services/datalake/tests/resource_arm_data_lake_store_file_migration_test.go rename to azurerm/internal/services/datalake/tests/data_lake_store_file_migration_resource_test.go diff --git a/azurerm/internal/services/datalake/tests/resource_arm_data_lake_store_file_test.go b/azurerm/internal/services/datalake/tests/data_lake_store_file_resource_test.go similarity index 100% rename from azurerm/internal/services/datalake/tests/resource_arm_data_lake_store_file_test.go rename to azurerm/internal/services/datalake/tests/data_lake_store_file_resource_test.go diff --git a/azurerm/internal/services/datalake/tests/resource_arm_data_lake_store_firewall_rule_test.go b/azurerm/internal/services/datalake/tests/data_lake_store_firewall_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/datalake/tests/resource_arm_data_lake_store_firewall_rule_test.go rename to azurerm/internal/services/datalake/tests/data_lake_store_firewall_rule_resource_test.go diff --git a/azurerm/internal/services/datalake/tests/resource_arm_data_lake_store_test.go b/azurerm/internal/services/datalake/tests/data_lake_store_resource_test.go similarity index 100% rename from azurerm/internal/services/datalake/tests/resource_arm_data_lake_store_test.go rename to azurerm/internal/services/datalake/tests/data_lake_store_resource_test.go From 0bed50dbebd78620d428a20da23d1035cda3375d Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:14:45 -0500 Subject: [PATCH 165/223] Updates `datashare` --- ...ce_data_share_account.go => data_share_account_data_source.go} | 0 ...e_arm_data_share_account.go => data_share_account_resource.go} | 0 ...are_account_test.go => data_share_account_data_source_test.go} | 0 ..._share_account_test.go => data_share_account_resource_test.go} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/datashare/{data_source_data_share_account.go => data_share_account_data_source.go} (100%) rename azurerm/internal/services/datashare/{resource_arm_data_share_account.go => data_share_account_resource.go} (100%) rename azurerm/internal/services/datashare/tests/{data_source_data_share_account_test.go => data_share_account_data_source_test.go} (100%) rename azurerm/internal/services/datashare/tests/{resource_arm_data_share_account_test.go => data_share_account_resource_test.go} (100%) diff --git a/azurerm/internal/services/datashare/data_source_data_share_account.go b/azurerm/internal/services/datashare/data_share_account_data_source.go similarity index 100% rename from azurerm/internal/services/datashare/data_source_data_share_account.go rename to azurerm/internal/services/datashare/data_share_account_data_source.go diff --git a/azurerm/internal/services/datashare/resource_arm_data_share_account.go b/azurerm/internal/services/datashare/data_share_account_resource.go similarity index 100% rename from azurerm/internal/services/datashare/resource_arm_data_share_account.go rename to azurerm/internal/services/datashare/data_share_account_resource.go diff --git a/azurerm/internal/services/datashare/tests/data_source_data_share_account_test.go b/azurerm/internal/services/datashare/tests/data_share_account_data_source_test.go similarity index 100% rename from azurerm/internal/services/datashare/tests/data_source_data_share_account_test.go rename to azurerm/internal/services/datashare/tests/data_share_account_data_source_test.go diff --git a/azurerm/internal/services/datashare/tests/resource_arm_data_share_account_test.go b/azurerm/internal/services/datashare/tests/data_share_account_resource_test.go similarity index 100% rename from azurerm/internal/services/datashare/tests/resource_arm_data_share_account_test.go rename to azurerm/internal/services/datashare/tests/data_share_account_resource_test.go From 21cf5fd4b9f0ad71670405f00031ee19c83e40dd Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:14:58 -0500 Subject: [PATCH 166/223] Updates `devspace` --- ...arm_devspace_controller.go => devspace_controller_resource.go} | 0 ...ce_controller_test.go => devspace_controller_resource_test.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/devspace/{resource_arm_devspace_controller.go => devspace_controller_resource.go} (100%) rename azurerm/internal/services/devspace/tests/{resource_arm_devspace_controller_test.go => devspace_controller_resource_test.go} (100%) diff --git a/azurerm/internal/services/devspace/resource_arm_devspace_controller.go b/azurerm/internal/services/devspace/devspace_controller_resource.go similarity index 100% rename from azurerm/internal/services/devspace/resource_arm_devspace_controller.go rename to azurerm/internal/services/devspace/devspace_controller_resource.go diff --git a/azurerm/internal/services/devspace/tests/resource_arm_devspace_controller_test.go b/azurerm/internal/services/devspace/tests/devspace_controller_resource_test.go similarity index 100% rename from azurerm/internal/services/devspace/tests/resource_arm_devspace_controller_test.go rename to azurerm/internal/services/devspace/tests/devspace_controller_resource_test.go From 2edccc6c5188b361a73b1ad26bee6b8d8cb8f4b0 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:15:07 -0500 Subject: [PATCH 167/223] Updates `devtestlabs` --- .../{data_source_dev_test_lab.go => dev_test_lab_data_source.go} | 0 .../{resource_arm_dev_test_lab.go => dev_test_lab_resource.go} | 0 ...dev_test_lab_schedule.go => dev_test_lab_schedule_resource.go} | 0 ...tual_machine.go => dev_test_linux_virtual_machine_resource.go} | 0 ...esource_arm_dev_test_policy.go => dev_test_policy_resource.go} | 0 ...virtual_network.go => dev_test_virtual_network_data_source.go} | 0 ...st_virtual_network.go => dev_test_virtual_network_resource.go} | 0 ...al_machine.go => dev_test_windows_virtual_machine_resource.go} | 0 ...urce_dev_test_lab_test.go => dev_test_lab_data_source_test.go} | 0 ...rce_arm_dev_test_lab_test.go => dev_test_lab_resource_test.go} | 0 ...ab_schedule_test.go => dev_test_lab_schedule_resource_test.go} | 0 ...ne_test.go => dev_test_linux_virtual_machine_resource_test.go} | 0 ...m_dev_test_policy_test.go => dev_test_policy_resource_test.go} | 0 ...twork_test.go => dev_test_virtual_network_data_source_test.go} | 0 ..._network_test.go => dev_test_virtual_network_resource_test.go} | 0 ..._test.go => dev_test_windows_virtual_machine_resource_test.go} | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/devtestlabs/{data_source_dev_test_lab.go => dev_test_lab_data_source.go} (100%) rename azurerm/internal/services/devtestlabs/{resource_arm_dev_test_lab.go => dev_test_lab_resource.go} (100%) rename azurerm/internal/services/devtestlabs/{resource_arm_dev_test_lab_schedule.go => dev_test_lab_schedule_resource.go} (100%) rename azurerm/internal/services/devtestlabs/{resource_arm_dev_test_linux_virtual_machine.go => dev_test_linux_virtual_machine_resource.go} (100%) rename azurerm/internal/services/devtestlabs/{resource_arm_dev_test_policy.go => dev_test_policy_resource.go} (100%) rename azurerm/internal/services/devtestlabs/{data_source_dev_test_virtual_network.go => dev_test_virtual_network_data_source.go} (100%) rename azurerm/internal/services/devtestlabs/{resource_arm_dev_test_virtual_network.go => dev_test_virtual_network_resource.go} (100%) rename azurerm/internal/services/devtestlabs/{resource_arm_dev_test_windows_virtual_machine.go => dev_test_windows_virtual_machine_resource.go} (100%) rename azurerm/internal/services/devtestlabs/tests/{data_source_dev_test_lab_test.go => dev_test_lab_data_source_test.go} (100%) rename azurerm/internal/services/devtestlabs/tests/{resource_arm_dev_test_lab_test.go => dev_test_lab_resource_test.go} (100%) rename azurerm/internal/services/devtestlabs/tests/{resource_arm_dev_test_lab_schedule_test.go => dev_test_lab_schedule_resource_test.go} (100%) rename azurerm/internal/services/devtestlabs/tests/{resource_arm_dev_test_linux_virtual_machine_test.go => dev_test_linux_virtual_machine_resource_test.go} (100%) rename azurerm/internal/services/devtestlabs/tests/{resource_arm_dev_test_policy_test.go => dev_test_policy_resource_test.go} (100%) rename azurerm/internal/services/devtestlabs/tests/{data_source_dev_test_virtual_network_test.go => dev_test_virtual_network_data_source_test.go} (100%) rename azurerm/internal/services/devtestlabs/tests/{resource_arm_dev_test_virtual_network_test.go => dev_test_virtual_network_resource_test.go} (100%) rename azurerm/internal/services/devtestlabs/tests/{resource_arm_dev_test_windows_virtual_machine_test.go => dev_test_windows_virtual_machine_resource_test.go} (100%) diff --git a/azurerm/internal/services/devtestlabs/data_source_dev_test_lab.go b/azurerm/internal/services/devtestlabs/dev_test_lab_data_source.go similarity index 100% rename from azurerm/internal/services/devtestlabs/data_source_dev_test_lab.go rename to azurerm/internal/services/devtestlabs/dev_test_lab_data_source.go diff --git a/azurerm/internal/services/devtestlabs/resource_arm_dev_test_lab.go b/azurerm/internal/services/devtestlabs/dev_test_lab_resource.go similarity index 100% rename from azurerm/internal/services/devtestlabs/resource_arm_dev_test_lab.go rename to azurerm/internal/services/devtestlabs/dev_test_lab_resource.go diff --git a/azurerm/internal/services/devtestlabs/resource_arm_dev_test_lab_schedule.go b/azurerm/internal/services/devtestlabs/dev_test_lab_schedule_resource.go similarity index 100% rename from azurerm/internal/services/devtestlabs/resource_arm_dev_test_lab_schedule.go rename to azurerm/internal/services/devtestlabs/dev_test_lab_schedule_resource.go diff --git a/azurerm/internal/services/devtestlabs/resource_arm_dev_test_linux_virtual_machine.go b/azurerm/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go similarity index 100% rename from azurerm/internal/services/devtestlabs/resource_arm_dev_test_linux_virtual_machine.go rename to azurerm/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go diff --git a/azurerm/internal/services/devtestlabs/resource_arm_dev_test_policy.go b/azurerm/internal/services/devtestlabs/dev_test_policy_resource.go similarity index 100% rename from azurerm/internal/services/devtestlabs/resource_arm_dev_test_policy.go rename to azurerm/internal/services/devtestlabs/dev_test_policy_resource.go diff --git a/azurerm/internal/services/devtestlabs/data_source_dev_test_virtual_network.go b/azurerm/internal/services/devtestlabs/dev_test_virtual_network_data_source.go similarity index 100% rename from azurerm/internal/services/devtestlabs/data_source_dev_test_virtual_network.go rename to azurerm/internal/services/devtestlabs/dev_test_virtual_network_data_source.go diff --git a/azurerm/internal/services/devtestlabs/resource_arm_dev_test_virtual_network.go b/azurerm/internal/services/devtestlabs/dev_test_virtual_network_resource.go similarity index 100% rename from azurerm/internal/services/devtestlabs/resource_arm_dev_test_virtual_network.go rename to azurerm/internal/services/devtestlabs/dev_test_virtual_network_resource.go diff --git a/azurerm/internal/services/devtestlabs/resource_arm_dev_test_windows_virtual_machine.go b/azurerm/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go similarity index 100% rename from azurerm/internal/services/devtestlabs/resource_arm_dev_test_windows_virtual_machine.go rename to azurerm/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go diff --git a/azurerm/internal/services/devtestlabs/tests/data_source_dev_test_lab_test.go b/azurerm/internal/services/devtestlabs/tests/dev_test_lab_data_source_test.go similarity index 100% rename from azurerm/internal/services/devtestlabs/tests/data_source_dev_test_lab_test.go rename to azurerm/internal/services/devtestlabs/tests/dev_test_lab_data_source_test.go diff --git a/azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_lab_test.go b/azurerm/internal/services/devtestlabs/tests/dev_test_lab_resource_test.go similarity index 100% rename from azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_lab_test.go rename to azurerm/internal/services/devtestlabs/tests/dev_test_lab_resource_test.go diff --git a/azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_lab_schedule_test.go b/azurerm/internal/services/devtestlabs/tests/dev_test_lab_schedule_resource_test.go similarity index 100% rename from azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_lab_schedule_test.go rename to azurerm/internal/services/devtestlabs/tests/dev_test_lab_schedule_resource_test.go diff --git a/azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_linux_virtual_machine_test.go b/azurerm/internal/services/devtestlabs/tests/dev_test_linux_virtual_machine_resource_test.go similarity index 100% rename from azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_linux_virtual_machine_test.go rename to azurerm/internal/services/devtestlabs/tests/dev_test_linux_virtual_machine_resource_test.go diff --git a/azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_policy_test.go b/azurerm/internal/services/devtestlabs/tests/dev_test_policy_resource_test.go similarity index 100% rename from azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_policy_test.go rename to azurerm/internal/services/devtestlabs/tests/dev_test_policy_resource_test.go diff --git a/azurerm/internal/services/devtestlabs/tests/data_source_dev_test_virtual_network_test.go b/azurerm/internal/services/devtestlabs/tests/dev_test_virtual_network_data_source_test.go similarity index 100% rename from azurerm/internal/services/devtestlabs/tests/data_source_dev_test_virtual_network_test.go rename to azurerm/internal/services/devtestlabs/tests/dev_test_virtual_network_data_source_test.go diff --git a/azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_virtual_network_test.go b/azurerm/internal/services/devtestlabs/tests/dev_test_virtual_network_resource_test.go similarity index 100% rename from azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_virtual_network_test.go rename to azurerm/internal/services/devtestlabs/tests/dev_test_virtual_network_resource_test.go diff --git a/azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_windows_virtual_machine_test.go b/azurerm/internal/services/devtestlabs/tests/dev_test_windows_virtual_machine_resource_test.go similarity index 100% rename from azurerm/internal/services/devtestlabs/tests/resource_arm_dev_test_windows_virtual_machine_test.go rename to azurerm/internal/services/devtestlabs/tests/dev_test_windows_virtual_machine_resource_test.go From 64bda2b9592dcd6ade211c4d0b6b41143ceb0704 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:15:15 -0500 Subject: [PATCH 168/223] Updates `dns` --- .../{resource_arm_dns_a_record.go => dns_a_record_resource.go} | 0 ...esource_arm_dns_aaaa_record.go => dns_aaaa_record_resource.go} | 0 ...{resource_arm_dns_caa_record.go => dns_caa_record_resource.go} | 0 ...ource_arm_dns_cname_record.go => dns_cname_record_resource.go} | 0 .../{resource_arm_dns_mx_record.go => dns_mx_record_resource.go} | 0 .../{resource_arm_dns_ns_record.go => dns_ns_record_resource.go} | 0 ...{resource_arm_dns_ptr_record.go => dns_ptr_record_resource.go} | 0 ...{resource_arm_dns_srv_record.go => dns_srv_record_resource.go} | 0 ...{resource_arm_dns_txt_record.go => dns_txt_record_resource.go} | 0 .../dns/{data_source_dns_zone.go => dns_zone_data_source.go} | 0 .../dns/{resource_arm_dns_zone.go => dns_zone_resource.go} | 0 ...rce_arm_dns_a_record_test.go => dns_a_record_resource_test.go} | 0 ...m_dns_aaaa_record_test.go => dns_aaaa_record_resource_test.go} | 0 ...arm_dns_caa_record_test.go => dns_caa_record_resource_test.go} | 0 ...dns_cname_record_test.go => dns_cname_record_resource_test.go} | 0 ...e_arm_dns_mx_record_test.go => dns_mx_record_resource_test.go} | 0 ...e_arm_dns_ns_record_test.go => dns_ns_record_resource_test.go} | 0 ...arm_dns_ptr_record_test.go => dns_ptr_record_resource_test.go} | 0 ...arm_dns_srv_record_test.go => dns_srv_record_resource_test.go} | 0 ...arm_dns_txt_record_test.go => dns_txt_record_resource_test.go} | 0 ...{data_source_dns_zone_test.go => dns_zone_data_source_test.go} | 0 .../{resource_arm_dns_zone_test.go => dns_zone_resource_test.go} | 0 22 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/dns/{resource_arm_dns_a_record.go => dns_a_record_resource.go} (100%) rename azurerm/internal/services/dns/{resource_arm_dns_aaaa_record.go => dns_aaaa_record_resource.go} (100%) rename azurerm/internal/services/dns/{resource_arm_dns_caa_record.go => dns_caa_record_resource.go} (100%) rename azurerm/internal/services/dns/{resource_arm_dns_cname_record.go => dns_cname_record_resource.go} (100%) rename azurerm/internal/services/dns/{resource_arm_dns_mx_record.go => dns_mx_record_resource.go} (100%) rename azurerm/internal/services/dns/{resource_arm_dns_ns_record.go => dns_ns_record_resource.go} (100%) rename azurerm/internal/services/dns/{resource_arm_dns_ptr_record.go => dns_ptr_record_resource.go} (100%) rename azurerm/internal/services/dns/{resource_arm_dns_srv_record.go => dns_srv_record_resource.go} (100%) rename azurerm/internal/services/dns/{resource_arm_dns_txt_record.go => dns_txt_record_resource.go} (100%) rename azurerm/internal/services/dns/{data_source_dns_zone.go => dns_zone_data_source.go} (100%) rename azurerm/internal/services/dns/{resource_arm_dns_zone.go => dns_zone_resource.go} (100%) rename azurerm/internal/services/dns/tests/{resource_arm_dns_a_record_test.go => dns_a_record_resource_test.go} (100%) rename azurerm/internal/services/dns/tests/{resource_arm_dns_aaaa_record_test.go => dns_aaaa_record_resource_test.go} (100%) rename azurerm/internal/services/dns/tests/{resource_arm_dns_caa_record_test.go => dns_caa_record_resource_test.go} (100%) rename azurerm/internal/services/dns/tests/{resource_arm_dns_cname_record_test.go => dns_cname_record_resource_test.go} (100%) rename azurerm/internal/services/dns/tests/{resource_arm_dns_mx_record_test.go => dns_mx_record_resource_test.go} (100%) rename azurerm/internal/services/dns/tests/{resource_arm_dns_ns_record_test.go => dns_ns_record_resource_test.go} (100%) rename azurerm/internal/services/dns/tests/{resource_arm_dns_ptr_record_test.go => dns_ptr_record_resource_test.go} (100%) rename azurerm/internal/services/dns/tests/{resource_arm_dns_srv_record_test.go => dns_srv_record_resource_test.go} (100%) rename azurerm/internal/services/dns/tests/{resource_arm_dns_txt_record_test.go => dns_txt_record_resource_test.go} (100%) rename azurerm/internal/services/dns/tests/{data_source_dns_zone_test.go => dns_zone_data_source_test.go} (100%) rename azurerm/internal/services/dns/tests/{resource_arm_dns_zone_test.go => dns_zone_resource_test.go} (100%) diff --git a/azurerm/internal/services/dns/resource_arm_dns_a_record.go b/azurerm/internal/services/dns/dns_a_record_resource.go similarity index 100% rename from azurerm/internal/services/dns/resource_arm_dns_a_record.go rename to azurerm/internal/services/dns/dns_a_record_resource.go diff --git a/azurerm/internal/services/dns/resource_arm_dns_aaaa_record.go b/azurerm/internal/services/dns/dns_aaaa_record_resource.go similarity index 100% rename from azurerm/internal/services/dns/resource_arm_dns_aaaa_record.go rename to azurerm/internal/services/dns/dns_aaaa_record_resource.go diff --git a/azurerm/internal/services/dns/resource_arm_dns_caa_record.go b/azurerm/internal/services/dns/dns_caa_record_resource.go similarity index 100% rename from azurerm/internal/services/dns/resource_arm_dns_caa_record.go rename to azurerm/internal/services/dns/dns_caa_record_resource.go diff --git a/azurerm/internal/services/dns/resource_arm_dns_cname_record.go b/azurerm/internal/services/dns/dns_cname_record_resource.go similarity index 100% rename from azurerm/internal/services/dns/resource_arm_dns_cname_record.go rename to azurerm/internal/services/dns/dns_cname_record_resource.go diff --git a/azurerm/internal/services/dns/resource_arm_dns_mx_record.go b/azurerm/internal/services/dns/dns_mx_record_resource.go similarity index 100% rename from azurerm/internal/services/dns/resource_arm_dns_mx_record.go rename to azurerm/internal/services/dns/dns_mx_record_resource.go diff --git a/azurerm/internal/services/dns/resource_arm_dns_ns_record.go b/azurerm/internal/services/dns/dns_ns_record_resource.go similarity index 100% rename from azurerm/internal/services/dns/resource_arm_dns_ns_record.go rename to azurerm/internal/services/dns/dns_ns_record_resource.go diff --git a/azurerm/internal/services/dns/resource_arm_dns_ptr_record.go b/azurerm/internal/services/dns/dns_ptr_record_resource.go similarity index 100% rename from azurerm/internal/services/dns/resource_arm_dns_ptr_record.go rename to azurerm/internal/services/dns/dns_ptr_record_resource.go diff --git a/azurerm/internal/services/dns/resource_arm_dns_srv_record.go b/azurerm/internal/services/dns/dns_srv_record_resource.go similarity index 100% rename from azurerm/internal/services/dns/resource_arm_dns_srv_record.go rename to azurerm/internal/services/dns/dns_srv_record_resource.go diff --git a/azurerm/internal/services/dns/resource_arm_dns_txt_record.go b/azurerm/internal/services/dns/dns_txt_record_resource.go similarity index 100% rename from azurerm/internal/services/dns/resource_arm_dns_txt_record.go rename to azurerm/internal/services/dns/dns_txt_record_resource.go diff --git a/azurerm/internal/services/dns/data_source_dns_zone.go b/azurerm/internal/services/dns/dns_zone_data_source.go similarity index 100% rename from azurerm/internal/services/dns/data_source_dns_zone.go rename to azurerm/internal/services/dns/dns_zone_data_source.go diff --git a/azurerm/internal/services/dns/resource_arm_dns_zone.go b/azurerm/internal/services/dns/dns_zone_resource.go similarity index 100% rename from azurerm/internal/services/dns/resource_arm_dns_zone.go rename to azurerm/internal/services/dns/dns_zone_resource.go diff --git a/azurerm/internal/services/dns/tests/resource_arm_dns_a_record_test.go b/azurerm/internal/services/dns/tests/dns_a_record_resource_test.go similarity index 100% rename from azurerm/internal/services/dns/tests/resource_arm_dns_a_record_test.go rename to azurerm/internal/services/dns/tests/dns_a_record_resource_test.go diff --git a/azurerm/internal/services/dns/tests/resource_arm_dns_aaaa_record_test.go b/azurerm/internal/services/dns/tests/dns_aaaa_record_resource_test.go similarity index 100% rename from azurerm/internal/services/dns/tests/resource_arm_dns_aaaa_record_test.go rename to azurerm/internal/services/dns/tests/dns_aaaa_record_resource_test.go diff --git a/azurerm/internal/services/dns/tests/resource_arm_dns_caa_record_test.go b/azurerm/internal/services/dns/tests/dns_caa_record_resource_test.go similarity index 100% rename from azurerm/internal/services/dns/tests/resource_arm_dns_caa_record_test.go rename to azurerm/internal/services/dns/tests/dns_caa_record_resource_test.go diff --git a/azurerm/internal/services/dns/tests/resource_arm_dns_cname_record_test.go b/azurerm/internal/services/dns/tests/dns_cname_record_resource_test.go similarity index 100% rename from azurerm/internal/services/dns/tests/resource_arm_dns_cname_record_test.go rename to azurerm/internal/services/dns/tests/dns_cname_record_resource_test.go diff --git a/azurerm/internal/services/dns/tests/resource_arm_dns_mx_record_test.go b/azurerm/internal/services/dns/tests/dns_mx_record_resource_test.go similarity index 100% rename from azurerm/internal/services/dns/tests/resource_arm_dns_mx_record_test.go rename to azurerm/internal/services/dns/tests/dns_mx_record_resource_test.go diff --git a/azurerm/internal/services/dns/tests/resource_arm_dns_ns_record_test.go b/azurerm/internal/services/dns/tests/dns_ns_record_resource_test.go similarity index 100% rename from azurerm/internal/services/dns/tests/resource_arm_dns_ns_record_test.go rename to azurerm/internal/services/dns/tests/dns_ns_record_resource_test.go diff --git a/azurerm/internal/services/dns/tests/resource_arm_dns_ptr_record_test.go b/azurerm/internal/services/dns/tests/dns_ptr_record_resource_test.go similarity index 100% rename from azurerm/internal/services/dns/tests/resource_arm_dns_ptr_record_test.go rename to azurerm/internal/services/dns/tests/dns_ptr_record_resource_test.go diff --git a/azurerm/internal/services/dns/tests/resource_arm_dns_srv_record_test.go b/azurerm/internal/services/dns/tests/dns_srv_record_resource_test.go similarity index 100% rename from azurerm/internal/services/dns/tests/resource_arm_dns_srv_record_test.go rename to azurerm/internal/services/dns/tests/dns_srv_record_resource_test.go diff --git a/azurerm/internal/services/dns/tests/resource_arm_dns_txt_record_test.go b/azurerm/internal/services/dns/tests/dns_txt_record_resource_test.go similarity index 100% rename from azurerm/internal/services/dns/tests/resource_arm_dns_txt_record_test.go rename to azurerm/internal/services/dns/tests/dns_txt_record_resource_test.go diff --git a/azurerm/internal/services/dns/tests/data_source_dns_zone_test.go b/azurerm/internal/services/dns/tests/dns_zone_data_source_test.go similarity index 100% rename from azurerm/internal/services/dns/tests/data_source_dns_zone_test.go rename to azurerm/internal/services/dns/tests/dns_zone_data_source_test.go diff --git a/azurerm/internal/services/dns/tests/resource_arm_dns_zone_test.go b/azurerm/internal/services/dns/tests/dns_zone_resource_test.go similarity index 100% rename from azurerm/internal/services/dns/tests/resource_arm_dns_zone_test.go rename to azurerm/internal/services/dns/tests/dns_zone_resource_test.go From 3ab9e1c8af713230ea4166a188699ed93d342d62 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 13:18:55 -0500 Subject: [PATCH 169/223] fmts & builds --- .teamcity/components/generated/services.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/.teamcity/components/generated/services.kt b/.teamcity/components/generated/services.kt index 7a721f16b6c80..1f98d158e4785 100644 --- a/.teamcity/components/generated/services.kt +++ b/.teamcity/components/generated/services.kt @@ -21,6 +21,7 @@ var services = mapOf( "datafactory" to "Data Factory", "datalake" to "Data Lake", "databasemigration" to "Database Migration", + "datashare" to "Data Share", "devspace" to "DevSpaces", "devtestlabs" to "Dev Test", "dns" to "DNS", From 221f39e33f6855acf9845f754a545302148f633e Mon Sep 17 00:00:00 2001 From: nickmhankins <33635424+nickmhankins@users.noreply.github.com> Date: Wed, 6 May 2020 11:30:39 -0700 Subject: [PATCH 170/223] azurerm_eventhub_namespace_authorization_rule - lock so multiple resource updates won't clash (#6701) Fixes #4893 --- .../eventhub/resource_arm_eventhub.go | 2 + ...esource_arm_eventhub_authorization_rule.go | 13 +++ .../resource_arm_eventhub_namespace.go | 1 + ...m_eventhub_namespace_authorization_rule.go | 7 ++ ...ce_arm_eventhub_authorization_rule_test.go | 82 ++++++++++++++++++ ...nthub_namespace_authorization_rule_test.go | 85 +++++++++++++++++++ 6 files changed, 190 insertions(+) diff --git a/azurerm/internal/services/eventhub/resource_arm_eventhub.go b/azurerm/internal/services/eventhub/resource_arm_eventhub.go index cd444fde3a610..3b7073e04aa49 100644 --- a/azurerm/internal/services/eventhub/resource_arm_eventhub.go +++ b/azurerm/internal/services/eventhub/resource_arm_eventhub.go @@ -18,6 +18,8 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) +var eventHubResourceName = "azurerm_eventhub" + func resourceArmEventHub() *schema.Resource { return &schema.Resource{ Create: resourceArmEventHubCreateUpdate, diff --git a/azurerm/internal/services/eventhub/resource_arm_eventhub_authorization_rule.go b/azurerm/internal/services/eventhub/resource_arm_eventhub_authorization_rule.go index 8fcf45bc0cf5b..b9e8228c908f4 100644 --- a/azurerm/internal/services/eventhub/resource_arm_eventhub_authorization_rule.go +++ b/azurerm/internal/services/eventhub/resource_arm_eventhub_authorization_rule.go @@ -12,6 +12,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/locks" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -88,6 +89,12 @@ func resourceArmEventHubAuthorizationRuleCreateUpdate(d *schema.ResourceData, me } } + locks.ByName(eventHubName, eventHubResourceName) + defer locks.UnlockByName(eventHubName, eventHubResourceName) + + locks.ByName(namespaceName, eventHubNamespaceResourceName) + defer locks.UnlockByName(namespaceName, eventHubNamespaceResourceName) + parameters := eventhub.AuthorizationRule{ Name: &name, AuthorizationRuleProperties: &eventhub.AuthorizationRuleProperties{ @@ -177,6 +184,12 @@ func resourceArmEventHubAuthorizationRuleDelete(d *schema.ResourceData, meta int namespaceName := id.Path["namespaces"] eventHubName := id.Path["eventhubs"] + locks.ByName(eventHubName, eventHubResourceName) + defer locks.UnlockByName(eventHubName, eventHubResourceName) + + locks.ByName(namespaceName, eventHubNamespaceResourceName) + defer locks.UnlockByName(namespaceName, eventHubNamespaceResourceName) + resp, err := eventhubClient.DeleteAuthorizationRule(ctx, resourceGroup, namespaceName, eventHubName, name) if resp.StatusCode != http.StatusOK { diff --git a/azurerm/internal/services/eventhub/resource_arm_eventhub_namespace.go b/azurerm/internal/services/eventhub/resource_arm_eventhub_namespace.go index 5ae3bbfa2af61..35b2dbe0c20c4 100644 --- a/azurerm/internal/services/eventhub/resource_arm_eventhub_namespace.go +++ b/azurerm/internal/services/eventhub/resource_arm_eventhub_namespace.go @@ -25,6 +25,7 @@ import ( // Default Authorization Rule/Policy created by Azure, used to populate the // default connection strings and keys var eventHubNamespaceDefaultAuthorizationRule = "RootManageSharedAccessKey" +var eventHubNamespaceResourceName = "azurerm_eventhub_namespace" func resourceArmEventHubNamespace() *schema.Resource { return &schema.Resource{ diff --git a/azurerm/internal/services/eventhub/resource_arm_eventhub_namespace_authorization_rule.go b/azurerm/internal/services/eventhub/resource_arm_eventhub_namespace_authorization_rule.go index 7ae9a036c6c56..0bde5790fb4fa 100644 --- a/azurerm/internal/services/eventhub/resource_arm_eventhub_namespace_authorization_rule.go +++ b/azurerm/internal/services/eventhub/resource_arm_eventhub_namespace_authorization_rule.go @@ -12,6 +12,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/features" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/locks" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" ) @@ -80,6 +81,9 @@ func resourceArmEventHubNamespaceAuthorizationRuleCreateUpdate(d *schema.Resourc } } + locks.ByName(namespaceName, eventHubNamespaceResourceName) + defer locks.UnlockByName(namespaceName, eventHubNamespaceResourceName) + parameters := eventhub.AuthorizationRule{ Name: &name, AuthorizationRuleProperties: &eventhub.AuthorizationRuleProperties{ @@ -166,6 +170,9 @@ func resourceArmEventHubNamespaceAuthorizationRuleDelete(d *schema.ResourceData, resourceGroup := id.ResourceGroup namespaceName := id.Path["namespaces"] + locks.ByName(namespaceName, eventHubNamespaceResourceName) + defer locks.UnlockByName(namespaceName, eventHubNamespaceResourceName) + resp, err := eventhubClient.DeleteAuthorizationRule(ctx, resourceGroup, namespaceName, name) if resp.StatusCode != http.StatusOK { diff --git a/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_authorization_rule_test.go b/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_authorization_rule_test.go index 18cc142c9855c..d637f56d68857 100644 --- a/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_authorization_rule_test.go +++ b/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_authorization_rule_test.go @@ -57,6 +57,54 @@ func testAccAzureRMEventHubAuthorizationRule(t *testing.T, listen, send, manage }) } +func TestAccAzureRMEventHubAuthorizationRule_multi(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_eventhub_authorization_rule", "test1") + resourceTwoName := "azurerm_eventhub_authorization_rule.test2" + resourceThreeName := "azurerm_eventhub_authorization_rule.test3" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMEventHubAuthorizationRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAzureRMEventHubAuthorizationRule_multi(data, true, true, true), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMEventHubAuthorizationRuleExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "manage", "false"), + resource.TestCheckResourceAttr(data.ResourceName, "send", "true"), + resource.TestCheckResourceAttr(data.ResourceName, "listen", "true"), + resource.TestCheckResourceAttrSet(data.ResourceName, "primary_connection_string"), + resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_connection_string"), + testCheckAzureRMEventHubAuthorizationRuleExists(resourceTwoName), + resource.TestCheckResourceAttr(resourceTwoName, "manage", "false"), + resource.TestCheckResourceAttr(resourceTwoName, "send", "true"), + resource.TestCheckResourceAttr(resourceTwoName, "listen", "true"), + resource.TestCheckResourceAttrSet(resourceTwoName, "primary_connection_string"), + resource.TestCheckResourceAttrSet(resourceTwoName, "secondary_connection_string"), + testCheckAzureRMEventHubAuthorizationRuleExists(resourceThreeName), + resource.TestCheckResourceAttr(resourceThreeName, "manage", "false"), + resource.TestCheckResourceAttr(resourceThreeName, "send", "true"), + resource.TestCheckResourceAttr(resourceThreeName, "listen", "true"), + resource.TestCheckResourceAttrSet(resourceThreeName, "primary_connection_string"), + resource.TestCheckResourceAttrSet(resourceThreeName, "secondary_connection_string"), + ), + }, + data.ImportStep(), + { + ResourceName: resourceTwoName, + ImportState: true, + ImportStateVerify: true, + }, + { + ResourceName: resourceThreeName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccAzureRMEventHubAuthorizationRule_requiresImport(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_eventhub_authorization_rule", "test") @@ -214,6 +262,40 @@ resource "azurerm_eventhub_authorization_rule" "test" { `, data.RandomInteger, data.Locations.Primary, listen, send, manage) } +func testAzureRMEventHubAuthorizationRule_multi(data acceptance.TestData, listen, send, manage bool) string { + template := testAccAzureRMEventHubAuthorizationRule_base(data, listen, send, manage) + return fmt.Sprintf(` +%s + +resource "azurerm_eventhub_authorization_rule" "test1" { + name = "acctestruleone-%d" + eventhub_name = azurerm_eventhub.test.name + namespace_name = azurerm_eventhub_namespace.test.name + resource_group_name = azurerm_resource_group.test.name + send = true + listen = true +} + +resource "azurerm_eventhub_authorization_rule" "test2" { + name = "acctestruletwo-%d" + eventhub_name = azurerm_eventhub.test.name + namespace_name = azurerm_eventhub_namespace.test.name + resource_group_name = azurerm_resource_group.test.name + send = true + listen = true +} + +resource "azurerm_eventhub_authorization_rule" "test3" { + name = "acctestrulethree-%d" + eventhub_name = azurerm_eventhub.test.name + namespace_name = azurerm_eventhub_namespace.test.name + resource_group_name = azurerm_resource_group.test.name + send = true + listen = true +} +`, template, data.RandomInteger, data.RandomInteger, data.RandomInteger) +} + func testAccAzureRMEventHubAuthorizationRule_requiresImport(data acceptance.TestData, listen, send, manage bool) string { template := testAccAzureRMEventHubAuthorizationRule_base(data, listen, send, manage) return fmt.Sprintf(` diff --git a/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_namespace_authorization_rule_test.go b/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_namespace_authorization_rule_test.go index bf9030460cbb4..5273d778f5392 100644 --- a/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_namespace_authorization_rule_test.go +++ b/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_namespace_authorization_rule_test.go @@ -115,6 +115,54 @@ func TestAccAzureRMEventHubNamespaceAuthorizationRule_rightsUpdate(t *testing.T) }) } +func TestAccAzureRMEventHubNamespaceAuthorizationRule_multi(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_eventhub_namespace_authorization_rule", "test1") + resourceTwoName := "azurerm_eventhub_namespace_authorization_rule.test2" + resourceThreeName := "azurerm_eventhub_namespace_authorization_rule.test3" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMEventHubNamespaceAuthorizationRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAzureRMEventHubNamespaceAuthorizationRule_multi(data, true, true, true), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMEventHubNamespaceAuthorizationRuleExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "manage", "false"), + resource.TestCheckResourceAttr(data.ResourceName, "send", "true"), + resource.TestCheckResourceAttr(data.ResourceName, "listen", "true"), + resource.TestCheckResourceAttrSet(data.ResourceName, "primary_connection_string"), + resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_connection_string"), + testCheckAzureRMEventHubNamespaceAuthorizationRuleExists(resourceTwoName), + resource.TestCheckResourceAttr(resourceTwoName, "manage", "false"), + resource.TestCheckResourceAttr(resourceTwoName, "send", "true"), + resource.TestCheckResourceAttr(resourceTwoName, "listen", "true"), + resource.TestCheckResourceAttrSet(resourceTwoName, "primary_connection_string"), + resource.TestCheckResourceAttrSet(resourceTwoName, "secondary_connection_string"), + testCheckAzureRMEventHubNamespaceAuthorizationRuleExists(resourceThreeName), + resource.TestCheckResourceAttr(resourceThreeName, "manage", "false"), + resource.TestCheckResourceAttr(resourceThreeName, "send", "true"), + resource.TestCheckResourceAttr(resourceThreeName, "listen", "true"), + resource.TestCheckResourceAttrSet(resourceThreeName, "primary_connection_string"), + resource.TestCheckResourceAttrSet(resourceThreeName, "secondary_connection_string"), + ), + }, + data.ImportStep(), + { + ResourceName: resourceTwoName, + ImportState: true, + ImportStateVerify: true, + }, + { + ResourceName: resourceThreeName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testCheckAzureRMEventHubNamespaceAuthorizationRuleDestroy(s *terraform.State) error { client := acceptance.AzureProvider.Meta().(*clients.Client).Eventhub.NamespacesClient ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext @@ -216,3 +264,40 @@ resource "azurerm_eventhub_namespace_authorization_rule" "import" { } `, template) } + +func testAzureRMEventHubNamespaceAuthorizationRule_multi(data acceptance.TestData, listen, send, manage bool) string { + template := testAccAzureRMEventHubNamespaceAuthorizationRule_base(data, listen, send, manage) + return fmt.Sprintf(` +%s + +resource "azurerm_eventhub_namespace_authorization_rule" "test1" { + name = "acctestruleone-%d" + namespace_name = azurerm_eventhub_namespace.test.name + resource_group_name = azurerm_resource_group.test.name + + send = true + listen = true + manage = false +} + +resource "azurerm_eventhub_namespace_authorization_rule" "test2" { + name = "acctestruletwo-%d" + namespace_name = azurerm_eventhub_namespace.test.name + resource_group_name = azurerm_resource_group.test.name + + send = true + listen = true + manage = false +} + +resource "azurerm_eventhub_namespace_authorization_rule" "test3" { + name = "acctestrulethree-%d" + namespace_name = azurerm_eventhub_namespace.test.name + resource_group_name = azurerm_resource_group.test.name + + send = true + listen = true + manage = false +} +`, template, data.RandomInteger, data.RandomInteger, data.RandomInteger) +} From 0897c751936f559cb8e00f6d9fecd32f582d2f7b Mon Sep 17 00:00:00 2001 From: kt Date: Wed, 6 May 2020 11:31:54 -0700 Subject: [PATCH 171/223] update CHANGELOG.md to include #6701 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d92444ac0d4f3..25859fe5f22ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ IMPROVEMENTS: BUG FIXES: * `azurerm_analysis_services_server` - ip restriction name field no longer case sensitive [GH-6774] +* `azurerm_eventhub_namespace_authorization_rule` - lock to prevent multiple resources won't clash [GH-6701] * `azurerm_network_interface` - changes to dns servers no longer use incremental update [GH-6624] * `azurerm_policy_definition` - changes to the dynamic fields (`createdBy`, `createdOn`, `updatedBy`, `updatedOn`) keys in the `metadata` field are excluded from diff's [GH-6734] * `azurerm_site_recovery_network_mapping` - handling an API Error when checking for the presence of an existing Network Mapping [GH-6747] From 805f90d9956ab57ee042da273d233f3c5bcd9706 Mon Sep 17 00:00:00 2001 From: magodo Date: Thu, 7 May 2020 03:32:05 +0800 Subject: [PATCH 172/223] `azurerm_monitor_diagnostic_setting` - `log_analytics_destination_type` supports `AzureDiagnostics` #6769 --- .../resource_arm_monitor_diagnostic_setting.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/azurerm/internal/services/monitor/resource_arm_monitor_diagnostic_setting.go b/azurerm/internal/services/monitor/resource_arm_monitor_diagnostic_setting.go index d075b3bab471a..bea152d2eed54 100644 --- a/azurerm/internal/services/monitor/resource_arm_monitor_diagnostic_setting.go +++ b/azurerm/internal/services/monitor/resource_arm_monitor_diagnostic_setting.go @@ -83,10 +83,13 @@ func resourceArmMonitorDiagnosticSetting() *schema.Resource { }, "log_analytics_destination_type": { - Type: schema.TypeString, - Optional: true, - ForceNew: false, - ValidateFunc: validation.StringInSlice([]string{"Dedicated"}, false), + Type: schema.TypeString, + Optional: true, + ForceNew: false, + ValidateFunc: validation.StringInSlice([]string{ + "Dedicated", + "AzureDiagnostics", // Not documented in azure API, but some resource has skew. See: https://github.com/Azure/azure-rest-api-specs/issues/9281 + }, false), }, "log": { From 785b43c329bfce034f7985f46706a20adb4879d0 Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Wed, 6 May 2020 12:33:03 -0700 Subject: [PATCH 173/223] Update for #6769 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25859fe5f22ed..5657996ce4640 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ IMPROVEMENTS: * `azurerm_key_vault_key` - support for recovering a soft-deleted key if the `features` flag `recover_soft_deleted_key_vaults` is set to `true` [GH-6716] * `azurerm_key_vault_secret` - support for recovering a soft-deleted secret if the `features` flag `recover_soft_deleted_key_vaults` is set to `true` [GH-6716] * `azurerm_linux_virtual_machine_scale_set` - support for configuring `create_mode` for data disks [GH-6744] +* `azurerm_monitor_diagnostic_setting` - `log_analytics_destination_type` supports `AzureDiagnostics` [GH-6769] * `azurerm_windows_virtual_machine_scale_set` - support for configuring `create_mode` for data disks [GH-6744] BUG FIXES: From a8b7c68c7d19b0f52bd8291a4e34fd6fe8983339 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:38:25 -0500 Subject: [PATCH 174/223] updates `eventgrid` --- ...ource_arm_eventgrid_domain.go => eventgrid_domain_resource.go} | 0 ...t_subscription.go => eventgrid_event_subscription_resource.go} | 0 ...a_source_eventgrid_topic.go => eventgrid_topic_data_source.go} | 0 ...esource_arm_eventgrid_topic.go => eventgrid_topic_resource.go} | 0 ...eventgrid_domain_test.go => eventgrid_domain_resource_test.go} | 0 ...tion_test.go => eventgrid_event_subscription_resource_test.go} | 0 ...ventgrid_topic_test.go => eventgrid_topic_data_source_test.go} | 0 ...m_eventgrid_topic_test.go => eventgrid_topic_resource_test.go} | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/eventgrid/{resource_arm_eventgrid_domain.go => eventgrid_domain_resource.go} (100%) rename azurerm/internal/services/eventgrid/{resource_arm_eventgrid_event_subscription.go => eventgrid_event_subscription_resource.go} (100%) rename azurerm/internal/services/eventgrid/{data_source_eventgrid_topic.go => eventgrid_topic_data_source.go} (100%) rename azurerm/internal/services/eventgrid/{resource_arm_eventgrid_topic.go => eventgrid_topic_resource.go} (100%) rename azurerm/internal/services/eventgrid/tests/{resource_arm_eventgrid_domain_test.go => eventgrid_domain_resource_test.go} (100%) rename azurerm/internal/services/eventgrid/tests/{resource_arm_eventgrid_event_subscription_test.go => eventgrid_event_subscription_resource_test.go} (100%) rename azurerm/internal/services/eventgrid/tests/{data_source_eventgrid_topic_test.go => eventgrid_topic_data_source_test.go} (100%) rename azurerm/internal/services/eventgrid/tests/{resource_arm_eventgrid_topic_test.go => eventgrid_topic_resource_test.go} (100%) diff --git a/azurerm/internal/services/eventgrid/resource_arm_eventgrid_domain.go b/azurerm/internal/services/eventgrid/eventgrid_domain_resource.go similarity index 100% rename from azurerm/internal/services/eventgrid/resource_arm_eventgrid_domain.go rename to azurerm/internal/services/eventgrid/eventgrid_domain_resource.go diff --git a/azurerm/internal/services/eventgrid/resource_arm_eventgrid_event_subscription.go b/azurerm/internal/services/eventgrid/eventgrid_event_subscription_resource.go similarity index 100% rename from azurerm/internal/services/eventgrid/resource_arm_eventgrid_event_subscription.go rename to azurerm/internal/services/eventgrid/eventgrid_event_subscription_resource.go diff --git a/azurerm/internal/services/eventgrid/data_source_eventgrid_topic.go b/azurerm/internal/services/eventgrid/eventgrid_topic_data_source.go similarity index 100% rename from azurerm/internal/services/eventgrid/data_source_eventgrid_topic.go rename to azurerm/internal/services/eventgrid/eventgrid_topic_data_source.go diff --git a/azurerm/internal/services/eventgrid/resource_arm_eventgrid_topic.go b/azurerm/internal/services/eventgrid/eventgrid_topic_resource.go similarity index 100% rename from azurerm/internal/services/eventgrid/resource_arm_eventgrid_topic.go rename to azurerm/internal/services/eventgrid/eventgrid_topic_resource.go diff --git a/azurerm/internal/services/eventgrid/tests/resource_arm_eventgrid_domain_test.go b/azurerm/internal/services/eventgrid/tests/eventgrid_domain_resource_test.go similarity index 100% rename from azurerm/internal/services/eventgrid/tests/resource_arm_eventgrid_domain_test.go rename to azurerm/internal/services/eventgrid/tests/eventgrid_domain_resource_test.go diff --git a/azurerm/internal/services/eventgrid/tests/resource_arm_eventgrid_event_subscription_test.go b/azurerm/internal/services/eventgrid/tests/eventgrid_event_subscription_resource_test.go similarity index 100% rename from azurerm/internal/services/eventgrid/tests/resource_arm_eventgrid_event_subscription_test.go rename to azurerm/internal/services/eventgrid/tests/eventgrid_event_subscription_resource_test.go diff --git a/azurerm/internal/services/eventgrid/tests/data_source_eventgrid_topic_test.go b/azurerm/internal/services/eventgrid/tests/eventgrid_topic_data_source_test.go similarity index 100% rename from azurerm/internal/services/eventgrid/tests/data_source_eventgrid_topic_test.go rename to azurerm/internal/services/eventgrid/tests/eventgrid_topic_data_source_test.go diff --git a/azurerm/internal/services/eventgrid/tests/resource_arm_eventgrid_topic_test.go b/azurerm/internal/services/eventgrid/tests/eventgrid_topic_resource_test.go similarity index 100% rename from azurerm/internal/services/eventgrid/tests/resource_arm_eventgrid_topic_test.go rename to azurerm/internal/services/eventgrid/tests/eventgrid_topic_resource_test.go From a7424d6facf901058f1ad3213f6cd2e0cc5c890a Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:38:35 -0500 Subject: [PATCH 175/223] updates `eventhub` --- ...ization_rule.go => eventhub_authorization_rule_data_source.go} | 0 ...horization_rule.go => eventhub_authorization_rule_resource.go} | 0 ...b_consumer_group.go => eventhub_consumer_group_data_source.go} | 0 ...thub_consumer_group.go => eventhub_consumer_group_resource.go} | 0 ...le.go => eventhub_namespace_authorization_rule_data_source.go} | 0 ..._rule.go => eventhub_namespace_authorization_rule_resource.go} | 0 ...ce_eventhub_namespace.go => eventhub_namespace_data_source.go} | 0 ...go => eventhub_namespace_disaster_recovery_config_resource.go} | 0 ...e_arm_eventhub_namespace.go => eventhub_namespace_resource.go} | 0 .../eventhub/{resource_arm_eventhub.go => eventhub_resource.go} | 0 ...le_test.go => eventhub_authorization_rule_data_source_test.go} | 0 ..._rule_test.go => eventhub_authorization_rule_resource_test.go} | 0 ..._group_test.go => eventhub_consumer_group_data_source_test.go} | 0 ...mer_group_test.go => eventhub_consumer_group_resource_test.go} | 0 ... => eventhub_namespace_authorization_rule_data_source_test.go} | 0 ....go => eventhub_namespace_authorization_rule_resource_test.go} | 0 ...b_namespace_test.go => eventhub_namespace_data_source_test.go} | 0 ... eventhub_namespace_disaster_recovery_config_resource_test.go} | 0 ...thub_namespace_test.go => eventhub_namespace_resource_test.go} | 0 .../{resource_arm_eventhub_test.go => eventhub_resource_test.go} | 0 20 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/eventhub/{data_source_eventhub_authorization_rule.go => eventhub_authorization_rule_data_source.go} (100%) rename azurerm/internal/services/eventhub/{resource_arm_eventhub_authorization_rule.go => eventhub_authorization_rule_resource.go} (100%) rename azurerm/internal/services/eventhub/{data_source_eventhub_consumer_group.go => eventhub_consumer_group_data_source.go} (100%) rename azurerm/internal/services/eventhub/{resource_arm_eventhub_consumer_group.go => eventhub_consumer_group_resource.go} (100%) rename azurerm/internal/services/eventhub/{data_source_eventhub_namespace_authorization_rule.go => eventhub_namespace_authorization_rule_data_source.go} (100%) rename azurerm/internal/services/eventhub/{resource_arm_eventhub_namespace_authorization_rule.go => eventhub_namespace_authorization_rule_resource.go} (100%) rename azurerm/internal/services/eventhub/{data_source_eventhub_namespace.go => eventhub_namespace_data_source.go} (100%) rename azurerm/internal/services/eventhub/{resource_arm_eventhub_namespace_disaster_recovery_config.go => eventhub_namespace_disaster_recovery_config_resource.go} (100%) rename azurerm/internal/services/eventhub/{resource_arm_eventhub_namespace.go => eventhub_namespace_resource.go} (100%) rename azurerm/internal/services/eventhub/{resource_arm_eventhub.go => eventhub_resource.go} (100%) rename azurerm/internal/services/eventhub/tests/{data_source_eventhub_authorization_rule_test.go => eventhub_authorization_rule_data_source_test.go} (100%) rename azurerm/internal/services/eventhub/tests/{resource_arm_eventhub_authorization_rule_test.go => eventhub_authorization_rule_resource_test.go} (100%) rename azurerm/internal/services/eventhub/tests/{data_source_eventhub_consumer_group_test.go => eventhub_consumer_group_data_source_test.go} (100%) rename azurerm/internal/services/eventhub/tests/{resource_arm_eventhub_consumer_group_test.go => eventhub_consumer_group_resource_test.go} (100%) rename azurerm/internal/services/eventhub/tests/{data_source_eventhub_namespace_authorization_rule_test.go => eventhub_namespace_authorization_rule_data_source_test.go} (100%) rename azurerm/internal/services/eventhub/tests/{resource_arm_eventhub_namespace_authorization_rule_test.go => eventhub_namespace_authorization_rule_resource_test.go} (100%) rename azurerm/internal/services/eventhub/tests/{data_source_eventhub_namespace_test.go => eventhub_namespace_data_source_test.go} (100%) rename azurerm/internal/services/eventhub/tests/{resource_arm_eventhub_namespace_disaster_recovery_config_test.go => eventhub_namespace_disaster_recovery_config_resource_test.go} (100%) rename azurerm/internal/services/eventhub/tests/{resource_arm_eventhub_namespace_test.go => eventhub_namespace_resource_test.go} (100%) rename azurerm/internal/services/eventhub/tests/{resource_arm_eventhub_test.go => eventhub_resource_test.go} (100%) diff --git a/azurerm/internal/services/eventhub/data_source_eventhub_authorization_rule.go b/azurerm/internal/services/eventhub/eventhub_authorization_rule_data_source.go similarity index 100% rename from azurerm/internal/services/eventhub/data_source_eventhub_authorization_rule.go rename to azurerm/internal/services/eventhub/eventhub_authorization_rule_data_source.go diff --git a/azurerm/internal/services/eventhub/resource_arm_eventhub_authorization_rule.go b/azurerm/internal/services/eventhub/eventhub_authorization_rule_resource.go similarity index 100% rename from azurerm/internal/services/eventhub/resource_arm_eventhub_authorization_rule.go rename to azurerm/internal/services/eventhub/eventhub_authorization_rule_resource.go diff --git a/azurerm/internal/services/eventhub/data_source_eventhub_consumer_group.go b/azurerm/internal/services/eventhub/eventhub_consumer_group_data_source.go similarity index 100% rename from azurerm/internal/services/eventhub/data_source_eventhub_consumer_group.go rename to azurerm/internal/services/eventhub/eventhub_consumer_group_data_source.go diff --git a/azurerm/internal/services/eventhub/resource_arm_eventhub_consumer_group.go b/azurerm/internal/services/eventhub/eventhub_consumer_group_resource.go similarity index 100% rename from azurerm/internal/services/eventhub/resource_arm_eventhub_consumer_group.go rename to azurerm/internal/services/eventhub/eventhub_consumer_group_resource.go diff --git a/azurerm/internal/services/eventhub/data_source_eventhub_namespace_authorization_rule.go b/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_data_source.go similarity index 100% rename from azurerm/internal/services/eventhub/data_source_eventhub_namespace_authorization_rule.go rename to azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_data_source.go diff --git a/azurerm/internal/services/eventhub/resource_arm_eventhub_namespace_authorization_rule.go b/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_resource.go similarity index 100% rename from azurerm/internal/services/eventhub/resource_arm_eventhub_namespace_authorization_rule.go rename to azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_resource.go diff --git a/azurerm/internal/services/eventhub/data_source_eventhub_namespace.go b/azurerm/internal/services/eventhub/eventhub_namespace_data_source.go similarity index 100% rename from azurerm/internal/services/eventhub/data_source_eventhub_namespace.go rename to azurerm/internal/services/eventhub/eventhub_namespace_data_source.go diff --git a/azurerm/internal/services/eventhub/resource_arm_eventhub_namespace_disaster_recovery_config.go b/azurerm/internal/services/eventhub/eventhub_namespace_disaster_recovery_config_resource.go similarity index 100% rename from azurerm/internal/services/eventhub/resource_arm_eventhub_namespace_disaster_recovery_config.go rename to azurerm/internal/services/eventhub/eventhub_namespace_disaster_recovery_config_resource.go diff --git a/azurerm/internal/services/eventhub/resource_arm_eventhub_namespace.go b/azurerm/internal/services/eventhub/eventhub_namespace_resource.go similarity index 100% rename from azurerm/internal/services/eventhub/resource_arm_eventhub_namespace.go rename to azurerm/internal/services/eventhub/eventhub_namespace_resource.go diff --git a/azurerm/internal/services/eventhub/resource_arm_eventhub.go b/azurerm/internal/services/eventhub/eventhub_resource.go similarity index 100% rename from azurerm/internal/services/eventhub/resource_arm_eventhub.go rename to azurerm/internal/services/eventhub/eventhub_resource.go diff --git a/azurerm/internal/services/eventhub/tests/data_source_eventhub_authorization_rule_test.go b/azurerm/internal/services/eventhub/tests/eventhub_authorization_rule_data_source_test.go similarity index 100% rename from azurerm/internal/services/eventhub/tests/data_source_eventhub_authorization_rule_test.go rename to azurerm/internal/services/eventhub/tests/eventhub_authorization_rule_data_source_test.go diff --git a/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_authorization_rule_test.go b/azurerm/internal/services/eventhub/tests/eventhub_authorization_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/eventhub/tests/resource_arm_eventhub_authorization_rule_test.go rename to azurerm/internal/services/eventhub/tests/eventhub_authorization_rule_resource_test.go diff --git a/azurerm/internal/services/eventhub/tests/data_source_eventhub_consumer_group_test.go b/azurerm/internal/services/eventhub/tests/eventhub_consumer_group_data_source_test.go similarity index 100% rename from azurerm/internal/services/eventhub/tests/data_source_eventhub_consumer_group_test.go rename to azurerm/internal/services/eventhub/tests/eventhub_consumer_group_data_source_test.go diff --git a/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_consumer_group_test.go b/azurerm/internal/services/eventhub/tests/eventhub_consumer_group_resource_test.go similarity index 100% rename from azurerm/internal/services/eventhub/tests/resource_arm_eventhub_consumer_group_test.go rename to azurerm/internal/services/eventhub/tests/eventhub_consumer_group_resource_test.go diff --git a/azurerm/internal/services/eventhub/tests/data_source_eventhub_namespace_authorization_rule_test.go b/azurerm/internal/services/eventhub/tests/eventhub_namespace_authorization_rule_data_source_test.go similarity index 100% rename from azurerm/internal/services/eventhub/tests/data_source_eventhub_namespace_authorization_rule_test.go rename to azurerm/internal/services/eventhub/tests/eventhub_namespace_authorization_rule_data_source_test.go diff --git a/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_namespace_authorization_rule_test.go b/azurerm/internal/services/eventhub/tests/eventhub_namespace_authorization_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/eventhub/tests/resource_arm_eventhub_namespace_authorization_rule_test.go rename to azurerm/internal/services/eventhub/tests/eventhub_namespace_authorization_rule_resource_test.go diff --git a/azurerm/internal/services/eventhub/tests/data_source_eventhub_namespace_test.go b/azurerm/internal/services/eventhub/tests/eventhub_namespace_data_source_test.go similarity index 100% rename from azurerm/internal/services/eventhub/tests/data_source_eventhub_namespace_test.go rename to azurerm/internal/services/eventhub/tests/eventhub_namespace_data_source_test.go diff --git a/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_namespace_disaster_recovery_config_test.go b/azurerm/internal/services/eventhub/tests/eventhub_namespace_disaster_recovery_config_resource_test.go similarity index 100% rename from azurerm/internal/services/eventhub/tests/resource_arm_eventhub_namespace_disaster_recovery_config_test.go rename to azurerm/internal/services/eventhub/tests/eventhub_namespace_disaster_recovery_config_resource_test.go diff --git a/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_namespace_test.go b/azurerm/internal/services/eventhub/tests/eventhub_namespace_resource_test.go similarity index 100% rename from azurerm/internal/services/eventhub/tests/resource_arm_eventhub_namespace_test.go rename to azurerm/internal/services/eventhub/tests/eventhub_namespace_resource_test.go diff --git a/azurerm/internal/services/eventhub/tests/resource_arm_eventhub_test.go b/azurerm/internal/services/eventhub/tests/eventhub_resource_test.go similarity index 100% rename from azurerm/internal/services/eventhub/tests/resource_arm_eventhub_test.go rename to azurerm/internal/services/eventhub/tests/eventhub_resource_test.go From 45b4d40fb67936435e9fafc27119ff7a70602f14 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:38:43 -0500 Subject: [PATCH 176/223] updates `frontdoor` --- ...r_firewall_policy.go => frontdoor_firewall_policy_resource.go} | 0 .../{resource_arm_frontdoor.go => frontdoor_resource.go} | 0 ...policy_test.go => front_door_firewall_policy_resource_test.go} | 0 ...esource_arm_front_door_test.go => front_door_resource_test.go} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/frontdoor/{resource_arm_frontdoor_firewall_policy.go => frontdoor_firewall_policy_resource.go} (100%) rename azurerm/internal/services/frontdoor/{resource_arm_frontdoor.go => frontdoor_resource.go} (100%) rename azurerm/internal/services/frontdoor/tests/{resource_arm_front_door_firewall_policy_test.go => front_door_firewall_policy_resource_test.go} (100%) rename azurerm/internal/services/frontdoor/tests/{resource_arm_front_door_test.go => front_door_resource_test.go} (100%) diff --git a/azurerm/internal/services/frontdoor/resource_arm_frontdoor_firewall_policy.go b/azurerm/internal/services/frontdoor/frontdoor_firewall_policy_resource.go similarity index 100% rename from azurerm/internal/services/frontdoor/resource_arm_frontdoor_firewall_policy.go rename to azurerm/internal/services/frontdoor/frontdoor_firewall_policy_resource.go diff --git a/azurerm/internal/services/frontdoor/resource_arm_frontdoor.go b/azurerm/internal/services/frontdoor/frontdoor_resource.go similarity index 100% rename from azurerm/internal/services/frontdoor/resource_arm_frontdoor.go rename to azurerm/internal/services/frontdoor/frontdoor_resource.go diff --git a/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_firewall_policy_test.go b/azurerm/internal/services/frontdoor/tests/front_door_firewall_policy_resource_test.go similarity index 100% rename from azurerm/internal/services/frontdoor/tests/resource_arm_front_door_firewall_policy_test.go rename to azurerm/internal/services/frontdoor/tests/front_door_firewall_policy_resource_test.go diff --git a/azurerm/internal/services/frontdoor/tests/resource_arm_front_door_test.go b/azurerm/internal/services/frontdoor/tests/front_door_resource_test.go similarity index 100% rename from azurerm/internal/services/frontdoor/tests/resource_arm_front_door_test.go rename to azurerm/internal/services/frontdoor/tests/front_door_resource_test.go From d5e1985291acf559e136da649db49f84b844fcb5 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:38:56 -0500 Subject: [PATCH 177/223] updates `hdinsight` --- ...urce_hdinsight_cluster.go => hdinsight_cluster_data_source.go} | 0 ...ght_hadoop_cluster.go => hdinsight_hadoop_cluster_resource.go} | 0 ...sight_hbase_cluster.go => hdinsight_hbase_cluster_resource.go} | 0 ...cluster.go => hdinsight_interactive_query_cluster_resource.go} | 0 ...sight_kafka_cluster.go => hdinsight_kafka_cluster_resource.go} | 0 ...vices_cluster.go => hdinsight_ml_services_cluster_resource.go} | 0 ...t_rserver_cluster.go => hdinsight_rserver_cluster_resource.go} | 0 ...sight_spark_cluster.go => hdinsight_spark_cluster_resource.go} | 0 ...sight_storm_cluster.go => hdinsight_storm_cluster_resource.go} | 0 ...ight_cluster_test.go => hdinsight_cluster_data_source_test.go} | 0 ..._cluster_test.go => hdinsight_hadoop_cluster_resource_test.go} | 0 ...e_cluster_test.go => hdinsight_hbase_cluster_resource_test.go} | 0 ...st.go => hdinsight_interactive_query_cluster_resource_test.go} | 0 ...a_cluster_test.go => hdinsight_kafka_cluster_resource_test.go} | 0 ...ter_test.go => hdinsight_ml_services_cluster_resource_test.go} | 0 ...cluster_test.go => hdinsight_rserver_cluster_resource_test.go} | 0 ...k_cluster_test.go => hdinsight_spark_cluster_resource_test.go} | 0 ...m_cluster_test.go => hdinsight_storm_cluster_resource_test.go} | 0 18 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/hdinsight/{data_source_hdinsight_cluster.go => hdinsight_cluster_data_source.go} (100%) rename azurerm/internal/services/hdinsight/{resource_arm_hdinsight_hadoop_cluster.go => hdinsight_hadoop_cluster_resource.go} (100%) rename azurerm/internal/services/hdinsight/{resource_arm_hdinsight_hbase_cluster.go => hdinsight_hbase_cluster_resource.go} (100%) rename azurerm/internal/services/hdinsight/{resource_arm_hdinsight_interactive_query_cluster.go => hdinsight_interactive_query_cluster_resource.go} (100%) rename azurerm/internal/services/hdinsight/{resource_arm_hdinsight_kafka_cluster.go => hdinsight_kafka_cluster_resource.go} (100%) rename azurerm/internal/services/hdinsight/{resource_arm_hdinsight_ml_services_cluster.go => hdinsight_ml_services_cluster_resource.go} (100%) rename azurerm/internal/services/hdinsight/{resource_arm_hdinsight_rserver_cluster.go => hdinsight_rserver_cluster_resource.go} (100%) rename azurerm/internal/services/hdinsight/{resource_arm_hdinsight_spark_cluster.go => hdinsight_spark_cluster_resource.go} (100%) rename azurerm/internal/services/hdinsight/{resource_arm_hdinsight_storm_cluster.go => hdinsight_storm_cluster_resource.go} (100%) rename azurerm/internal/services/hdinsight/tests/{data_source_hdinsight_cluster_test.go => hdinsight_cluster_data_source_test.go} (100%) rename azurerm/internal/services/hdinsight/tests/{resource_arm_hdinsight_hadoop_cluster_test.go => hdinsight_hadoop_cluster_resource_test.go} (100%) rename azurerm/internal/services/hdinsight/tests/{resource_arm_hdinsight_hbase_cluster_test.go => hdinsight_hbase_cluster_resource_test.go} (100%) rename azurerm/internal/services/hdinsight/tests/{resource_arm_hdinsight_interactive_query_cluster_test.go => hdinsight_interactive_query_cluster_resource_test.go} (100%) rename azurerm/internal/services/hdinsight/tests/{resource_arm_hdinsight_kafka_cluster_test.go => hdinsight_kafka_cluster_resource_test.go} (100%) rename azurerm/internal/services/hdinsight/tests/{resource_arm_hdinsight_ml_services_cluster_test.go => hdinsight_ml_services_cluster_resource_test.go} (100%) rename azurerm/internal/services/hdinsight/tests/{resource_arm_hdinsight_rserver_cluster_test.go => hdinsight_rserver_cluster_resource_test.go} (100%) rename azurerm/internal/services/hdinsight/tests/{resource_arm_hdinsight_spark_cluster_test.go => hdinsight_spark_cluster_resource_test.go} (100%) rename azurerm/internal/services/hdinsight/tests/{resource_arm_hdinsight_storm_cluster_test.go => hdinsight_storm_cluster_resource_test.go} (100%) diff --git a/azurerm/internal/services/hdinsight/data_source_hdinsight_cluster.go b/azurerm/internal/services/hdinsight/hdinsight_cluster_data_source.go similarity index 100% rename from azurerm/internal/services/hdinsight/data_source_hdinsight_cluster.go rename to azurerm/internal/services/hdinsight/hdinsight_cluster_data_source.go diff --git a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go b/azurerm/internal/services/hdinsight/hdinsight_hadoop_cluster_resource.go similarity index 100% rename from azurerm/internal/services/hdinsight/resource_arm_hdinsight_hadoop_cluster.go rename to azurerm/internal/services/hdinsight/hdinsight_hadoop_cluster_resource.go diff --git a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_hbase_cluster.go b/azurerm/internal/services/hdinsight/hdinsight_hbase_cluster_resource.go similarity index 100% rename from azurerm/internal/services/hdinsight/resource_arm_hdinsight_hbase_cluster.go rename to azurerm/internal/services/hdinsight/hdinsight_hbase_cluster_resource.go diff --git a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_interactive_query_cluster.go b/azurerm/internal/services/hdinsight/hdinsight_interactive_query_cluster_resource.go similarity index 100% rename from azurerm/internal/services/hdinsight/resource_arm_hdinsight_interactive_query_cluster.go rename to azurerm/internal/services/hdinsight/hdinsight_interactive_query_cluster_resource.go diff --git a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_kafka_cluster.go b/azurerm/internal/services/hdinsight/hdinsight_kafka_cluster_resource.go similarity index 100% rename from azurerm/internal/services/hdinsight/resource_arm_hdinsight_kafka_cluster.go rename to azurerm/internal/services/hdinsight/hdinsight_kafka_cluster_resource.go diff --git a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_ml_services_cluster.go b/azurerm/internal/services/hdinsight/hdinsight_ml_services_cluster_resource.go similarity index 100% rename from azurerm/internal/services/hdinsight/resource_arm_hdinsight_ml_services_cluster.go rename to azurerm/internal/services/hdinsight/hdinsight_ml_services_cluster_resource.go diff --git a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_rserver_cluster.go b/azurerm/internal/services/hdinsight/hdinsight_rserver_cluster_resource.go similarity index 100% rename from azurerm/internal/services/hdinsight/resource_arm_hdinsight_rserver_cluster.go rename to azurerm/internal/services/hdinsight/hdinsight_rserver_cluster_resource.go diff --git a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_spark_cluster.go b/azurerm/internal/services/hdinsight/hdinsight_spark_cluster_resource.go similarity index 100% rename from azurerm/internal/services/hdinsight/resource_arm_hdinsight_spark_cluster.go rename to azurerm/internal/services/hdinsight/hdinsight_spark_cluster_resource.go diff --git a/azurerm/internal/services/hdinsight/resource_arm_hdinsight_storm_cluster.go b/azurerm/internal/services/hdinsight/hdinsight_storm_cluster_resource.go similarity index 100% rename from azurerm/internal/services/hdinsight/resource_arm_hdinsight_storm_cluster.go rename to azurerm/internal/services/hdinsight/hdinsight_storm_cluster_resource.go diff --git a/azurerm/internal/services/hdinsight/tests/data_source_hdinsight_cluster_test.go b/azurerm/internal/services/hdinsight/tests/hdinsight_cluster_data_source_test.go similarity index 100% rename from azurerm/internal/services/hdinsight/tests/data_source_hdinsight_cluster_test.go rename to azurerm/internal/services/hdinsight/tests/hdinsight_cluster_data_source_test.go diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go b/azurerm/internal/services/hdinsight/tests/hdinsight_hadoop_cluster_resource_test.go similarity index 100% rename from azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hadoop_cluster_test.go rename to azurerm/internal/services/hdinsight/tests/hdinsight_hadoop_cluster_resource_test.go diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hbase_cluster_test.go b/azurerm/internal/services/hdinsight/tests/hdinsight_hbase_cluster_resource_test.go similarity index 100% rename from azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_hbase_cluster_test.go rename to azurerm/internal/services/hdinsight/tests/hdinsight_hbase_cluster_resource_test.go diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_interactive_query_cluster_test.go b/azurerm/internal/services/hdinsight/tests/hdinsight_interactive_query_cluster_resource_test.go similarity index 100% rename from azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_interactive_query_cluster_test.go rename to azurerm/internal/services/hdinsight/tests/hdinsight_interactive_query_cluster_resource_test.go diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_kafka_cluster_test.go b/azurerm/internal/services/hdinsight/tests/hdinsight_kafka_cluster_resource_test.go similarity index 100% rename from azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_kafka_cluster_test.go rename to azurerm/internal/services/hdinsight/tests/hdinsight_kafka_cluster_resource_test.go diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_ml_services_cluster_test.go b/azurerm/internal/services/hdinsight/tests/hdinsight_ml_services_cluster_resource_test.go similarity index 100% rename from azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_ml_services_cluster_test.go rename to azurerm/internal/services/hdinsight/tests/hdinsight_ml_services_cluster_resource_test.go diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_rserver_cluster_test.go b/azurerm/internal/services/hdinsight/tests/hdinsight_rserver_cluster_resource_test.go similarity index 100% rename from azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_rserver_cluster_test.go rename to azurerm/internal/services/hdinsight/tests/hdinsight_rserver_cluster_resource_test.go diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_spark_cluster_test.go b/azurerm/internal/services/hdinsight/tests/hdinsight_spark_cluster_resource_test.go similarity index 100% rename from azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_spark_cluster_test.go rename to azurerm/internal/services/hdinsight/tests/hdinsight_spark_cluster_resource_test.go diff --git a/azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_storm_cluster_test.go b/azurerm/internal/services/hdinsight/tests/hdinsight_storm_cluster_resource_test.go similarity index 100% rename from azurerm/internal/services/hdinsight/tests/resource_arm_hdinsight_storm_cluster_test.go rename to azurerm/internal/services/hdinsight/tests/hdinsight_storm_cluster_resource_test.go From c287e5bb0fe958960bcd5e7c703bd148f4e45b0d Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:39:05 -0500 Subject: [PATCH 178/223] updates `healthcare` --- ...ce_healthcare_service.go => healthcare_service_data_source.go} | 0 ...e_arm_healthcare_service.go => healthcare_service_resource.go} | 0 ...are_service_test.go => healthcare_service_data_source_test.go} | 0 ...thcare_service_test.go => healthcare_service_resource_test.go} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/healthcare/{data_source_healthcare_service.go => healthcare_service_data_source.go} (100%) rename azurerm/internal/services/healthcare/{resource_arm_healthcare_service.go => healthcare_service_resource.go} (100%) rename azurerm/internal/services/healthcare/tests/{data_source_healthcare_service_test.go => healthcare_service_data_source_test.go} (100%) rename azurerm/internal/services/healthcare/tests/{resource_arm_healthcare_service_test.go => healthcare_service_resource_test.go} (100%) diff --git a/azurerm/internal/services/healthcare/data_source_healthcare_service.go b/azurerm/internal/services/healthcare/healthcare_service_data_source.go similarity index 100% rename from azurerm/internal/services/healthcare/data_source_healthcare_service.go rename to azurerm/internal/services/healthcare/healthcare_service_data_source.go diff --git a/azurerm/internal/services/healthcare/resource_arm_healthcare_service.go b/azurerm/internal/services/healthcare/healthcare_service_resource.go similarity index 100% rename from azurerm/internal/services/healthcare/resource_arm_healthcare_service.go rename to azurerm/internal/services/healthcare/healthcare_service_resource.go diff --git a/azurerm/internal/services/healthcare/tests/data_source_healthcare_service_test.go b/azurerm/internal/services/healthcare/tests/healthcare_service_data_source_test.go similarity index 100% rename from azurerm/internal/services/healthcare/tests/data_source_healthcare_service_test.go rename to azurerm/internal/services/healthcare/tests/healthcare_service_data_source_test.go diff --git a/azurerm/internal/services/healthcare/tests/resource_arm_healthcare_service_test.go b/azurerm/internal/services/healthcare/tests/healthcare_service_resource_test.go similarity index 100% rename from azurerm/internal/services/healthcare/tests/resource_arm_healthcare_service_test.go rename to azurerm/internal/services/healthcare/tests/healthcare_service_resource_test.go From 1d6e773819e26c1bd1050af398e2567c709a6b37 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:39:14 -0500 Subject: [PATCH 179/223] updates `iotcentral` --- ...tcentral_application.go => iotcentral_application_resource.go} | 0 ...pplication_test.go => iotcentral_application_resource_test.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/iotcentral/{resource_arm_iotcentral_application.go => iotcentral_application_resource.go} (100%) rename azurerm/internal/services/iotcentral/tests/{resource_arm_iotcentral_application_test.go => iotcentral_application_resource_test.go} (100%) diff --git a/azurerm/internal/services/iotcentral/resource_arm_iotcentral_application.go b/azurerm/internal/services/iotcentral/iotcentral_application_resource.go similarity index 100% rename from azurerm/internal/services/iotcentral/resource_arm_iotcentral_application.go rename to azurerm/internal/services/iotcentral/iotcentral_application_resource.go diff --git a/azurerm/internal/services/iotcentral/tests/resource_arm_iotcentral_application_test.go b/azurerm/internal/services/iotcentral/tests/iotcentral_application_resource_test.go similarity index 100% rename from azurerm/internal/services/iotcentral/tests/resource_arm_iotcentral_application_test.go rename to azurerm/internal/services/iotcentral/tests/iotcentral_application_resource_test.go From d13dd8083e5b77ad1e70c2e5679bf8d730f9575c Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:39:22 -0500 Subject: [PATCH 180/223] updates `iothub` --- ...iothub_consumer_group.go => iothub_consumer_group_resource.go} | 0 ...thub_dps_certificate.go => iothub_dps_certificate_resource.go} | 0 .../{data_source_iothub_dps.go => iothub_dps_data_source.go} | 0 .../iothub/{resource_arm_iothub_dps.go => iothub_dps_resource.go} | 0 ...s_policy.go => iothub_dps_shared_access_policy_data_source.go} | 0 ...cess_policy.go => iothub_dps_shared_access_policy_resource.go} | 0 ..._endpoint_eventhub.go => iothub_endpoint_eventhub_resource.go} | 0 ...ebus_queue.go => iothub_endpoint_servicebus_queue_resource.go} | 0 ...ebus_topic.go => iothub_endpoint_servicebus_topic_resource.go} | 0 ...container.go => iothub_endpoint_storage_container_resource.go} | 0 ...iothub_fallback_route.go => iothub_fallback_route_resource.go} | 0 .../iothub/{resource_arm_iothub.go => iothub_resource.go} | 0 .../{resource_arm_iothub_route.go => iothub_route_resource.go} | 0 ...ccess_policy.go => iothub_shared_access_policy_data_source.go} | 0 ...d_access_policy.go => iothub_shared_access_policy_resource.go} | 0 ...sumer_group_test.go => iothub_consumer_group_resource_test.go} | 0 ...ertificate_test.go => iothub_dps_certificate_resource_test.go} | 0 ...a_source_iothub_dps_test.go => iothub_dps_data_source_test.go} | 0 ...esource_arm_iothub_dps_test.go => iothub_dps_resource_test.go} | 0 ...est.go => iothub_dps_shared_access_policy_data_source_test.go} | 0 ...y_test.go => iothub_dps_shared_access_policy_resource_test.go} | 0 ...eventhub_test.go => iothub_endpoint_eventhub_resource_test.go} | 0 ..._test.go => iothub_endpoint_servicebus_queue_resource_test.go} | 0 ..._test.go => iothub_endpoint_servicebus_topic_resource_test.go} | 0 ...test.go => iothub_endpoint_storage_container_resource_test.go} | 0 ...lback_route_test.go => iothub_fallback_route_resource_test.go} | 0 .../{resource_arm_iothub_test.go => iothub_resource_test.go} | 0 ...rce_arm_iothub_route_test.go => iothub_route_resource_test.go} | 0 ...cy_test.go => iothub_shared_access_policy_data_source_test.go} | 0 ...olicy_test.go => iothub_shared_access_policy_resource_test.go} | 0 30 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/iothub/{resource_arm_iothub_consumer_group.go => iothub_consumer_group_resource.go} (100%) rename azurerm/internal/services/iothub/{resource_arm_iothub_dps_certificate.go => iothub_dps_certificate_resource.go} (100%) rename azurerm/internal/services/iothub/{data_source_iothub_dps.go => iothub_dps_data_source.go} (100%) rename azurerm/internal/services/iothub/{resource_arm_iothub_dps.go => iothub_dps_resource.go} (100%) rename azurerm/internal/services/iothub/{data_source_iothub_dps_shared_access_policy.go => iothub_dps_shared_access_policy_data_source.go} (100%) rename azurerm/internal/services/iothub/{resource_arm_iothub_dps_shared_access_policy.go => iothub_dps_shared_access_policy_resource.go} (100%) rename azurerm/internal/services/iothub/{resource_arm_iothub_endpoint_eventhub.go => iothub_endpoint_eventhub_resource.go} (100%) rename azurerm/internal/services/iothub/{resource_arm_iothub_endpoint_servicebus_queue.go => iothub_endpoint_servicebus_queue_resource.go} (100%) rename azurerm/internal/services/iothub/{resource_arm_iothub_endpoint_servicebus_topic.go => iothub_endpoint_servicebus_topic_resource.go} (100%) rename azurerm/internal/services/iothub/{resource_arm_iothub_endpoint_storage_container.go => iothub_endpoint_storage_container_resource.go} (100%) rename azurerm/internal/services/iothub/{resource_arm_iothub_fallback_route.go => iothub_fallback_route_resource.go} (100%) rename azurerm/internal/services/iothub/{resource_arm_iothub.go => iothub_resource.go} (100%) rename azurerm/internal/services/iothub/{resource_arm_iothub_route.go => iothub_route_resource.go} (100%) rename azurerm/internal/services/iothub/{data_source_iothub_shared_access_policy.go => iothub_shared_access_policy_data_source.go} (100%) rename azurerm/internal/services/iothub/{resource_arm_iothub_shared_access_policy.go => iothub_shared_access_policy_resource.go} (100%) rename azurerm/internal/services/iothub/tests/{resource_arm_iothub_consumer_group_test.go => iothub_consumer_group_resource_test.go} (100%) rename azurerm/internal/services/iothub/tests/{resource_arm_iothub_dps_certificate_test.go => iothub_dps_certificate_resource_test.go} (100%) rename azurerm/internal/services/iothub/tests/{data_source_iothub_dps_test.go => iothub_dps_data_source_test.go} (100%) rename azurerm/internal/services/iothub/tests/{resource_arm_iothub_dps_test.go => iothub_dps_resource_test.go} (100%) rename azurerm/internal/services/iothub/tests/{data_source_iothub_dps_shared_access_policy_test.go => iothub_dps_shared_access_policy_data_source_test.go} (100%) rename azurerm/internal/services/iothub/tests/{resource_arm_iothub_dps_shared_access_policy_test.go => iothub_dps_shared_access_policy_resource_test.go} (100%) rename azurerm/internal/services/iothub/tests/{resource_arm_iothub_endpoint_eventhub_test.go => iothub_endpoint_eventhub_resource_test.go} (100%) rename azurerm/internal/services/iothub/tests/{resource_arm_iothub_endpoint_servicebus_queue_test.go => iothub_endpoint_servicebus_queue_resource_test.go} (100%) rename azurerm/internal/services/iothub/tests/{resource_arm_iothub_endpoint_servicebus_topic_test.go => iothub_endpoint_servicebus_topic_resource_test.go} (100%) rename azurerm/internal/services/iothub/tests/{resource_arm_iothub_endpoint_storage_container_test.go => iothub_endpoint_storage_container_resource_test.go} (100%) rename azurerm/internal/services/iothub/tests/{resource_arm_iothub_fallback_route_test.go => iothub_fallback_route_resource_test.go} (100%) rename azurerm/internal/services/iothub/tests/{resource_arm_iothub_test.go => iothub_resource_test.go} (100%) rename azurerm/internal/services/iothub/tests/{resource_arm_iothub_route_test.go => iothub_route_resource_test.go} (100%) rename azurerm/internal/services/iothub/tests/{data_source_iothub_shared_access_policy_test.go => iothub_shared_access_policy_data_source_test.go} (100%) rename azurerm/internal/services/iothub/tests/{resource_arm_iothub_shared_access_policy_test.go => iothub_shared_access_policy_resource_test.go} (100%) diff --git a/azurerm/internal/services/iothub/resource_arm_iothub_consumer_group.go b/azurerm/internal/services/iothub/iothub_consumer_group_resource.go similarity index 100% rename from azurerm/internal/services/iothub/resource_arm_iothub_consumer_group.go rename to azurerm/internal/services/iothub/iothub_consumer_group_resource.go diff --git a/azurerm/internal/services/iothub/resource_arm_iothub_dps_certificate.go b/azurerm/internal/services/iothub/iothub_dps_certificate_resource.go similarity index 100% rename from azurerm/internal/services/iothub/resource_arm_iothub_dps_certificate.go rename to azurerm/internal/services/iothub/iothub_dps_certificate_resource.go diff --git a/azurerm/internal/services/iothub/data_source_iothub_dps.go b/azurerm/internal/services/iothub/iothub_dps_data_source.go similarity index 100% rename from azurerm/internal/services/iothub/data_source_iothub_dps.go rename to azurerm/internal/services/iothub/iothub_dps_data_source.go diff --git a/azurerm/internal/services/iothub/resource_arm_iothub_dps.go b/azurerm/internal/services/iothub/iothub_dps_resource.go similarity index 100% rename from azurerm/internal/services/iothub/resource_arm_iothub_dps.go rename to azurerm/internal/services/iothub/iothub_dps_resource.go diff --git a/azurerm/internal/services/iothub/data_source_iothub_dps_shared_access_policy.go b/azurerm/internal/services/iothub/iothub_dps_shared_access_policy_data_source.go similarity index 100% rename from azurerm/internal/services/iothub/data_source_iothub_dps_shared_access_policy.go rename to azurerm/internal/services/iothub/iothub_dps_shared_access_policy_data_source.go diff --git a/azurerm/internal/services/iothub/resource_arm_iothub_dps_shared_access_policy.go b/azurerm/internal/services/iothub/iothub_dps_shared_access_policy_resource.go similarity index 100% rename from azurerm/internal/services/iothub/resource_arm_iothub_dps_shared_access_policy.go rename to azurerm/internal/services/iothub/iothub_dps_shared_access_policy_resource.go diff --git a/azurerm/internal/services/iothub/resource_arm_iothub_endpoint_eventhub.go b/azurerm/internal/services/iothub/iothub_endpoint_eventhub_resource.go similarity index 100% rename from azurerm/internal/services/iothub/resource_arm_iothub_endpoint_eventhub.go rename to azurerm/internal/services/iothub/iothub_endpoint_eventhub_resource.go diff --git a/azurerm/internal/services/iothub/resource_arm_iothub_endpoint_servicebus_queue.go b/azurerm/internal/services/iothub/iothub_endpoint_servicebus_queue_resource.go similarity index 100% rename from azurerm/internal/services/iothub/resource_arm_iothub_endpoint_servicebus_queue.go rename to azurerm/internal/services/iothub/iothub_endpoint_servicebus_queue_resource.go diff --git a/azurerm/internal/services/iothub/resource_arm_iothub_endpoint_servicebus_topic.go b/azurerm/internal/services/iothub/iothub_endpoint_servicebus_topic_resource.go similarity index 100% rename from azurerm/internal/services/iothub/resource_arm_iothub_endpoint_servicebus_topic.go rename to azurerm/internal/services/iothub/iothub_endpoint_servicebus_topic_resource.go diff --git a/azurerm/internal/services/iothub/resource_arm_iothub_endpoint_storage_container.go b/azurerm/internal/services/iothub/iothub_endpoint_storage_container_resource.go similarity index 100% rename from azurerm/internal/services/iothub/resource_arm_iothub_endpoint_storage_container.go rename to azurerm/internal/services/iothub/iothub_endpoint_storage_container_resource.go diff --git a/azurerm/internal/services/iothub/resource_arm_iothub_fallback_route.go b/azurerm/internal/services/iothub/iothub_fallback_route_resource.go similarity index 100% rename from azurerm/internal/services/iothub/resource_arm_iothub_fallback_route.go rename to azurerm/internal/services/iothub/iothub_fallback_route_resource.go diff --git a/azurerm/internal/services/iothub/resource_arm_iothub.go b/azurerm/internal/services/iothub/iothub_resource.go similarity index 100% rename from azurerm/internal/services/iothub/resource_arm_iothub.go rename to azurerm/internal/services/iothub/iothub_resource.go diff --git a/azurerm/internal/services/iothub/resource_arm_iothub_route.go b/azurerm/internal/services/iothub/iothub_route_resource.go similarity index 100% rename from azurerm/internal/services/iothub/resource_arm_iothub_route.go rename to azurerm/internal/services/iothub/iothub_route_resource.go diff --git a/azurerm/internal/services/iothub/data_source_iothub_shared_access_policy.go b/azurerm/internal/services/iothub/iothub_shared_access_policy_data_source.go similarity index 100% rename from azurerm/internal/services/iothub/data_source_iothub_shared_access_policy.go rename to azurerm/internal/services/iothub/iothub_shared_access_policy_data_source.go diff --git a/azurerm/internal/services/iothub/resource_arm_iothub_shared_access_policy.go b/azurerm/internal/services/iothub/iothub_shared_access_policy_resource.go similarity index 100% rename from azurerm/internal/services/iothub/resource_arm_iothub_shared_access_policy.go rename to azurerm/internal/services/iothub/iothub_shared_access_policy_resource.go diff --git a/azurerm/internal/services/iothub/tests/resource_arm_iothub_consumer_group_test.go b/azurerm/internal/services/iothub/tests/iothub_consumer_group_resource_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/resource_arm_iothub_consumer_group_test.go rename to azurerm/internal/services/iothub/tests/iothub_consumer_group_resource_test.go diff --git a/azurerm/internal/services/iothub/tests/resource_arm_iothub_dps_certificate_test.go b/azurerm/internal/services/iothub/tests/iothub_dps_certificate_resource_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/resource_arm_iothub_dps_certificate_test.go rename to azurerm/internal/services/iothub/tests/iothub_dps_certificate_resource_test.go diff --git a/azurerm/internal/services/iothub/tests/data_source_iothub_dps_test.go b/azurerm/internal/services/iothub/tests/iothub_dps_data_source_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/data_source_iothub_dps_test.go rename to azurerm/internal/services/iothub/tests/iothub_dps_data_source_test.go diff --git a/azurerm/internal/services/iothub/tests/resource_arm_iothub_dps_test.go b/azurerm/internal/services/iothub/tests/iothub_dps_resource_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/resource_arm_iothub_dps_test.go rename to azurerm/internal/services/iothub/tests/iothub_dps_resource_test.go diff --git a/azurerm/internal/services/iothub/tests/data_source_iothub_dps_shared_access_policy_test.go b/azurerm/internal/services/iothub/tests/iothub_dps_shared_access_policy_data_source_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/data_source_iothub_dps_shared_access_policy_test.go rename to azurerm/internal/services/iothub/tests/iothub_dps_shared_access_policy_data_source_test.go diff --git a/azurerm/internal/services/iothub/tests/resource_arm_iothub_dps_shared_access_policy_test.go b/azurerm/internal/services/iothub/tests/iothub_dps_shared_access_policy_resource_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/resource_arm_iothub_dps_shared_access_policy_test.go rename to azurerm/internal/services/iothub/tests/iothub_dps_shared_access_policy_resource_test.go diff --git a/azurerm/internal/services/iothub/tests/resource_arm_iothub_endpoint_eventhub_test.go b/azurerm/internal/services/iothub/tests/iothub_endpoint_eventhub_resource_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/resource_arm_iothub_endpoint_eventhub_test.go rename to azurerm/internal/services/iothub/tests/iothub_endpoint_eventhub_resource_test.go diff --git a/azurerm/internal/services/iothub/tests/resource_arm_iothub_endpoint_servicebus_queue_test.go b/azurerm/internal/services/iothub/tests/iothub_endpoint_servicebus_queue_resource_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/resource_arm_iothub_endpoint_servicebus_queue_test.go rename to azurerm/internal/services/iothub/tests/iothub_endpoint_servicebus_queue_resource_test.go diff --git a/azurerm/internal/services/iothub/tests/resource_arm_iothub_endpoint_servicebus_topic_test.go b/azurerm/internal/services/iothub/tests/iothub_endpoint_servicebus_topic_resource_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/resource_arm_iothub_endpoint_servicebus_topic_test.go rename to azurerm/internal/services/iothub/tests/iothub_endpoint_servicebus_topic_resource_test.go diff --git a/azurerm/internal/services/iothub/tests/resource_arm_iothub_endpoint_storage_container_test.go b/azurerm/internal/services/iothub/tests/iothub_endpoint_storage_container_resource_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/resource_arm_iothub_endpoint_storage_container_test.go rename to azurerm/internal/services/iothub/tests/iothub_endpoint_storage_container_resource_test.go diff --git a/azurerm/internal/services/iothub/tests/resource_arm_iothub_fallback_route_test.go b/azurerm/internal/services/iothub/tests/iothub_fallback_route_resource_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/resource_arm_iothub_fallback_route_test.go rename to azurerm/internal/services/iothub/tests/iothub_fallback_route_resource_test.go diff --git a/azurerm/internal/services/iothub/tests/resource_arm_iothub_test.go b/azurerm/internal/services/iothub/tests/iothub_resource_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/resource_arm_iothub_test.go rename to azurerm/internal/services/iothub/tests/iothub_resource_test.go diff --git a/azurerm/internal/services/iothub/tests/resource_arm_iothub_route_test.go b/azurerm/internal/services/iothub/tests/iothub_route_resource_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/resource_arm_iothub_route_test.go rename to azurerm/internal/services/iothub/tests/iothub_route_resource_test.go diff --git a/azurerm/internal/services/iothub/tests/data_source_iothub_shared_access_policy_test.go b/azurerm/internal/services/iothub/tests/iothub_shared_access_policy_data_source_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/data_source_iothub_shared_access_policy_test.go rename to azurerm/internal/services/iothub/tests/iothub_shared_access_policy_data_source_test.go diff --git a/azurerm/internal/services/iothub/tests/resource_arm_iothub_shared_access_policy_test.go b/azurerm/internal/services/iothub/tests/iothub_shared_access_policy_resource_test.go similarity index 100% rename from azurerm/internal/services/iothub/tests/resource_arm_iothub_shared_access_policy_test.go rename to azurerm/internal/services/iothub/tests/iothub_shared_access_policy_resource_test.go From b15e52cebdd69c72050ed9830e6bb4e4bf44f4f3 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:39:31 -0500 Subject: [PATCH 181/223] Updates `keyvault` --- ...lt_access_policy.go => key_vault_access_policy_data_source.go} | 0 ...vault_access_policy.go => key_vault_access_policy_resource.go} | 0 ...key_vault_certificate.go => key_vault_certificate_resource.go} | 0 .../{data_source_key_vault.go => key_vault_data_source.go} | 0 ...{data_source_key_vault_key.go => key_vault_key_data_source.go} | 0 .../{resource_arm_key_vault_key.go => key_vault_key_resource.go} | 0 ...arm_key_vault_migration.go => key_vault_migration_resource.go} | 0 ...ult_migration_test.go => key_vault_migration_test_resource.go} | 0 .../keyvault/{resource_arm_key_vault.go => key_vault_resource.go} | 0 ...source_key_vault_secret.go => key_vault_secret_data_source.go} | 0 ...ource_arm_key_vault_secret.go => key_vault_secret_resource.go} | 0 ...policy_test.go => key_vault_access_policy_data_source_test.go} | 0 ...ss_policy_test.go => key_vault_access_policy_resource_test.go} | 0 ...certificate_test.go => key_vault_certificate_resource_test.go} | 0 ...ata_source_key_vault_test.go => key_vault_data_source_test.go} | 0 ...ce_key_vault_key_test.go => key_vault_key_data_source_test.go} | 0 ...e_arm_key_vault_key_test.go => key_vault_key_resource_test.go} | 0 ...{resource_arm_key_vault_test.go => key_vault_resource_test.go} | 0 ..._vault_secret_test.go => key_vault_secret_data_source_test.go} | 0 ...key_vault_secret_test.go => key_vault_secret_resource_test.go} | 0 20 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/keyvault/{data_source_key_vault_access_policy.go => key_vault_access_policy_data_source.go} (100%) rename azurerm/internal/services/keyvault/{resource_arm_key_vault_access_policy.go => key_vault_access_policy_resource.go} (100%) rename azurerm/internal/services/keyvault/{resource_arm_key_vault_certificate.go => key_vault_certificate_resource.go} (100%) rename azurerm/internal/services/keyvault/{data_source_key_vault.go => key_vault_data_source.go} (100%) rename azurerm/internal/services/keyvault/{data_source_key_vault_key.go => key_vault_key_data_source.go} (100%) rename azurerm/internal/services/keyvault/{resource_arm_key_vault_key.go => key_vault_key_resource.go} (100%) rename azurerm/internal/services/keyvault/{resource_arm_key_vault_migration.go => key_vault_migration_resource.go} (100%) rename azurerm/internal/services/keyvault/{resource_arm_key_vault_migration_test.go => key_vault_migration_test_resource.go} (100%) rename azurerm/internal/services/keyvault/{resource_arm_key_vault.go => key_vault_resource.go} (100%) rename azurerm/internal/services/keyvault/{data_source_key_vault_secret.go => key_vault_secret_data_source.go} (100%) rename azurerm/internal/services/keyvault/{resource_arm_key_vault_secret.go => key_vault_secret_resource.go} (100%) rename azurerm/internal/services/keyvault/tests/{data_source_key_vault_access_policy_test.go => key_vault_access_policy_data_source_test.go} (100%) rename azurerm/internal/services/keyvault/tests/{resource_arm_key_vault_access_policy_test.go => key_vault_access_policy_resource_test.go} (100%) rename azurerm/internal/services/keyvault/tests/{resource_arm_key_vault_certificate_test.go => key_vault_certificate_resource_test.go} (100%) rename azurerm/internal/services/keyvault/tests/{data_source_key_vault_test.go => key_vault_data_source_test.go} (100%) rename azurerm/internal/services/keyvault/tests/{data_source_key_vault_key_test.go => key_vault_key_data_source_test.go} (100%) rename azurerm/internal/services/keyvault/tests/{resource_arm_key_vault_key_test.go => key_vault_key_resource_test.go} (100%) rename azurerm/internal/services/keyvault/tests/{resource_arm_key_vault_test.go => key_vault_resource_test.go} (100%) rename azurerm/internal/services/keyvault/tests/{data_source_key_vault_secret_test.go => key_vault_secret_data_source_test.go} (100%) rename azurerm/internal/services/keyvault/tests/{resource_arm_key_vault_secret_test.go => key_vault_secret_resource_test.go} (100%) diff --git a/azurerm/internal/services/keyvault/data_source_key_vault_access_policy.go b/azurerm/internal/services/keyvault/key_vault_access_policy_data_source.go similarity index 100% rename from azurerm/internal/services/keyvault/data_source_key_vault_access_policy.go rename to azurerm/internal/services/keyvault/key_vault_access_policy_data_source.go diff --git a/azurerm/internal/services/keyvault/resource_arm_key_vault_access_policy.go b/azurerm/internal/services/keyvault/key_vault_access_policy_resource.go similarity index 100% rename from azurerm/internal/services/keyvault/resource_arm_key_vault_access_policy.go rename to azurerm/internal/services/keyvault/key_vault_access_policy_resource.go diff --git a/azurerm/internal/services/keyvault/resource_arm_key_vault_certificate.go b/azurerm/internal/services/keyvault/key_vault_certificate_resource.go similarity index 100% rename from azurerm/internal/services/keyvault/resource_arm_key_vault_certificate.go rename to azurerm/internal/services/keyvault/key_vault_certificate_resource.go diff --git a/azurerm/internal/services/keyvault/data_source_key_vault.go b/azurerm/internal/services/keyvault/key_vault_data_source.go similarity index 100% rename from azurerm/internal/services/keyvault/data_source_key_vault.go rename to azurerm/internal/services/keyvault/key_vault_data_source.go diff --git a/azurerm/internal/services/keyvault/data_source_key_vault_key.go b/azurerm/internal/services/keyvault/key_vault_key_data_source.go similarity index 100% rename from azurerm/internal/services/keyvault/data_source_key_vault_key.go rename to azurerm/internal/services/keyvault/key_vault_key_data_source.go diff --git a/azurerm/internal/services/keyvault/resource_arm_key_vault_key.go b/azurerm/internal/services/keyvault/key_vault_key_resource.go similarity index 100% rename from azurerm/internal/services/keyvault/resource_arm_key_vault_key.go rename to azurerm/internal/services/keyvault/key_vault_key_resource.go diff --git a/azurerm/internal/services/keyvault/resource_arm_key_vault_migration.go b/azurerm/internal/services/keyvault/key_vault_migration_resource.go similarity index 100% rename from azurerm/internal/services/keyvault/resource_arm_key_vault_migration.go rename to azurerm/internal/services/keyvault/key_vault_migration_resource.go diff --git a/azurerm/internal/services/keyvault/resource_arm_key_vault_migration_test.go b/azurerm/internal/services/keyvault/key_vault_migration_test_resource.go similarity index 100% rename from azurerm/internal/services/keyvault/resource_arm_key_vault_migration_test.go rename to azurerm/internal/services/keyvault/key_vault_migration_test_resource.go diff --git a/azurerm/internal/services/keyvault/resource_arm_key_vault.go b/azurerm/internal/services/keyvault/key_vault_resource.go similarity index 100% rename from azurerm/internal/services/keyvault/resource_arm_key_vault.go rename to azurerm/internal/services/keyvault/key_vault_resource.go diff --git a/azurerm/internal/services/keyvault/data_source_key_vault_secret.go b/azurerm/internal/services/keyvault/key_vault_secret_data_source.go similarity index 100% rename from azurerm/internal/services/keyvault/data_source_key_vault_secret.go rename to azurerm/internal/services/keyvault/key_vault_secret_data_source.go diff --git a/azurerm/internal/services/keyvault/resource_arm_key_vault_secret.go b/azurerm/internal/services/keyvault/key_vault_secret_resource.go similarity index 100% rename from azurerm/internal/services/keyvault/resource_arm_key_vault_secret.go rename to azurerm/internal/services/keyvault/key_vault_secret_resource.go diff --git a/azurerm/internal/services/keyvault/tests/data_source_key_vault_access_policy_test.go b/azurerm/internal/services/keyvault/tests/key_vault_access_policy_data_source_test.go similarity index 100% rename from azurerm/internal/services/keyvault/tests/data_source_key_vault_access_policy_test.go rename to azurerm/internal/services/keyvault/tests/key_vault_access_policy_data_source_test.go diff --git a/azurerm/internal/services/keyvault/tests/resource_arm_key_vault_access_policy_test.go b/azurerm/internal/services/keyvault/tests/key_vault_access_policy_resource_test.go similarity index 100% rename from azurerm/internal/services/keyvault/tests/resource_arm_key_vault_access_policy_test.go rename to azurerm/internal/services/keyvault/tests/key_vault_access_policy_resource_test.go diff --git a/azurerm/internal/services/keyvault/tests/resource_arm_key_vault_certificate_test.go b/azurerm/internal/services/keyvault/tests/key_vault_certificate_resource_test.go similarity index 100% rename from azurerm/internal/services/keyvault/tests/resource_arm_key_vault_certificate_test.go rename to azurerm/internal/services/keyvault/tests/key_vault_certificate_resource_test.go diff --git a/azurerm/internal/services/keyvault/tests/data_source_key_vault_test.go b/azurerm/internal/services/keyvault/tests/key_vault_data_source_test.go similarity index 100% rename from azurerm/internal/services/keyvault/tests/data_source_key_vault_test.go rename to azurerm/internal/services/keyvault/tests/key_vault_data_source_test.go diff --git a/azurerm/internal/services/keyvault/tests/data_source_key_vault_key_test.go b/azurerm/internal/services/keyvault/tests/key_vault_key_data_source_test.go similarity index 100% rename from azurerm/internal/services/keyvault/tests/data_source_key_vault_key_test.go rename to azurerm/internal/services/keyvault/tests/key_vault_key_data_source_test.go diff --git a/azurerm/internal/services/keyvault/tests/resource_arm_key_vault_key_test.go b/azurerm/internal/services/keyvault/tests/key_vault_key_resource_test.go similarity index 100% rename from azurerm/internal/services/keyvault/tests/resource_arm_key_vault_key_test.go rename to azurerm/internal/services/keyvault/tests/key_vault_key_resource_test.go diff --git a/azurerm/internal/services/keyvault/tests/resource_arm_key_vault_test.go b/azurerm/internal/services/keyvault/tests/key_vault_resource_test.go similarity index 100% rename from azurerm/internal/services/keyvault/tests/resource_arm_key_vault_test.go rename to azurerm/internal/services/keyvault/tests/key_vault_resource_test.go diff --git a/azurerm/internal/services/keyvault/tests/data_source_key_vault_secret_test.go b/azurerm/internal/services/keyvault/tests/key_vault_secret_data_source_test.go similarity index 100% rename from azurerm/internal/services/keyvault/tests/data_source_key_vault_secret_test.go rename to azurerm/internal/services/keyvault/tests/key_vault_secret_data_source_test.go diff --git a/azurerm/internal/services/keyvault/tests/resource_arm_key_vault_secret_test.go b/azurerm/internal/services/keyvault/tests/key_vault_secret_resource_test.go similarity index 100% rename from azurerm/internal/services/keyvault/tests/resource_arm_key_vault_secret_test.go rename to azurerm/internal/services/keyvault/tests/key_vault_secret_resource_test.go From bece6791be800b15d0f3179e55fd1afc88f79a7f Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:39:39 -0500 Subject: [PATCH 182/223] updates `kusto` --- ...{data_source_kusto_cluster.go => kusto_cluster_data_source.go} | 0 .../{resource_arm_kusto_cluster.go => kusto_cluster_resource.go} | 0 ...database_principal.go => kusto_database_principal_resource.go} | 0 ...{resource_arm_kusto_database.go => kusto_database_resource.go} | 0 ...a_connection.go => kusto_eventhub_data_connection_resource.go} | 0 ...ce_kusto_cluster_test.go => kusto_cluster_data_source_test.go} | 0 ...e_arm_kusto_cluster_test.go => kusto_cluster_resource_test.go} | 0 ...rincipal_test.go => kusto_database_principal_resource_test.go} | 0 ...arm_kusto_database_test.go => kusto_database_resource_test.go} | 0 ...on_test.go => kusto_eventhub_data_connection_resource_test.go} | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/kusto/{data_source_kusto_cluster.go => kusto_cluster_data_source.go} (100%) rename azurerm/internal/services/kusto/{resource_arm_kusto_cluster.go => kusto_cluster_resource.go} (100%) rename azurerm/internal/services/kusto/{resource_arm_kusto_database_principal.go => kusto_database_principal_resource.go} (100%) rename azurerm/internal/services/kusto/{resource_arm_kusto_database.go => kusto_database_resource.go} (100%) rename azurerm/internal/services/kusto/{resource_arm_kusto_eventhub_data_connection.go => kusto_eventhub_data_connection_resource.go} (100%) rename azurerm/internal/services/kusto/tests/{data_source_kusto_cluster_test.go => kusto_cluster_data_source_test.go} (100%) rename azurerm/internal/services/kusto/tests/{resource_arm_kusto_cluster_test.go => kusto_cluster_resource_test.go} (100%) rename azurerm/internal/services/kusto/tests/{resource_arm_kusto_database_principal_test.go => kusto_database_principal_resource_test.go} (100%) rename azurerm/internal/services/kusto/tests/{resource_arm_kusto_database_test.go => kusto_database_resource_test.go} (100%) rename azurerm/internal/services/kusto/tests/{resource_arm_kusto_eventhub_data_connection_test.go => kusto_eventhub_data_connection_resource_test.go} (100%) diff --git a/azurerm/internal/services/kusto/data_source_kusto_cluster.go b/azurerm/internal/services/kusto/kusto_cluster_data_source.go similarity index 100% rename from azurerm/internal/services/kusto/data_source_kusto_cluster.go rename to azurerm/internal/services/kusto/kusto_cluster_data_source.go diff --git a/azurerm/internal/services/kusto/resource_arm_kusto_cluster.go b/azurerm/internal/services/kusto/kusto_cluster_resource.go similarity index 100% rename from azurerm/internal/services/kusto/resource_arm_kusto_cluster.go rename to azurerm/internal/services/kusto/kusto_cluster_resource.go diff --git a/azurerm/internal/services/kusto/resource_arm_kusto_database_principal.go b/azurerm/internal/services/kusto/kusto_database_principal_resource.go similarity index 100% rename from azurerm/internal/services/kusto/resource_arm_kusto_database_principal.go rename to azurerm/internal/services/kusto/kusto_database_principal_resource.go diff --git a/azurerm/internal/services/kusto/resource_arm_kusto_database.go b/azurerm/internal/services/kusto/kusto_database_resource.go similarity index 100% rename from azurerm/internal/services/kusto/resource_arm_kusto_database.go rename to azurerm/internal/services/kusto/kusto_database_resource.go diff --git a/azurerm/internal/services/kusto/resource_arm_kusto_eventhub_data_connection.go b/azurerm/internal/services/kusto/kusto_eventhub_data_connection_resource.go similarity index 100% rename from azurerm/internal/services/kusto/resource_arm_kusto_eventhub_data_connection.go rename to azurerm/internal/services/kusto/kusto_eventhub_data_connection_resource.go diff --git a/azurerm/internal/services/kusto/tests/data_source_kusto_cluster_test.go b/azurerm/internal/services/kusto/tests/kusto_cluster_data_source_test.go similarity index 100% rename from azurerm/internal/services/kusto/tests/data_source_kusto_cluster_test.go rename to azurerm/internal/services/kusto/tests/kusto_cluster_data_source_test.go diff --git a/azurerm/internal/services/kusto/tests/resource_arm_kusto_cluster_test.go b/azurerm/internal/services/kusto/tests/kusto_cluster_resource_test.go similarity index 100% rename from azurerm/internal/services/kusto/tests/resource_arm_kusto_cluster_test.go rename to azurerm/internal/services/kusto/tests/kusto_cluster_resource_test.go diff --git a/azurerm/internal/services/kusto/tests/resource_arm_kusto_database_principal_test.go b/azurerm/internal/services/kusto/tests/kusto_database_principal_resource_test.go similarity index 100% rename from azurerm/internal/services/kusto/tests/resource_arm_kusto_database_principal_test.go rename to azurerm/internal/services/kusto/tests/kusto_database_principal_resource_test.go diff --git a/azurerm/internal/services/kusto/tests/resource_arm_kusto_database_test.go b/azurerm/internal/services/kusto/tests/kusto_database_resource_test.go similarity index 100% rename from azurerm/internal/services/kusto/tests/resource_arm_kusto_database_test.go rename to azurerm/internal/services/kusto/tests/kusto_database_resource_test.go diff --git a/azurerm/internal/services/kusto/tests/resource_arm_kusto_eventhub_data_connection_test.go b/azurerm/internal/services/kusto/tests/kusto_eventhub_data_connection_resource_test.go similarity index 100% rename from azurerm/internal/services/kusto/tests/resource_arm_kusto_eventhub_data_connection_test.go rename to azurerm/internal/services/kusto/tests/kusto_eventhub_data_connection_resource_test.go From 2190ef8a97d4a1e9fe63e2bf9b2bb8c6546ddffd Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:39:48 -0500 Subject: [PATCH 183/223] updates `loganalytics` --- ...vent.go => log_analytics_datasource_windows_event_resource.go} | 0 ..._analytics_datasource_windows_performance_counter_resource.go} | 0 ...linked_service.go => log_analytics_linked_service_resource.go} | 0 ...g_analytics_solution.go => log_analytics_solution_resource.go} | 0 ...lytics_workspace.go => log_analytics_workspace_data_source.go} | 0 ...analytics_workspace.go => log_analytics_workspace_resource.go} | 0 ...go => log_analytics_datasource_windows_event_resource_test.go} | 0 ...ytics_datasource_windows_performance_counter_resource_test.go} | 0 ...vice_test.go => log_analytics_linked_service_resource_test.go} | 0 ...s_solution_test.go => log_analytics_solution_resource_test.go} | 0 ...kspace_test.go => log_analytics_workspace_data_source_test.go} | 0 ...workspace_test.go => log_analytics_workspace_resource_test.go} | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/loganalytics/{resource_arm_log_analytics_datasource_windows_event.go => log_analytics_datasource_windows_event_resource.go} (100%) rename azurerm/internal/services/loganalytics/{resource_arm_log_analytics_datasource_windows_performance_counter.go => log_analytics_datasource_windows_performance_counter_resource.go} (100%) rename azurerm/internal/services/loganalytics/{resource_arm_log_analytics_linked_service.go => log_analytics_linked_service_resource.go} (100%) rename azurerm/internal/services/loganalytics/{resource_arm_log_analytics_solution.go => log_analytics_solution_resource.go} (100%) rename azurerm/internal/services/loganalytics/{data_source_log_analytics_workspace.go => log_analytics_workspace_data_source.go} (100%) rename azurerm/internal/services/loganalytics/{resource_arm_log_analytics_workspace.go => log_analytics_workspace_resource.go} (100%) rename azurerm/internal/services/loganalytics/tests/{resource_arm_log_analytics_datasource_windows_event_test.go => log_analytics_datasource_windows_event_resource_test.go} (100%) rename azurerm/internal/services/loganalytics/tests/{resource_arm_log_analytics_datasource_windows_performance_counter_test.go => log_analytics_datasource_windows_performance_counter_resource_test.go} (100%) rename azurerm/internal/services/loganalytics/tests/{resource_arm_log_analytics_linked_service_test.go => log_analytics_linked_service_resource_test.go} (100%) rename azurerm/internal/services/loganalytics/tests/{resource_arm_log_analytics_solution_test.go => log_analytics_solution_resource_test.go} (100%) rename azurerm/internal/services/loganalytics/tests/{data_source_log_analytics_workspace_test.go => log_analytics_workspace_data_source_test.go} (100%) rename azurerm/internal/services/loganalytics/tests/{resource_arm_log_analytics_workspace_test.go => log_analytics_workspace_resource_test.go} (100%) diff --git a/azurerm/internal/services/loganalytics/resource_arm_log_analytics_datasource_windows_event.go b/azurerm/internal/services/loganalytics/log_analytics_datasource_windows_event_resource.go similarity index 100% rename from azurerm/internal/services/loganalytics/resource_arm_log_analytics_datasource_windows_event.go rename to azurerm/internal/services/loganalytics/log_analytics_datasource_windows_event_resource.go diff --git a/azurerm/internal/services/loganalytics/resource_arm_log_analytics_datasource_windows_performance_counter.go b/azurerm/internal/services/loganalytics/log_analytics_datasource_windows_performance_counter_resource.go similarity index 100% rename from azurerm/internal/services/loganalytics/resource_arm_log_analytics_datasource_windows_performance_counter.go rename to azurerm/internal/services/loganalytics/log_analytics_datasource_windows_performance_counter_resource.go diff --git a/azurerm/internal/services/loganalytics/resource_arm_log_analytics_linked_service.go b/azurerm/internal/services/loganalytics/log_analytics_linked_service_resource.go similarity index 100% rename from azurerm/internal/services/loganalytics/resource_arm_log_analytics_linked_service.go rename to azurerm/internal/services/loganalytics/log_analytics_linked_service_resource.go diff --git a/azurerm/internal/services/loganalytics/resource_arm_log_analytics_solution.go b/azurerm/internal/services/loganalytics/log_analytics_solution_resource.go similarity index 100% rename from azurerm/internal/services/loganalytics/resource_arm_log_analytics_solution.go rename to azurerm/internal/services/loganalytics/log_analytics_solution_resource.go diff --git a/azurerm/internal/services/loganalytics/data_source_log_analytics_workspace.go b/azurerm/internal/services/loganalytics/log_analytics_workspace_data_source.go similarity index 100% rename from azurerm/internal/services/loganalytics/data_source_log_analytics_workspace.go rename to azurerm/internal/services/loganalytics/log_analytics_workspace_data_source.go diff --git a/azurerm/internal/services/loganalytics/resource_arm_log_analytics_workspace.go b/azurerm/internal/services/loganalytics/log_analytics_workspace_resource.go similarity index 100% rename from azurerm/internal/services/loganalytics/resource_arm_log_analytics_workspace.go rename to azurerm/internal/services/loganalytics/log_analytics_workspace_resource.go diff --git a/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_datasource_windows_event_test.go b/azurerm/internal/services/loganalytics/tests/log_analytics_datasource_windows_event_resource_test.go similarity index 100% rename from azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_datasource_windows_event_test.go rename to azurerm/internal/services/loganalytics/tests/log_analytics_datasource_windows_event_resource_test.go diff --git a/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_datasource_windows_performance_counter_test.go b/azurerm/internal/services/loganalytics/tests/log_analytics_datasource_windows_performance_counter_resource_test.go similarity index 100% rename from azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_datasource_windows_performance_counter_test.go rename to azurerm/internal/services/loganalytics/tests/log_analytics_datasource_windows_performance_counter_resource_test.go diff --git a/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_linked_service_test.go b/azurerm/internal/services/loganalytics/tests/log_analytics_linked_service_resource_test.go similarity index 100% rename from azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_linked_service_test.go rename to azurerm/internal/services/loganalytics/tests/log_analytics_linked_service_resource_test.go diff --git a/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_solution_test.go b/azurerm/internal/services/loganalytics/tests/log_analytics_solution_resource_test.go similarity index 100% rename from azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_solution_test.go rename to azurerm/internal/services/loganalytics/tests/log_analytics_solution_resource_test.go diff --git a/azurerm/internal/services/loganalytics/tests/data_source_log_analytics_workspace_test.go b/azurerm/internal/services/loganalytics/tests/log_analytics_workspace_data_source_test.go similarity index 100% rename from azurerm/internal/services/loganalytics/tests/data_source_log_analytics_workspace_test.go rename to azurerm/internal/services/loganalytics/tests/log_analytics_workspace_data_source_test.go diff --git a/azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_workspace_test.go b/azurerm/internal/services/loganalytics/tests/log_analytics_workspace_resource_test.go similarity index 100% rename from azurerm/internal/services/loganalytics/tests/resource_arm_log_analytics_workspace_test.go rename to azurerm/internal/services/loganalytics/tests/log_analytics_workspace_resource_test.go From ee0a728c0990f2be6ce04988a8b3c3076703168e Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:39:55 -0500 Subject: [PATCH 184/223] updates `logic` --- ...c_app_action_custom.go => logic_app_action_custom_resource.go} | 0 ...logic_app_action_http.go => logic_app_action_http_resource.go} | 0 ...app_trigger_custom.go => logic_app_trigger_custom_resource.go} | 0 ...http_request.go => logic_app_trigger_http_request_resource.go} | 0 ...ger_recurrence.go => logic_app_trigger_recurrence_resource.go} | 0 ...ce_logic_app_workflow.go => logic_app_workflow_data_source.go} | 0 ...e_arm_logic_app_workflow.go => logic_app_workflow_resource.go} | 0 ...on_custom_test.go => logic_app_action_custom_resource_test.go} | 0 ...action_http_test.go => logic_app_action_http_resource_test.go} | 0 ...r_custom_test.go => logic_app_trigger_custom_resource_test.go} | 0 ...st_test.go => logic_app_trigger_http_request_resource_test.go} | 0 ...ence_test.go => logic_app_trigger_recurrence_resource_test.go} | 0 ...pp_workflow_test.go => logic_app_workflow_data_source_test.go} | 0 ...c_app_workflow_test.go => logic_app_workflow_resource_test.go} | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/logic/{resource_arm_logic_app_action_custom.go => logic_app_action_custom_resource.go} (100%) rename azurerm/internal/services/logic/{resource_arm_logic_app_action_http.go => logic_app_action_http_resource.go} (100%) rename azurerm/internal/services/logic/{resource_arm_logic_app_trigger_custom.go => logic_app_trigger_custom_resource.go} (100%) rename azurerm/internal/services/logic/{resource_arm_logic_app_trigger_http_request.go => logic_app_trigger_http_request_resource.go} (100%) rename azurerm/internal/services/logic/{resource_arm_logic_app_trigger_recurrence.go => logic_app_trigger_recurrence_resource.go} (100%) rename azurerm/internal/services/logic/{data_source_logic_app_workflow.go => logic_app_workflow_data_source.go} (100%) rename azurerm/internal/services/logic/{resource_arm_logic_app_workflow.go => logic_app_workflow_resource.go} (100%) rename azurerm/internal/services/logic/tests/{resource_arm_logic_app_action_custom_test.go => logic_app_action_custom_resource_test.go} (100%) rename azurerm/internal/services/logic/tests/{resource_arm_logic_app_action_http_test.go => logic_app_action_http_resource_test.go} (100%) rename azurerm/internal/services/logic/tests/{resource_arm_logic_app_trigger_custom_test.go => logic_app_trigger_custom_resource_test.go} (100%) rename azurerm/internal/services/logic/tests/{resource_arm_logic_app_trigger_http_request_test.go => logic_app_trigger_http_request_resource_test.go} (100%) rename azurerm/internal/services/logic/tests/{resource_arm_logic_app_trigger_recurrence_test.go => logic_app_trigger_recurrence_resource_test.go} (100%) rename azurerm/internal/services/logic/tests/{data_source_logic_app_workflow_test.go => logic_app_workflow_data_source_test.go} (100%) rename azurerm/internal/services/logic/tests/{resource_arm_logic_app_workflow_test.go => logic_app_workflow_resource_test.go} (100%) diff --git a/azurerm/internal/services/logic/resource_arm_logic_app_action_custom.go b/azurerm/internal/services/logic/logic_app_action_custom_resource.go similarity index 100% rename from azurerm/internal/services/logic/resource_arm_logic_app_action_custom.go rename to azurerm/internal/services/logic/logic_app_action_custom_resource.go diff --git a/azurerm/internal/services/logic/resource_arm_logic_app_action_http.go b/azurerm/internal/services/logic/logic_app_action_http_resource.go similarity index 100% rename from azurerm/internal/services/logic/resource_arm_logic_app_action_http.go rename to azurerm/internal/services/logic/logic_app_action_http_resource.go diff --git a/azurerm/internal/services/logic/resource_arm_logic_app_trigger_custom.go b/azurerm/internal/services/logic/logic_app_trigger_custom_resource.go similarity index 100% rename from azurerm/internal/services/logic/resource_arm_logic_app_trigger_custom.go rename to azurerm/internal/services/logic/logic_app_trigger_custom_resource.go diff --git a/azurerm/internal/services/logic/resource_arm_logic_app_trigger_http_request.go b/azurerm/internal/services/logic/logic_app_trigger_http_request_resource.go similarity index 100% rename from azurerm/internal/services/logic/resource_arm_logic_app_trigger_http_request.go rename to azurerm/internal/services/logic/logic_app_trigger_http_request_resource.go diff --git a/azurerm/internal/services/logic/resource_arm_logic_app_trigger_recurrence.go b/azurerm/internal/services/logic/logic_app_trigger_recurrence_resource.go similarity index 100% rename from azurerm/internal/services/logic/resource_arm_logic_app_trigger_recurrence.go rename to azurerm/internal/services/logic/logic_app_trigger_recurrence_resource.go diff --git a/azurerm/internal/services/logic/data_source_logic_app_workflow.go b/azurerm/internal/services/logic/logic_app_workflow_data_source.go similarity index 100% rename from azurerm/internal/services/logic/data_source_logic_app_workflow.go rename to azurerm/internal/services/logic/logic_app_workflow_data_source.go diff --git a/azurerm/internal/services/logic/resource_arm_logic_app_workflow.go b/azurerm/internal/services/logic/logic_app_workflow_resource.go similarity index 100% rename from azurerm/internal/services/logic/resource_arm_logic_app_workflow.go rename to azurerm/internal/services/logic/logic_app_workflow_resource.go diff --git a/azurerm/internal/services/logic/tests/resource_arm_logic_app_action_custom_test.go b/azurerm/internal/services/logic/tests/logic_app_action_custom_resource_test.go similarity index 100% rename from azurerm/internal/services/logic/tests/resource_arm_logic_app_action_custom_test.go rename to azurerm/internal/services/logic/tests/logic_app_action_custom_resource_test.go diff --git a/azurerm/internal/services/logic/tests/resource_arm_logic_app_action_http_test.go b/azurerm/internal/services/logic/tests/logic_app_action_http_resource_test.go similarity index 100% rename from azurerm/internal/services/logic/tests/resource_arm_logic_app_action_http_test.go rename to azurerm/internal/services/logic/tests/logic_app_action_http_resource_test.go diff --git a/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_custom_test.go b/azurerm/internal/services/logic/tests/logic_app_trigger_custom_resource_test.go similarity index 100% rename from azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_custom_test.go rename to azurerm/internal/services/logic/tests/logic_app_trigger_custom_resource_test.go diff --git a/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_http_request_test.go b/azurerm/internal/services/logic/tests/logic_app_trigger_http_request_resource_test.go similarity index 100% rename from azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_http_request_test.go rename to azurerm/internal/services/logic/tests/logic_app_trigger_http_request_resource_test.go diff --git a/azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_recurrence_test.go b/azurerm/internal/services/logic/tests/logic_app_trigger_recurrence_resource_test.go similarity index 100% rename from azurerm/internal/services/logic/tests/resource_arm_logic_app_trigger_recurrence_test.go rename to azurerm/internal/services/logic/tests/logic_app_trigger_recurrence_resource_test.go diff --git a/azurerm/internal/services/logic/tests/data_source_logic_app_workflow_test.go b/azurerm/internal/services/logic/tests/logic_app_workflow_data_source_test.go similarity index 100% rename from azurerm/internal/services/logic/tests/data_source_logic_app_workflow_test.go rename to azurerm/internal/services/logic/tests/logic_app_workflow_data_source_test.go diff --git a/azurerm/internal/services/logic/tests/resource_arm_logic_app_workflow_test.go b/azurerm/internal/services/logic/tests/logic_app_workflow_resource_test.go similarity index 100% rename from azurerm/internal/services/logic/tests/resource_arm_logic_app_workflow_test.go rename to azurerm/internal/services/logic/tests/logic_app_workflow_resource_test.go From ca834a459a77786a9e2b708b4634351f66c9b290 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:53:39 -0500 Subject: [PATCH 185/223] updates `machinelearning` --- ...ing_workspace.go => machine_learning_workspace_data_source.go} | 0 ...arning_workspace.go => machine_learning_workspace_resource.go} | 0 ...ace_test.go => machine_learning_workspace_data_source_test.go} | 0 ...kspace_test.go => machine_learning_workspace_resource_test.go} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/machinelearning/{data_source_machine_learning_workspace.go => machine_learning_workspace_data_source.go} (100%) rename azurerm/internal/services/machinelearning/{resource_arm_machine_learning_workspace.go => machine_learning_workspace_resource.go} (100%) rename azurerm/internal/services/machinelearning/tests/{data_source_machine_learning_workspace_test.go => machine_learning_workspace_data_source_test.go} (100%) rename azurerm/internal/services/machinelearning/tests/{resource_arm_machine_learning_workspace_test.go => machine_learning_workspace_resource_test.go} (100%) diff --git a/azurerm/internal/services/machinelearning/data_source_machine_learning_workspace.go b/azurerm/internal/services/machinelearning/machine_learning_workspace_data_source.go similarity index 100% rename from azurerm/internal/services/machinelearning/data_source_machine_learning_workspace.go rename to azurerm/internal/services/machinelearning/machine_learning_workspace_data_source.go diff --git a/azurerm/internal/services/machinelearning/resource_arm_machine_learning_workspace.go b/azurerm/internal/services/machinelearning/machine_learning_workspace_resource.go similarity index 100% rename from azurerm/internal/services/machinelearning/resource_arm_machine_learning_workspace.go rename to azurerm/internal/services/machinelearning/machine_learning_workspace_resource.go diff --git a/azurerm/internal/services/machinelearning/tests/data_source_machine_learning_workspace_test.go b/azurerm/internal/services/machinelearning/tests/machine_learning_workspace_data_source_test.go similarity index 100% rename from azurerm/internal/services/machinelearning/tests/data_source_machine_learning_workspace_test.go rename to azurerm/internal/services/machinelearning/tests/machine_learning_workspace_data_source_test.go diff --git a/azurerm/internal/services/machinelearning/tests/resource_arm_machine_learning_workspace_test.go b/azurerm/internal/services/machinelearning/tests/machine_learning_workspace_resource_test.go similarity index 100% rename from azurerm/internal/services/machinelearning/tests/resource_arm_machine_learning_workspace_test.go rename to azurerm/internal/services/machinelearning/tests/machine_learning_workspace_resource_test.go From 95c9bd70c14ea1c157a319c09bdcd6e0e8b45750 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:53:48 -0500 Subject: [PATCH 186/223] updates `maintenance` --- ..._configuration.go => maintenance_configuration_data_source.go} | 0 ...nce_configuration.go => maintenance_configuration_resource.go} | 0 ...tion_test.go => maintenance_configuration_data_source_test.go} | 0 ...uration_test.go => maintenance_configuration_resource_test.go} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/maintenance/{data_source_maintenance_configuration.go => maintenance_configuration_data_source.go} (100%) rename azurerm/internal/services/maintenance/{resource_arm_maintenance_configuration.go => maintenance_configuration_resource.go} (100%) rename azurerm/internal/services/maintenance/tests/{data_source_maintenance_configuration_test.go => maintenance_configuration_data_source_test.go} (100%) rename azurerm/internal/services/maintenance/tests/{resource_arm_maintenance_configuration_test.go => maintenance_configuration_resource_test.go} (100%) diff --git a/azurerm/internal/services/maintenance/data_source_maintenance_configuration.go b/azurerm/internal/services/maintenance/maintenance_configuration_data_source.go similarity index 100% rename from azurerm/internal/services/maintenance/data_source_maintenance_configuration.go rename to azurerm/internal/services/maintenance/maintenance_configuration_data_source.go diff --git a/azurerm/internal/services/maintenance/resource_arm_maintenance_configuration.go b/azurerm/internal/services/maintenance/maintenance_configuration_resource.go similarity index 100% rename from azurerm/internal/services/maintenance/resource_arm_maintenance_configuration.go rename to azurerm/internal/services/maintenance/maintenance_configuration_resource.go diff --git a/azurerm/internal/services/maintenance/tests/data_source_maintenance_configuration_test.go b/azurerm/internal/services/maintenance/tests/maintenance_configuration_data_source_test.go similarity index 100% rename from azurerm/internal/services/maintenance/tests/data_source_maintenance_configuration_test.go rename to azurerm/internal/services/maintenance/tests/maintenance_configuration_data_source_test.go diff --git a/azurerm/internal/services/maintenance/tests/resource_arm_maintenance_configuration_test.go b/azurerm/internal/services/maintenance/tests/maintenance_configuration_resource_test.go similarity index 100% rename from azurerm/internal/services/maintenance/tests/resource_arm_maintenance_configuration_test.go rename to azurerm/internal/services/maintenance/tests/maintenance_configuration_resource_test.go From 8d6046191b49d51e9538d61f417060e54fafd68d Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:53:57 -0500 Subject: [PATCH 187/223] updates `managementgroup` --- ...source_management_group.go => management_group_data_source.go} | 0 ...ource_arm_management_group.go => management_group_resource.go} | 0 ...agement_group_test.go => management_group_data_source_test.go} | 0 ...management_group_test.go => management_group_resource_test.go} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/managementgroup/{data_source_management_group.go => management_group_data_source.go} (100%) rename azurerm/internal/services/managementgroup/{resource_arm_management_group.go => management_group_resource.go} (100%) rename azurerm/internal/services/managementgroup/tests/{data_source_management_group_test.go => management_group_data_source_test.go} (100%) rename azurerm/internal/services/managementgroup/tests/{resource_arm_management_group_test.go => management_group_resource_test.go} (100%) diff --git a/azurerm/internal/services/managementgroup/data_source_management_group.go b/azurerm/internal/services/managementgroup/management_group_data_source.go similarity index 100% rename from azurerm/internal/services/managementgroup/data_source_management_group.go rename to azurerm/internal/services/managementgroup/management_group_data_source.go diff --git a/azurerm/internal/services/managementgroup/resource_arm_management_group.go b/azurerm/internal/services/managementgroup/management_group_resource.go similarity index 100% rename from azurerm/internal/services/managementgroup/resource_arm_management_group.go rename to azurerm/internal/services/managementgroup/management_group_resource.go diff --git a/azurerm/internal/services/managementgroup/tests/data_source_management_group_test.go b/azurerm/internal/services/managementgroup/tests/management_group_data_source_test.go similarity index 100% rename from azurerm/internal/services/managementgroup/tests/data_source_management_group_test.go rename to azurerm/internal/services/managementgroup/tests/management_group_data_source_test.go diff --git a/azurerm/internal/services/managementgroup/tests/resource_arm_management_group_test.go b/azurerm/internal/services/managementgroup/tests/management_group_resource_test.go similarity index 100% rename from azurerm/internal/services/managementgroup/tests/resource_arm_management_group_test.go rename to azurerm/internal/services/managementgroup/tests/management_group_resource_test.go From 4fac77127a1a99f27b49f7d84f4b962d911d2a1a Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:54:04 -0500 Subject: [PATCH 188/223] updates `maps` --- .../{data_source_maps_account.go => maps_account_data_source.go} | 0 .../{resource_arm_maps_account.go => maps_account_resource.go} | 0 ...urce_maps_account_test.go => maps_account_data_source_test.go} | 0 ...rce_arm_maps_account_test.go => maps_account_resource_test.go} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/maps/{data_source_maps_account.go => maps_account_data_source.go} (100%) rename azurerm/internal/services/maps/{resource_arm_maps_account.go => maps_account_resource.go} (100%) rename azurerm/internal/services/maps/tests/{data_source_maps_account_test.go => maps_account_data_source_test.go} (100%) rename azurerm/internal/services/maps/tests/{resource_arm_maps_account_test.go => maps_account_resource_test.go} (100%) diff --git a/azurerm/internal/services/maps/data_source_maps_account.go b/azurerm/internal/services/maps/maps_account_data_source.go similarity index 100% rename from azurerm/internal/services/maps/data_source_maps_account.go rename to azurerm/internal/services/maps/maps_account_data_source.go diff --git a/azurerm/internal/services/maps/resource_arm_maps_account.go b/azurerm/internal/services/maps/maps_account_resource.go similarity index 100% rename from azurerm/internal/services/maps/resource_arm_maps_account.go rename to azurerm/internal/services/maps/maps_account_resource.go diff --git a/azurerm/internal/services/maps/tests/data_source_maps_account_test.go b/azurerm/internal/services/maps/tests/maps_account_data_source_test.go similarity index 100% rename from azurerm/internal/services/maps/tests/data_source_maps_account_test.go rename to azurerm/internal/services/maps/tests/maps_account_data_source_test.go diff --git a/azurerm/internal/services/maps/tests/resource_arm_maps_account_test.go b/azurerm/internal/services/maps/tests/maps_account_resource_test.go similarity index 100% rename from azurerm/internal/services/maps/tests/resource_arm_maps_account_test.go rename to azurerm/internal/services/maps/tests/maps_account_resource_test.go From e2ac536461d089d3c7a37c66913c3130e96a0eac Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:54:12 -0500 Subject: [PATCH 189/223] updates `mariadb` --- ...mariadb_configuration.go => mariadb_configuration_resource.go} | 0 ...ource_arm_mariadb_database.go => mariadb_database_resource.go} | 0 ...mariadb_firewall_rule.go => mariadb_firewall_rule_resource.go} | 0 ...ata_source_mariadb_server.go => mariadb_server_data_source.go} | 0 ...{resource_arm_mariadb_server.go => mariadb_server_resource.go} | 0 ...l_network_rule.go => mariadb_virtual_network_rule_resource.go} | 0 ...nfiguration_test.go => mariadb_configuration_resource_test.go} | 0 ...mariadb_database_test.go => mariadb_database_resource_test.go} | 0 ...rewall_rule_test.go => mariadb_firewall_rule_resource_test.go} | 0 ..._mariadb_server_test.go => mariadb_server_data_source_test.go} | 0 ...arm_mariadb_server_test.go => mariadb_server_resource_test.go} | 0 ...rule_test.go => mariadb_virtual_network_rule_resource_test.go} | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/mariadb/{resource_arm_mariadb_configuration.go => mariadb_configuration_resource.go} (100%) rename azurerm/internal/services/mariadb/{resource_arm_mariadb_database.go => mariadb_database_resource.go} (100%) rename azurerm/internal/services/mariadb/{resource_arm_mariadb_firewall_rule.go => mariadb_firewall_rule_resource.go} (100%) rename azurerm/internal/services/mariadb/{data_source_mariadb_server.go => mariadb_server_data_source.go} (100%) rename azurerm/internal/services/mariadb/{resource_arm_mariadb_server.go => mariadb_server_resource.go} (100%) rename azurerm/internal/services/mariadb/{resource_arm_mariadb_virtual_network_rule.go => mariadb_virtual_network_rule_resource.go} (100%) rename azurerm/internal/services/mariadb/tests/{resource_arm_mariadb_configuration_test.go => mariadb_configuration_resource_test.go} (100%) rename azurerm/internal/services/mariadb/tests/{resource_arm_mariadb_database_test.go => mariadb_database_resource_test.go} (100%) rename azurerm/internal/services/mariadb/tests/{resource_arm_mariadb_firewall_rule_test.go => mariadb_firewall_rule_resource_test.go} (100%) rename azurerm/internal/services/mariadb/tests/{data_source_mariadb_server_test.go => mariadb_server_data_source_test.go} (100%) rename azurerm/internal/services/mariadb/tests/{resource_arm_mariadb_server_test.go => mariadb_server_resource_test.go} (100%) rename azurerm/internal/services/mariadb/tests/{resource_arm_mariadb_virtual_network_rule_test.go => mariadb_virtual_network_rule_resource_test.go} (100%) diff --git a/azurerm/internal/services/mariadb/resource_arm_mariadb_configuration.go b/azurerm/internal/services/mariadb/mariadb_configuration_resource.go similarity index 100% rename from azurerm/internal/services/mariadb/resource_arm_mariadb_configuration.go rename to azurerm/internal/services/mariadb/mariadb_configuration_resource.go diff --git a/azurerm/internal/services/mariadb/resource_arm_mariadb_database.go b/azurerm/internal/services/mariadb/mariadb_database_resource.go similarity index 100% rename from azurerm/internal/services/mariadb/resource_arm_mariadb_database.go rename to azurerm/internal/services/mariadb/mariadb_database_resource.go diff --git a/azurerm/internal/services/mariadb/resource_arm_mariadb_firewall_rule.go b/azurerm/internal/services/mariadb/mariadb_firewall_rule_resource.go similarity index 100% rename from azurerm/internal/services/mariadb/resource_arm_mariadb_firewall_rule.go rename to azurerm/internal/services/mariadb/mariadb_firewall_rule_resource.go diff --git a/azurerm/internal/services/mariadb/data_source_mariadb_server.go b/azurerm/internal/services/mariadb/mariadb_server_data_source.go similarity index 100% rename from azurerm/internal/services/mariadb/data_source_mariadb_server.go rename to azurerm/internal/services/mariadb/mariadb_server_data_source.go diff --git a/azurerm/internal/services/mariadb/resource_arm_mariadb_server.go b/azurerm/internal/services/mariadb/mariadb_server_resource.go similarity index 100% rename from azurerm/internal/services/mariadb/resource_arm_mariadb_server.go rename to azurerm/internal/services/mariadb/mariadb_server_resource.go diff --git a/azurerm/internal/services/mariadb/resource_arm_mariadb_virtual_network_rule.go b/azurerm/internal/services/mariadb/mariadb_virtual_network_rule_resource.go similarity index 100% rename from azurerm/internal/services/mariadb/resource_arm_mariadb_virtual_network_rule.go rename to azurerm/internal/services/mariadb/mariadb_virtual_network_rule_resource.go diff --git a/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_configuration_test.go b/azurerm/internal/services/mariadb/tests/mariadb_configuration_resource_test.go similarity index 100% rename from azurerm/internal/services/mariadb/tests/resource_arm_mariadb_configuration_test.go rename to azurerm/internal/services/mariadb/tests/mariadb_configuration_resource_test.go diff --git a/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_database_test.go b/azurerm/internal/services/mariadb/tests/mariadb_database_resource_test.go similarity index 100% rename from azurerm/internal/services/mariadb/tests/resource_arm_mariadb_database_test.go rename to azurerm/internal/services/mariadb/tests/mariadb_database_resource_test.go diff --git a/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_firewall_rule_test.go b/azurerm/internal/services/mariadb/tests/mariadb_firewall_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/mariadb/tests/resource_arm_mariadb_firewall_rule_test.go rename to azurerm/internal/services/mariadb/tests/mariadb_firewall_rule_resource_test.go diff --git a/azurerm/internal/services/mariadb/tests/data_source_mariadb_server_test.go b/azurerm/internal/services/mariadb/tests/mariadb_server_data_source_test.go similarity index 100% rename from azurerm/internal/services/mariadb/tests/data_source_mariadb_server_test.go rename to azurerm/internal/services/mariadb/tests/mariadb_server_data_source_test.go diff --git a/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_server_test.go b/azurerm/internal/services/mariadb/tests/mariadb_server_resource_test.go similarity index 100% rename from azurerm/internal/services/mariadb/tests/resource_arm_mariadb_server_test.go rename to azurerm/internal/services/mariadb/tests/mariadb_server_resource_test.go diff --git a/azurerm/internal/services/mariadb/tests/resource_arm_mariadb_virtual_network_rule_test.go b/azurerm/internal/services/mariadb/tests/mariadb_virtual_network_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/mariadb/tests/resource_arm_mariadb_virtual_network_rule_test.go rename to azurerm/internal/services/mariadb/tests/mariadb_virtual_network_rule_resource_test.go From 36350c2c06e6a5fc59d6c417ea633e73e53a65ab Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:54:19 -0500 Subject: [PATCH 190/223] updates `media` --- ...dia_services_account.go => media_services_account_resource.go} | 0 ...es_account_test.go => media_services_account_resource_test.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/media/{resource_arm_media_services_account.go => media_services_account_resource.go} (100%) rename azurerm/internal/services/media/tests/{resource_arm_media_services_account_test.go => media_services_account_resource_test.go} (100%) diff --git a/azurerm/internal/services/media/resource_arm_media_services_account.go b/azurerm/internal/services/media/media_services_account_resource.go similarity index 100% rename from azurerm/internal/services/media/resource_arm_media_services_account.go rename to azurerm/internal/services/media/media_services_account_resource.go diff --git a/azurerm/internal/services/media/tests/resource_arm_media_services_account_test.go b/azurerm/internal/services/media/tests/media_services_account_resource_test.go similarity index 100% rename from azurerm/internal/services/media/tests/resource_arm_media_services_account_test.go rename to azurerm/internal/services/media/tests/media_services_account_resource_test.go From e4de0ebab3111bbbda078e1e6d239ea01b228a8c Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:54:29 -0500 Subject: [PATCH 191/223] updates `mixedreality` --- ...ial_anchors_account.go => spatial_anchors_account_resource.go} | 0 ...s_account_test.go => spatial_anchors_account_resource_test.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/mixedreality/{resource_arm_spatial_anchors_account.go => spatial_anchors_account_resource.go} (100%) rename azurerm/internal/services/mixedreality/tests/{resource_arm_spatial_anchors_account_test.go => spatial_anchors_account_resource_test.go} (100%) diff --git a/azurerm/internal/services/mixedreality/resource_arm_spatial_anchors_account.go b/azurerm/internal/services/mixedreality/spatial_anchors_account_resource.go similarity index 100% rename from azurerm/internal/services/mixedreality/resource_arm_spatial_anchors_account.go rename to azurerm/internal/services/mixedreality/spatial_anchors_account_resource.go diff --git a/azurerm/internal/services/mixedreality/tests/resource_arm_spatial_anchors_account_test.go b/azurerm/internal/services/mixedreality/tests/spatial_anchors_account_resource_test.go similarity index 100% rename from azurerm/internal/services/mixedreality/tests/resource_arm_spatial_anchors_account_test.go rename to azurerm/internal/services/mixedreality/tests/spatial_anchors_account_resource_test.go From 582da87dc1e1bc63b3cfaeff1ffcad24edc58623 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:54:37 -0500 Subject: [PATCH 192/223] updates `monitor` --- ...onitor_action_group.go => monitor_action_group_data_source.go} | 0 ...m_monitor_action_group.go => monitor_action_group_resource.go} | 0 ...tivity_log_alert.go => monitor_activity_log_alert_resource.go} | 0 ...autoscale_setting.go => monitor_autoscale_setting_resource.go} | 0 ...categories.go => monitor_diagnostic_categories_data_source.go} | 0 ...agnostic_setting.go => monitor_diagnostic_setting_resource.go} | 0 ..._monitor_log_profile.go => monitor_log_profile_data_source.go} | 0 ...arm_monitor_log_profile.go => monitor_log_profile_resource.go} | 0 ...m_monitor_metric_alert.go => monitor_metric_alert_resource.go} | 0 ...lert.go => monitor_scheduled_query_rules_alert_data_source.go} | 0 ...s_alert.go => monitor_scheduled_query_rules_alert_resource.go} | 0 ...es_log.go => monitor_scheduled_query_rules_log_data_source.go} | 0 ...rules_log.go => monitor_scheduled_query_rules_log_resource.go} | 0 ...ion_group_test.go => monitor_action_group_data_source_test.go} | 0 ...action_group_test.go => monitor_action_group_resource_test.go} | 0 ..._alert_test.go => monitor_activity_log_alert_resource_test.go} | 0 ...setting_test.go => monitor_autoscale_setting_resource_test.go} | 0 ..._test.go => monitor_diagnostic_categories_data_source_test.go} | 0 ...etting_test.go => monitor_diagnostic_setting_resource_test.go} | 0 ...og_profile_test.go => monitor_log_profile_data_source_test.go} | 0 ...r_log_profile_test.go => monitor_log_profile_resource_test.go} | 0 ...metric_alert_test.go => monitor_metric_alert_resource_test.go} | 0 ...go => monitor_scheduled_query_rules_alert_data_source_test.go} | 0 ...st.go => monitor_scheduled_query_rules_alert_resource_test.go} | 0 ...t.go => monitor_scheduled_query_rules_log_data_source_test.go} | 0 ...test.go => monitor_scheduled_query_rules_log_resource_test.go} | 0 26 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/monitor/{data_source_monitor_action_group.go => monitor_action_group_data_source.go} (100%) rename azurerm/internal/services/monitor/{resource_arm_monitor_action_group.go => monitor_action_group_resource.go} (100%) rename azurerm/internal/services/monitor/{resource_arm_monitor_activity_log_alert.go => monitor_activity_log_alert_resource.go} (100%) rename azurerm/internal/services/monitor/{resource_arm_monitor_autoscale_setting.go => monitor_autoscale_setting_resource.go} (100%) rename azurerm/internal/services/monitor/{data_source_monitor_diagnostic_categories.go => monitor_diagnostic_categories_data_source.go} (100%) rename azurerm/internal/services/monitor/{resource_arm_monitor_diagnostic_setting.go => monitor_diagnostic_setting_resource.go} (100%) rename azurerm/internal/services/monitor/{data_source_monitor_log_profile.go => monitor_log_profile_data_source.go} (100%) rename azurerm/internal/services/monitor/{resource_arm_monitor_log_profile.go => monitor_log_profile_resource.go} (100%) rename azurerm/internal/services/monitor/{resource_arm_monitor_metric_alert.go => monitor_metric_alert_resource.go} (100%) rename azurerm/internal/services/monitor/{data_source_monitor_scheduled_query_rules_alert.go => monitor_scheduled_query_rules_alert_data_source.go} (100%) rename azurerm/internal/services/monitor/{resource_arm_monitor_scheduled_query_rules_alert.go => monitor_scheduled_query_rules_alert_resource.go} (100%) rename azurerm/internal/services/monitor/{data_source_monitor_scheduled_query_rules_log.go => monitor_scheduled_query_rules_log_data_source.go} (100%) rename azurerm/internal/services/monitor/{resource_arm_monitor_scheduled_query_rules_log.go => monitor_scheduled_query_rules_log_resource.go} (100%) rename azurerm/internal/services/monitor/tests/{data_source_monitor_action_group_test.go => monitor_action_group_data_source_test.go} (100%) rename azurerm/internal/services/monitor/tests/{resource_arm_monitor_action_group_test.go => monitor_action_group_resource_test.go} (100%) rename azurerm/internal/services/monitor/tests/{resource_arm_monitor_activity_log_alert_test.go => monitor_activity_log_alert_resource_test.go} (100%) rename azurerm/internal/services/monitor/tests/{resource_arm_monitor_autoscale_setting_test.go => monitor_autoscale_setting_resource_test.go} (100%) rename azurerm/internal/services/monitor/tests/{data_source_monitor_diagnostic_categories_test.go => monitor_diagnostic_categories_data_source_test.go} (100%) rename azurerm/internal/services/monitor/tests/{resource_arm_monitor_diagnostic_setting_test.go => monitor_diagnostic_setting_resource_test.go} (100%) rename azurerm/internal/services/monitor/tests/{data_source_monitor_log_profile_test.go => monitor_log_profile_data_source_test.go} (100%) rename azurerm/internal/services/monitor/tests/{resource_arm_monitor_log_profile_test.go => monitor_log_profile_resource_test.go} (100%) rename azurerm/internal/services/monitor/tests/{resource_arm_monitor_metric_alert_test.go => monitor_metric_alert_resource_test.go} (100%) rename azurerm/internal/services/monitor/tests/{data_source_monitor_scheduled_query_rules_alert_test.go => monitor_scheduled_query_rules_alert_data_source_test.go} (100%) rename azurerm/internal/services/monitor/tests/{resource_arm_monitor_scheduled_query_rules_alert_test.go => monitor_scheduled_query_rules_alert_resource_test.go} (100%) rename azurerm/internal/services/monitor/tests/{data_source_monitor_scheduled_query_rules_log_test.go => monitor_scheduled_query_rules_log_data_source_test.go} (100%) rename azurerm/internal/services/monitor/tests/{resource_arm_monitor_scheduled_query_rules_log_test.go => monitor_scheduled_query_rules_log_resource_test.go} (100%) diff --git a/azurerm/internal/services/monitor/data_source_monitor_action_group.go b/azurerm/internal/services/monitor/monitor_action_group_data_source.go similarity index 100% rename from azurerm/internal/services/monitor/data_source_monitor_action_group.go rename to azurerm/internal/services/monitor/monitor_action_group_data_source.go diff --git a/azurerm/internal/services/monitor/resource_arm_monitor_action_group.go b/azurerm/internal/services/monitor/monitor_action_group_resource.go similarity index 100% rename from azurerm/internal/services/monitor/resource_arm_monitor_action_group.go rename to azurerm/internal/services/monitor/monitor_action_group_resource.go diff --git a/azurerm/internal/services/monitor/resource_arm_monitor_activity_log_alert.go b/azurerm/internal/services/monitor/monitor_activity_log_alert_resource.go similarity index 100% rename from azurerm/internal/services/monitor/resource_arm_monitor_activity_log_alert.go rename to azurerm/internal/services/monitor/monitor_activity_log_alert_resource.go diff --git a/azurerm/internal/services/monitor/resource_arm_monitor_autoscale_setting.go b/azurerm/internal/services/monitor/monitor_autoscale_setting_resource.go similarity index 100% rename from azurerm/internal/services/monitor/resource_arm_monitor_autoscale_setting.go rename to azurerm/internal/services/monitor/monitor_autoscale_setting_resource.go diff --git a/azurerm/internal/services/monitor/data_source_monitor_diagnostic_categories.go b/azurerm/internal/services/monitor/monitor_diagnostic_categories_data_source.go similarity index 100% rename from azurerm/internal/services/monitor/data_source_monitor_diagnostic_categories.go rename to azurerm/internal/services/monitor/monitor_diagnostic_categories_data_source.go diff --git a/azurerm/internal/services/monitor/resource_arm_monitor_diagnostic_setting.go b/azurerm/internal/services/monitor/monitor_diagnostic_setting_resource.go similarity index 100% rename from azurerm/internal/services/monitor/resource_arm_monitor_diagnostic_setting.go rename to azurerm/internal/services/monitor/monitor_diagnostic_setting_resource.go diff --git a/azurerm/internal/services/monitor/data_source_monitor_log_profile.go b/azurerm/internal/services/monitor/monitor_log_profile_data_source.go similarity index 100% rename from azurerm/internal/services/monitor/data_source_monitor_log_profile.go rename to azurerm/internal/services/monitor/monitor_log_profile_data_source.go diff --git a/azurerm/internal/services/monitor/resource_arm_monitor_log_profile.go b/azurerm/internal/services/monitor/monitor_log_profile_resource.go similarity index 100% rename from azurerm/internal/services/monitor/resource_arm_monitor_log_profile.go rename to azurerm/internal/services/monitor/monitor_log_profile_resource.go diff --git a/azurerm/internal/services/monitor/resource_arm_monitor_metric_alert.go b/azurerm/internal/services/monitor/monitor_metric_alert_resource.go similarity index 100% rename from azurerm/internal/services/monitor/resource_arm_monitor_metric_alert.go rename to azurerm/internal/services/monitor/monitor_metric_alert_resource.go diff --git a/azurerm/internal/services/monitor/data_source_monitor_scheduled_query_rules_alert.go b/azurerm/internal/services/monitor/monitor_scheduled_query_rules_alert_data_source.go similarity index 100% rename from azurerm/internal/services/monitor/data_source_monitor_scheduled_query_rules_alert.go rename to azurerm/internal/services/monitor/monitor_scheduled_query_rules_alert_data_source.go diff --git a/azurerm/internal/services/monitor/resource_arm_monitor_scheduled_query_rules_alert.go b/azurerm/internal/services/monitor/monitor_scheduled_query_rules_alert_resource.go similarity index 100% rename from azurerm/internal/services/monitor/resource_arm_monitor_scheduled_query_rules_alert.go rename to azurerm/internal/services/monitor/monitor_scheduled_query_rules_alert_resource.go diff --git a/azurerm/internal/services/monitor/data_source_monitor_scheduled_query_rules_log.go b/azurerm/internal/services/monitor/monitor_scheduled_query_rules_log_data_source.go similarity index 100% rename from azurerm/internal/services/monitor/data_source_monitor_scheduled_query_rules_log.go rename to azurerm/internal/services/monitor/monitor_scheduled_query_rules_log_data_source.go diff --git a/azurerm/internal/services/monitor/resource_arm_monitor_scheduled_query_rules_log.go b/azurerm/internal/services/monitor/monitor_scheduled_query_rules_log_resource.go similarity index 100% rename from azurerm/internal/services/monitor/resource_arm_monitor_scheduled_query_rules_log.go rename to azurerm/internal/services/monitor/monitor_scheduled_query_rules_log_resource.go diff --git a/azurerm/internal/services/monitor/tests/data_source_monitor_action_group_test.go b/azurerm/internal/services/monitor/tests/monitor_action_group_data_source_test.go similarity index 100% rename from azurerm/internal/services/monitor/tests/data_source_monitor_action_group_test.go rename to azurerm/internal/services/monitor/tests/monitor_action_group_data_source_test.go diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_action_group_test.go b/azurerm/internal/services/monitor/tests/monitor_action_group_resource_test.go similarity index 100% rename from azurerm/internal/services/monitor/tests/resource_arm_monitor_action_group_test.go rename to azurerm/internal/services/monitor/tests/monitor_action_group_resource_test.go diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_activity_log_alert_test.go b/azurerm/internal/services/monitor/tests/monitor_activity_log_alert_resource_test.go similarity index 100% rename from azurerm/internal/services/monitor/tests/resource_arm_monitor_activity_log_alert_test.go rename to azurerm/internal/services/monitor/tests/monitor_activity_log_alert_resource_test.go diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_autoscale_setting_test.go b/azurerm/internal/services/monitor/tests/monitor_autoscale_setting_resource_test.go similarity index 100% rename from azurerm/internal/services/monitor/tests/resource_arm_monitor_autoscale_setting_test.go rename to azurerm/internal/services/monitor/tests/monitor_autoscale_setting_resource_test.go diff --git a/azurerm/internal/services/monitor/tests/data_source_monitor_diagnostic_categories_test.go b/azurerm/internal/services/monitor/tests/monitor_diagnostic_categories_data_source_test.go similarity index 100% rename from azurerm/internal/services/monitor/tests/data_source_monitor_diagnostic_categories_test.go rename to azurerm/internal/services/monitor/tests/monitor_diagnostic_categories_data_source_test.go diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_diagnostic_setting_test.go b/azurerm/internal/services/monitor/tests/monitor_diagnostic_setting_resource_test.go similarity index 100% rename from azurerm/internal/services/monitor/tests/resource_arm_monitor_diagnostic_setting_test.go rename to azurerm/internal/services/monitor/tests/monitor_diagnostic_setting_resource_test.go diff --git a/azurerm/internal/services/monitor/tests/data_source_monitor_log_profile_test.go b/azurerm/internal/services/monitor/tests/monitor_log_profile_data_source_test.go similarity index 100% rename from azurerm/internal/services/monitor/tests/data_source_monitor_log_profile_test.go rename to azurerm/internal/services/monitor/tests/monitor_log_profile_data_source_test.go diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_log_profile_test.go b/azurerm/internal/services/monitor/tests/monitor_log_profile_resource_test.go similarity index 100% rename from azurerm/internal/services/monitor/tests/resource_arm_monitor_log_profile_test.go rename to azurerm/internal/services/monitor/tests/monitor_log_profile_resource_test.go diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_metric_alert_test.go b/azurerm/internal/services/monitor/tests/monitor_metric_alert_resource_test.go similarity index 100% rename from azurerm/internal/services/monitor/tests/resource_arm_monitor_metric_alert_test.go rename to azurerm/internal/services/monitor/tests/monitor_metric_alert_resource_test.go diff --git a/azurerm/internal/services/monitor/tests/data_source_monitor_scheduled_query_rules_alert_test.go b/azurerm/internal/services/monitor/tests/monitor_scheduled_query_rules_alert_data_source_test.go similarity index 100% rename from azurerm/internal/services/monitor/tests/data_source_monitor_scheduled_query_rules_alert_test.go rename to azurerm/internal/services/monitor/tests/monitor_scheduled_query_rules_alert_data_source_test.go diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_scheduled_query_rules_alert_test.go b/azurerm/internal/services/monitor/tests/monitor_scheduled_query_rules_alert_resource_test.go similarity index 100% rename from azurerm/internal/services/monitor/tests/resource_arm_monitor_scheduled_query_rules_alert_test.go rename to azurerm/internal/services/monitor/tests/monitor_scheduled_query_rules_alert_resource_test.go diff --git a/azurerm/internal/services/monitor/tests/data_source_monitor_scheduled_query_rules_log_test.go b/azurerm/internal/services/monitor/tests/monitor_scheduled_query_rules_log_data_source_test.go similarity index 100% rename from azurerm/internal/services/monitor/tests/data_source_monitor_scheduled_query_rules_log_test.go rename to azurerm/internal/services/monitor/tests/monitor_scheduled_query_rules_log_data_source_test.go diff --git a/azurerm/internal/services/monitor/tests/resource_arm_monitor_scheduled_query_rules_log_test.go b/azurerm/internal/services/monitor/tests/monitor_scheduled_query_rules_log_resource_test.go similarity index 100% rename from azurerm/internal/services/monitor/tests/resource_arm_monitor_scheduled_query_rules_log_test.go rename to azurerm/internal/services/monitor/tests/monitor_scheduled_query_rules_log_resource_test.go From 1f3e14c2098e1c7d99e4b80dfc9b16da342c6a4e Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:54:44 -0500 Subject: [PATCH 193/223] updates `msi` --- ...dentity_test.go => user_assigned_identity_data_source_test.go} | 0 ...d_identity_test.go => user_assigned_identity_resource_test.go} | 0 ...assigned_identity.go => user_assigned_identity_data_source.go} | 0 ...er_assigned_identity.go => user_assigned_identity_resource.go} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/msi/tests/{data_source_user_assigned_identity_test.go => user_assigned_identity_data_source_test.go} (100%) rename azurerm/internal/services/msi/tests/{resource_arm_user_assigned_identity_test.go => user_assigned_identity_resource_test.go} (100%) rename azurerm/internal/services/msi/{data_source_user_assigned_identity.go => user_assigned_identity_data_source.go} (100%) rename azurerm/internal/services/msi/{resource_arm_user_assigned_identity.go => user_assigned_identity_resource.go} (100%) diff --git a/azurerm/internal/services/msi/tests/data_source_user_assigned_identity_test.go b/azurerm/internal/services/msi/tests/user_assigned_identity_data_source_test.go similarity index 100% rename from azurerm/internal/services/msi/tests/data_source_user_assigned_identity_test.go rename to azurerm/internal/services/msi/tests/user_assigned_identity_data_source_test.go diff --git a/azurerm/internal/services/msi/tests/resource_arm_user_assigned_identity_test.go b/azurerm/internal/services/msi/tests/user_assigned_identity_resource_test.go similarity index 100% rename from azurerm/internal/services/msi/tests/resource_arm_user_assigned_identity_test.go rename to azurerm/internal/services/msi/tests/user_assigned_identity_resource_test.go diff --git a/azurerm/internal/services/msi/data_source_user_assigned_identity.go b/azurerm/internal/services/msi/user_assigned_identity_data_source.go similarity index 100% rename from azurerm/internal/services/msi/data_source_user_assigned_identity.go rename to azurerm/internal/services/msi/user_assigned_identity_data_source.go diff --git a/azurerm/internal/services/msi/resource_arm_user_assigned_identity.go b/azurerm/internal/services/msi/user_assigned_identity_resource.go similarity index 100% rename from azurerm/internal/services/msi/resource_arm_user_assigned_identity.go rename to azurerm/internal/services/msi/user_assigned_identity_resource.go From 0e08e1f5b489db78767fab9f408cabe959b8ca96 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:54:53 -0500 Subject: [PATCH 194/223] updates `mssql` --- ...ata_source_mssql_database.go => mssql_database_data_source.go} | 0 ...{resource_arm_mssql_database.go => mssql_database_resource.go} | 0 ...l_database_vulnerability_assessment_rule_baseline_resource.go} | 0 ...urce_mssql_elasticpool.go => mssql_elasticpool_data_source.go} | 0 ...rce_arm_mssql_elasticpool.go => mssql_elasticpool_resource.go} | 0 .../{resource_arm_mssql_server.go => mssql_server_resource.go} | 0 ...t_policy.go => mssql_server_security_alert_policy_resource.go} | 0 ...sment.go => mssql_server_vulnerability_assessment_resource.go} | 0 ...mssql_virtual_machine.go => mssql_virtual_machine_resource.go} | 0 ..._mssql_database_test.go => mssql_database_data_source_test.go} | 0 ...arm_mssql_database_test.go => mssql_database_resource_test.go} | 0 ...abase_vulnerability_assessment_rule_baseline_resource_test.go} | 0 ..._elasticpool_test.go => mssql_elasticpool_data_source_test.go} | 0 ...sql_elasticpool_test.go => mssql_elasticpool_resource_test.go} | 0 ...rce_arm_mssql_server_test.go => mssql_server_resource_test.go} | 0 ...est.go => mssql_server_security_alert_policy_resource_test.go} | 0 ....go => mssql_server_vulnerability_assessment_resource_test.go} | 0 ...ual_machine_test.go => mssql_virtual_machine_resource_test.go} | 0 18 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/mssql/{data_source_mssql_database.go => mssql_database_data_source.go} (100%) rename azurerm/internal/services/mssql/{resource_arm_mssql_database.go => mssql_database_resource.go} (100%) rename azurerm/internal/services/mssql/{resource_arm_mssql_database_vulnerability_assessment_rule_baseline.go => mssql_database_vulnerability_assessment_rule_baseline_resource.go} (100%) rename azurerm/internal/services/mssql/{data_source_mssql_elasticpool.go => mssql_elasticpool_data_source.go} (100%) rename azurerm/internal/services/mssql/{resource_arm_mssql_elasticpool.go => mssql_elasticpool_resource.go} (100%) rename azurerm/internal/services/mssql/{resource_arm_mssql_server.go => mssql_server_resource.go} (100%) rename azurerm/internal/services/mssql/{resource_arm_mssql_server_security_alert_policy.go => mssql_server_security_alert_policy_resource.go} (100%) rename azurerm/internal/services/mssql/{resource_arm_mssql_server_vulnerability_assessment.go => mssql_server_vulnerability_assessment_resource.go} (100%) rename azurerm/internal/services/mssql/{resource_arm_mssql_virtual_machine.go => mssql_virtual_machine_resource.go} (100%) rename azurerm/internal/services/mssql/tests/{data_source_mssql_database_test.go => mssql_database_data_source_test.go} (100%) rename azurerm/internal/services/mssql/tests/{resource_arm_mssql_database_test.go => mssql_database_resource_test.go} (100%) rename azurerm/internal/services/mssql/tests/{resource_arm_mssql_database_vulnerability_assessment_rule_baseline_test.go => mssql_database_vulnerability_assessment_rule_baseline_resource_test.go} (100%) rename azurerm/internal/services/mssql/tests/{data_source_mssql_elasticpool_test.go => mssql_elasticpool_data_source_test.go} (100%) rename azurerm/internal/services/mssql/tests/{resource_arm_mssql_elasticpool_test.go => mssql_elasticpool_resource_test.go} (100%) rename azurerm/internal/services/mssql/tests/{resource_arm_mssql_server_test.go => mssql_server_resource_test.go} (100%) rename azurerm/internal/services/mssql/tests/{resource_arm_mssql_server_security_alert_policy_test.go => mssql_server_security_alert_policy_resource_test.go} (100%) rename azurerm/internal/services/mssql/tests/{resource_arm_mssql_server_vulnerability_assessment_test.go => mssql_server_vulnerability_assessment_resource_test.go} (100%) rename azurerm/internal/services/mssql/tests/{resource_arm_mssql_virtual_machine_test.go => mssql_virtual_machine_resource_test.go} (100%) diff --git a/azurerm/internal/services/mssql/data_source_mssql_database.go b/azurerm/internal/services/mssql/mssql_database_data_source.go similarity index 100% rename from azurerm/internal/services/mssql/data_source_mssql_database.go rename to azurerm/internal/services/mssql/mssql_database_data_source.go diff --git a/azurerm/internal/services/mssql/resource_arm_mssql_database.go b/azurerm/internal/services/mssql/mssql_database_resource.go similarity index 100% rename from azurerm/internal/services/mssql/resource_arm_mssql_database.go rename to azurerm/internal/services/mssql/mssql_database_resource.go diff --git a/azurerm/internal/services/mssql/resource_arm_mssql_database_vulnerability_assessment_rule_baseline.go b/azurerm/internal/services/mssql/mssql_database_vulnerability_assessment_rule_baseline_resource.go similarity index 100% rename from azurerm/internal/services/mssql/resource_arm_mssql_database_vulnerability_assessment_rule_baseline.go rename to azurerm/internal/services/mssql/mssql_database_vulnerability_assessment_rule_baseline_resource.go diff --git a/azurerm/internal/services/mssql/data_source_mssql_elasticpool.go b/azurerm/internal/services/mssql/mssql_elasticpool_data_source.go similarity index 100% rename from azurerm/internal/services/mssql/data_source_mssql_elasticpool.go rename to azurerm/internal/services/mssql/mssql_elasticpool_data_source.go diff --git a/azurerm/internal/services/mssql/resource_arm_mssql_elasticpool.go b/azurerm/internal/services/mssql/mssql_elasticpool_resource.go similarity index 100% rename from azurerm/internal/services/mssql/resource_arm_mssql_elasticpool.go rename to azurerm/internal/services/mssql/mssql_elasticpool_resource.go diff --git a/azurerm/internal/services/mssql/resource_arm_mssql_server.go b/azurerm/internal/services/mssql/mssql_server_resource.go similarity index 100% rename from azurerm/internal/services/mssql/resource_arm_mssql_server.go rename to azurerm/internal/services/mssql/mssql_server_resource.go diff --git a/azurerm/internal/services/mssql/resource_arm_mssql_server_security_alert_policy.go b/azurerm/internal/services/mssql/mssql_server_security_alert_policy_resource.go similarity index 100% rename from azurerm/internal/services/mssql/resource_arm_mssql_server_security_alert_policy.go rename to azurerm/internal/services/mssql/mssql_server_security_alert_policy_resource.go diff --git a/azurerm/internal/services/mssql/resource_arm_mssql_server_vulnerability_assessment.go b/azurerm/internal/services/mssql/mssql_server_vulnerability_assessment_resource.go similarity index 100% rename from azurerm/internal/services/mssql/resource_arm_mssql_server_vulnerability_assessment.go rename to azurerm/internal/services/mssql/mssql_server_vulnerability_assessment_resource.go diff --git a/azurerm/internal/services/mssql/resource_arm_mssql_virtual_machine.go b/azurerm/internal/services/mssql/mssql_virtual_machine_resource.go similarity index 100% rename from azurerm/internal/services/mssql/resource_arm_mssql_virtual_machine.go rename to azurerm/internal/services/mssql/mssql_virtual_machine_resource.go diff --git a/azurerm/internal/services/mssql/tests/data_source_mssql_database_test.go b/azurerm/internal/services/mssql/tests/mssql_database_data_source_test.go similarity index 100% rename from azurerm/internal/services/mssql/tests/data_source_mssql_database_test.go rename to azurerm/internal/services/mssql/tests/mssql_database_data_source_test.go diff --git a/azurerm/internal/services/mssql/tests/resource_arm_mssql_database_test.go b/azurerm/internal/services/mssql/tests/mssql_database_resource_test.go similarity index 100% rename from azurerm/internal/services/mssql/tests/resource_arm_mssql_database_test.go rename to azurerm/internal/services/mssql/tests/mssql_database_resource_test.go diff --git a/azurerm/internal/services/mssql/tests/resource_arm_mssql_database_vulnerability_assessment_rule_baseline_test.go b/azurerm/internal/services/mssql/tests/mssql_database_vulnerability_assessment_rule_baseline_resource_test.go similarity index 100% rename from azurerm/internal/services/mssql/tests/resource_arm_mssql_database_vulnerability_assessment_rule_baseline_test.go rename to azurerm/internal/services/mssql/tests/mssql_database_vulnerability_assessment_rule_baseline_resource_test.go diff --git a/azurerm/internal/services/mssql/tests/data_source_mssql_elasticpool_test.go b/azurerm/internal/services/mssql/tests/mssql_elasticpool_data_source_test.go similarity index 100% rename from azurerm/internal/services/mssql/tests/data_source_mssql_elasticpool_test.go rename to azurerm/internal/services/mssql/tests/mssql_elasticpool_data_source_test.go diff --git a/azurerm/internal/services/mssql/tests/resource_arm_mssql_elasticpool_test.go b/azurerm/internal/services/mssql/tests/mssql_elasticpool_resource_test.go similarity index 100% rename from azurerm/internal/services/mssql/tests/resource_arm_mssql_elasticpool_test.go rename to azurerm/internal/services/mssql/tests/mssql_elasticpool_resource_test.go diff --git a/azurerm/internal/services/mssql/tests/resource_arm_mssql_server_test.go b/azurerm/internal/services/mssql/tests/mssql_server_resource_test.go similarity index 100% rename from azurerm/internal/services/mssql/tests/resource_arm_mssql_server_test.go rename to azurerm/internal/services/mssql/tests/mssql_server_resource_test.go diff --git a/azurerm/internal/services/mssql/tests/resource_arm_mssql_server_security_alert_policy_test.go b/azurerm/internal/services/mssql/tests/mssql_server_security_alert_policy_resource_test.go similarity index 100% rename from azurerm/internal/services/mssql/tests/resource_arm_mssql_server_security_alert_policy_test.go rename to azurerm/internal/services/mssql/tests/mssql_server_security_alert_policy_resource_test.go diff --git a/azurerm/internal/services/mssql/tests/resource_arm_mssql_server_vulnerability_assessment_test.go b/azurerm/internal/services/mssql/tests/mssql_server_vulnerability_assessment_resource_test.go similarity index 100% rename from azurerm/internal/services/mssql/tests/resource_arm_mssql_server_vulnerability_assessment_test.go rename to azurerm/internal/services/mssql/tests/mssql_server_vulnerability_assessment_resource_test.go diff --git a/azurerm/internal/services/mssql/tests/resource_arm_mssql_virtual_machine_test.go b/azurerm/internal/services/mssql/tests/mssql_virtual_machine_resource_test.go similarity index 100% rename from azurerm/internal/services/mssql/tests/resource_arm_mssql_virtual_machine_test.go rename to azurerm/internal/services/mssql/tests/mssql_virtual_machine_resource_test.go From e004705e2afa78d3a9f8bf3a9cac65fa734ca0ad Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:55:01 -0500 Subject: [PATCH 195/223] updates `mysql` --- ...arm_mysql_configuration.go => mysql_configuration_resource.go} | 0 ...{resource_arm_mysql_database.go => mysql_database_resource.go} | 0 ...arm_mysql_firewall_rule.go => mysql_firewall_rule_resource.go} | 0 .../{resource_arm_mysql_server.go => mysql_server_resource.go} | 0 ...ual_network_rule.go => mysql_virtual_network_rule_resource.go} | 0 ...configuration_test.go => mysql_configuration_resource_test.go} | 0 ...arm_mysql_database_test.go => mysql_database_resource_test.go} | 0 ...firewall_rule_test.go => mysql_firewall_rule_resource_test.go} | 0 ...rce_arm_mysql_server_test.go => mysql_server_resource_test.go} | 0 ...k_rule_test.go => mysql_virtual_network_rule_resource_test.go} | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/mysql/{resource_arm_mysql_configuration.go => mysql_configuration_resource.go} (100%) rename azurerm/internal/services/mysql/{resource_arm_mysql_database.go => mysql_database_resource.go} (100%) rename azurerm/internal/services/mysql/{resource_arm_mysql_firewall_rule.go => mysql_firewall_rule_resource.go} (100%) rename azurerm/internal/services/mysql/{resource_arm_mysql_server.go => mysql_server_resource.go} (100%) rename azurerm/internal/services/mysql/{resource_arm_mysql_virtual_network_rule.go => mysql_virtual_network_rule_resource.go} (100%) rename azurerm/internal/services/mysql/tests/{resource_arm_mysql_configuration_test.go => mysql_configuration_resource_test.go} (100%) rename azurerm/internal/services/mysql/tests/{resource_arm_mysql_database_test.go => mysql_database_resource_test.go} (100%) rename azurerm/internal/services/mysql/tests/{resource_arm_mysql_firewall_rule_test.go => mysql_firewall_rule_resource_test.go} (100%) rename azurerm/internal/services/mysql/tests/{resource_arm_mysql_server_test.go => mysql_server_resource_test.go} (100%) rename azurerm/internal/services/mysql/tests/{resource_arm_mysql_virtual_network_rule_test.go => mysql_virtual_network_rule_resource_test.go} (100%) diff --git a/azurerm/internal/services/mysql/resource_arm_mysql_configuration.go b/azurerm/internal/services/mysql/mysql_configuration_resource.go similarity index 100% rename from azurerm/internal/services/mysql/resource_arm_mysql_configuration.go rename to azurerm/internal/services/mysql/mysql_configuration_resource.go diff --git a/azurerm/internal/services/mysql/resource_arm_mysql_database.go b/azurerm/internal/services/mysql/mysql_database_resource.go similarity index 100% rename from azurerm/internal/services/mysql/resource_arm_mysql_database.go rename to azurerm/internal/services/mysql/mysql_database_resource.go diff --git a/azurerm/internal/services/mysql/resource_arm_mysql_firewall_rule.go b/azurerm/internal/services/mysql/mysql_firewall_rule_resource.go similarity index 100% rename from azurerm/internal/services/mysql/resource_arm_mysql_firewall_rule.go rename to azurerm/internal/services/mysql/mysql_firewall_rule_resource.go diff --git a/azurerm/internal/services/mysql/resource_arm_mysql_server.go b/azurerm/internal/services/mysql/mysql_server_resource.go similarity index 100% rename from azurerm/internal/services/mysql/resource_arm_mysql_server.go rename to azurerm/internal/services/mysql/mysql_server_resource.go diff --git a/azurerm/internal/services/mysql/resource_arm_mysql_virtual_network_rule.go b/azurerm/internal/services/mysql/mysql_virtual_network_rule_resource.go similarity index 100% rename from azurerm/internal/services/mysql/resource_arm_mysql_virtual_network_rule.go rename to azurerm/internal/services/mysql/mysql_virtual_network_rule_resource.go diff --git a/azurerm/internal/services/mysql/tests/resource_arm_mysql_configuration_test.go b/azurerm/internal/services/mysql/tests/mysql_configuration_resource_test.go similarity index 100% rename from azurerm/internal/services/mysql/tests/resource_arm_mysql_configuration_test.go rename to azurerm/internal/services/mysql/tests/mysql_configuration_resource_test.go diff --git a/azurerm/internal/services/mysql/tests/resource_arm_mysql_database_test.go b/azurerm/internal/services/mysql/tests/mysql_database_resource_test.go similarity index 100% rename from azurerm/internal/services/mysql/tests/resource_arm_mysql_database_test.go rename to azurerm/internal/services/mysql/tests/mysql_database_resource_test.go diff --git a/azurerm/internal/services/mysql/tests/resource_arm_mysql_firewall_rule_test.go b/azurerm/internal/services/mysql/tests/mysql_firewall_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/mysql/tests/resource_arm_mysql_firewall_rule_test.go rename to azurerm/internal/services/mysql/tests/mysql_firewall_rule_resource_test.go diff --git a/azurerm/internal/services/mysql/tests/resource_arm_mysql_server_test.go b/azurerm/internal/services/mysql/tests/mysql_server_resource_test.go similarity index 100% rename from azurerm/internal/services/mysql/tests/resource_arm_mysql_server_test.go rename to azurerm/internal/services/mysql/tests/mysql_server_resource_test.go diff --git a/azurerm/internal/services/mysql/tests/resource_arm_mysql_virtual_network_rule_test.go b/azurerm/internal/services/mysql/tests/mysql_virtual_network_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/mysql/tests/resource_arm_mysql_virtual_network_rule_test.go rename to azurerm/internal/services/mysql/tests/mysql_virtual_network_rule_resource_test.go From 4b8ff98b8679cb882e379ce25a5c02069784c86f Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:55:10 -0500 Subject: [PATCH 196/223] updates `netapp` --- ...ata_source_netapp_account.go => netapp_account_data_source.go} | 0 ...{resource_arm_netapp_account.go => netapp_account_resource.go} | 0 .../{data_source_netapp_pool.go => netapp_pool_data_source.go} | 0 .../{resource_arm_netapp_pool.go => netapp_pool_resource.go} | 0 ...a_source_netapp_snapshot.go => netapp_snapshot_data_source.go} | 0 ...esource_arm_netapp_snapshot.go => netapp_snapshot_resource.go} | 0 ...{data_source_netapp_volume.go => netapp_volume_data_source.go} | 0 .../{resource_arm_netapp_volume.go => netapp_volume_resource.go} | 0 ..._netapp_account_test.go => netapp_account_data_source_test.go} | 0 ...arm_netapp_account_test.go => netapp_account_resource_test.go} | 0 ...source_netapp_pool_test.go => netapp_pool_data_source_test.go} | 0 ...ource_arm_netapp_pool_test.go => netapp_pool_resource_test.go} | 0 ...etapp_snapshot_test.go => netapp_snapshot_data_source_test.go} | 0 ...m_netapp_snapshot_test.go => netapp_snapshot_resource_test.go} | 0 ...ce_netapp_volume_test.go => netapp_volume_data_source_test.go} | 0 ...e_arm_netapp_volume_test.go => netapp_volume_resource_test.go} | 0 16 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/netapp/{data_source_netapp_account.go => netapp_account_data_source.go} (100%) rename azurerm/internal/services/netapp/{resource_arm_netapp_account.go => netapp_account_resource.go} (100%) rename azurerm/internal/services/netapp/{data_source_netapp_pool.go => netapp_pool_data_source.go} (100%) rename azurerm/internal/services/netapp/{resource_arm_netapp_pool.go => netapp_pool_resource.go} (100%) rename azurerm/internal/services/netapp/{data_source_netapp_snapshot.go => netapp_snapshot_data_source.go} (100%) rename azurerm/internal/services/netapp/{resource_arm_netapp_snapshot.go => netapp_snapshot_resource.go} (100%) rename azurerm/internal/services/netapp/{data_source_netapp_volume.go => netapp_volume_data_source.go} (100%) rename azurerm/internal/services/netapp/{resource_arm_netapp_volume.go => netapp_volume_resource.go} (100%) rename azurerm/internal/services/netapp/tests/{data_source_netapp_account_test.go => netapp_account_data_source_test.go} (100%) rename azurerm/internal/services/netapp/tests/{resource_arm_netapp_account_test.go => netapp_account_resource_test.go} (100%) rename azurerm/internal/services/netapp/tests/{data_source_netapp_pool_test.go => netapp_pool_data_source_test.go} (100%) rename azurerm/internal/services/netapp/tests/{resource_arm_netapp_pool_test.go => netapp_pool_resource_test.go} (100%) rename azurerm/internal/services/netapp/tests/{data_source_netapp_snapshot_test.go => netapp_snapshot_data_source_test.go} (100%) rename azurerm/internal/services/netapp/tests/{resource_arm_netapp_snapshot_test.go => netapp_snapshot_resource_test.go} (100%) rename azurerm/internal/services/netapp/tests/{data_source_netapp_volume_test.go => netapp_volume_data_source_test.go} (100%) rename azurerm/internal/services/netapp/tests/{resource_arm_netapp_volume_test.go => netapp_volume_resource_test.go} (100%) diff --git a/azurerm/internal/services/netapp/data_source_netapp_account.go b/azurerm/internal/services/netapp/netapp_account_data_source.go similarity index 100% rename from azurerm/internal/services/netapp/data_source_netapp_account.go rename to azurerm/internal/services/netapp/netapp_account_data_source.go diff --git a/azurerm/internal/services/netapp/resource_arm_netapp_account.go b/azurerm/internal/services/netapp/netapp_account_resource.go similarity index 100% rename from azurerm/internal/services/netapp/resource_arm_netapp_account.go rename to azurerm/internal/services/netapp/netapp_account_resource.go diff --git a/azurerm/internal/services/netapp/data_source_netapp_pool.go b/azurerm/internal/services/netapp/netapp_pool_data_source.go similarity index 100% rename from azurerm/internal/services/netapp/data_source_netapp_pool.go rename to azurerm/internal/services/netapp/netapp_pool_data_source.go diff --git a/azurerm/internal/services/netapp/resource_arm_netapp_pool.go b/azurerm/internal/services/netapp/netapp_pool_resource.go similarity index 100% rename from azurerm/internal/services/netapp/resource_arm_netapp_pool.go rename to azurerm/internal/services/netapp/netapp_pool_resource.go diff --git a/azurerm/internal/services/netapp/data_source_netapp_snapshot.go b/azurerm/internal/services/netapp/netapp_snapshot_data_source.go similarity index 100% rename from azurerm/internal/services/netapp/data_source_netapp_snapshot.go rename to azurerm/internal/services/netapp/netapp_snapshot_data_source.go diff --git a/azurerm/internal/services/netapp/resource_arm_netapp_snapshot.go b/azurerm/internal/services/netapp/netapp_snapshot_resource.go similarity index 100% rename from azurerm/internal/services/netapp/resource_arm_netapp_snapshot.go rename to azurerm/internal/services/netapp/netapp_snapshot_resource.go diff --git a/azurerm/internal/services/netapp/data_source_netapp_volume.go b/azurerm/internal/services/netapp/netapp_volume_data_source.go similarity index 100% rename from azurerm/internal/services/netapp/data_source_netapp_volume.go rename to azurerm/internal/services/netapp/netapp_volume_data_source.go diff --git a/azurerm/internal/services/netapp/resource_arm_netapp_volume.go b/azurerm/internal/services/netapp/netapp_volume_resource.go similarity index 100% rename from azurerm/internal/services/netapp/resource_arm_netapp_volume.go rename to azurerm/internal/services/netapp/netapp_volume_resource.go diff --git a/azurerm/internal/services/netapp/tests/data_source_netapp_account_test.go b/azurerm/internal/services/netapp/tests/netapp_account_data_source_test.go similarity index 100% rename from azurerm/internal/services/netapp/tests/data_source_netapp_account_test.go rename to azurerm/internal/services/netapp/tests/netapp_account_data_source_test.go diff --git a/azurerm/internal/services/netapp/tests/resource_arm_netapp_account_test.go b/azurerm/internal/services/netapp/tests/netapp_account_resource_test.go similarity index 100% rename from azurerm/internal/services/netapp/tests/resource_arm_netapp_account_test.go rename to azurerm/internal/services/netapp/tests/netapp_account_resource_test.go diff --git a/azurerm/internal/services/netapp/tests/data_source_netapp_pool_test.go b/azurerm/internal/services/netapp/tests/netapp_pool_data_source_test.go similarity index 100% rename from azurerm/internal/services/netapp/tests/data_source_netapp_pool_test.go rename to azurerm/internal/services/netapp/tests/netapp_pool_data_source_test.go diff --git a/azurerm/internal/services/netapp/tests/resource_arm_netapp_pool_test.go b/azurerm/internal/services/netapp/tests/netapp_pool_resource_test.go similarity index 100% rename from azurerm/internal/services/netapp/tests/resource_arm_netapp_pool_test.go rename to azurerm/internal/services/netapp/tests/netapp_pool_resource_test.go diff --git a/azurerm/internal/services/netapp/tests/data_source_netapp_snapshot_test.go b/azurerm/internal/services/netapp/tests/netapp_snapshot_data_source_test.go similarity index 100% rename from azurerm/internal/services/netapp/tests/data_source_netapp_snapshot_test.go rename to azurerm/internal/services/netapp/tests/netapp_snapshot_data_source_test.go diff --git a/azurerm/internal/services/netapp/tests/resource_arm_netapp_snapshot_test.go b/azurerm/internal/services/netapp/tests/netapp_snapshot_resource_test.go similarity index 100% rename from azurerm/internal/services/netapp/tests/resource_arm_netapp_snapshot_test.go rename to azurerm/internal/services/netapp/tests/netapp_snapshot_resource_test.go diff --git a/azurerm/internal/services/netapp/tests/data_source_netapp_volume_test.go b/azurerm/internal/services/netapp/tests/netapp_volume_data_source_test.go similarity index 100% rename from azurerm/internal/services/netapp/tests/data_source_netapp_volume_test.go rename to azurerm/internal/services/netapp/tests/netapp_volume_data_source_test.go diff --git a/azurerm/internal/services/netapp/tests/resource_arm_netapp_volume_test.go b/azurerm/internal/services/netapp/tests/netapp_volume_resource_test.go similarity index 100% rename from azurerm/internal/services/netapp/tests/resource_arm_netapp_volume_test.go rename to azurerm/internal/services/netapp/tests/netapp_volume_resource_test.go From a504016a364a25d9be9d0d3ae014f769f4865c22 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 15:55:24 -0500 Subject: [PATCH 197/223] updates `notificationhub` --- ...on_rule.go => notification_hub_authorization_rule_resource.go} | 0 ...source_notification_hub.go => notification_hub_data_source.go} | 0 ...hub_namespace.go => notification_hub_namespace_data_source.go} | 0 ...on_hub_namespace.go => notification_hub_namespace_resource.go} | 0 ...ource_arm_notification_hub.go => notification_hub_resource.go} | 0 ...st.go => notification_hub_authorization_rule_resource_test.go} | 0 ...ification_hub_test.go => notification_hub_data_source_test.go} | 0 ...ace_test.go => notification_hub_namespace_data_source_test.go} | 0 ...espace_test.go => notification_hub_namespace_resource_test.go} | 0 ...notification_hub_test.go => notification_hub_resource_test.go} | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/notificationhub/{resource_arm_notification_hub_authorization_rule.go => notification_hub_authorization_rule_resource.go} (100%) rename azurerm/internal/services/notificationhub/{data_source_notification_hub.go => notification_hub_data_source.go} (100%) rename azurerm/internal/services/notificationhub/{data_source_notification_hub_namespace.go => notification_hub_namespace_data_source.go} (100%) rename azurerm/internal/services/notificationhub/{resource_arm_notification_hub_namespace.go => notification_hub_namespace_resource.go} (100%) rename azurerm/internal/services/notificationhub/{resource_arm_notification_hub.go => notification_hub_resource.go} (100%) rename azurerm/internal/services/notificationhub/tests/{resource_arm_notification_hub_authorization_rule_test.go => notification_hub_authorization_rule_resource_test.go} (100%) rename azurerm/internal/services/notificationhub/tests/{data_source_notification_hub_test.go => notification_hub_data_source_test.go} (100%) rename azurerm/internal/services/notificationhub/tests/{data_source_notification_hub_namespace_test.go => notification_hub_namespace_data_source_test.go} (100%) rename azurerm/internal/services/notificationhub/tests/{resource_arm_notification_hub_namespace_test.go => notification_hub_namespace_resource_test.go} (100%) rename azurerm/internal/services/notificationhub/tests/{resource_arm_notification_hub_test.go => notification_hub_resource_test.go} (100%) diff --git a/azurerm/internal/services/notificationhub/resource_arm_notification_hub_authorization_rule.go b/azurerm/internal/services/notificationhub/notification_hub_authorization_rule_resource.go similarity index 100% rename from azurerm/internal/services/notificationhub/resource_arm_notification_hub_authorization_rule.go rename to azurerm/internal/services/notificationhub/notification_hub_authorization_rule_resource.go diff --git a/azurerm/internal/services/notificationhub/data_source_notification_hub.go b/azurerm/internal/services/notificationhub/notification_hub_data_source.go similarity index 100% rename from azurerm/internal/services/notificationhub/data_source_notification_hub.go rename to azurerm/internal/services/notificationhub/notification_hub_data_source.go diff --git a/azurerm/internal/services/notificationhub/data_source_notification_hub_namespace.go b/azurerm/internal/services/notificationhub/notification_hub_namespace_data_source.go similarity index 100% rename from azurerm/internal/services/notificationhub/data_source_notification_hub_namespace.go rename to azurerm/internal/services/notificationhub/notification_hub_namespace_data_source.go diff --git a/azurerm/internal/services/notificationhub/resource_arm_notification_hub_namespace.go b/azurerm/internal/services/notificationhub/notification_hub_namespace_resource.go similarity index 100% rename from azurerm/internal/services/notificationhub/resource_arm_notification_hub_namespace.go rename to azurerm/internal/services/notificationhub/notification_hub_namespace_resource.go diff --git a/azurerm/internal/services/notificationhub/resource_arm_notification_hub.go b/azurerm/internal/services/notificationhub/notification_hub_resource.go similarity index 100% rename from azurerm/internal/services/notificationhub/resource_arm_notification_hub.go rename to azurerm/internal/services/notificationhub/notification_hub_resource.go diff --git a/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_authorization_rule_test.go b/azurerm/internal/services/notificationhub/tests/notification_hub_authorization_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_authorization_rule_test.go rename to azurerm/internal/services/notificationhub/tests/notification_hub_authorization_rule_resource_test.go diff --git a/azurerm/internal/services/notificationhub/tests/data_source_notification_hub_test.go b/azurerm/internal/services/notificationhub/tests/notification_hub_data_source_test.go similarity index 100% rename from azurerm/internal/services/notificationhub/tests/data_source_notification_hub_test.go rename to azurerm/internal/services/notificationhub/tests/notification_hub_data_source_test.go diff --git a/azurerm/internal/services/notificationhub/tests/data_source_notification_hub_namespace_test.go b/azurerm/internal/services/notificationhub/tests/notification_hub_namespace_data_source_test.go similarity index 100% rename from azurerm/internal/services/notificationhub/tests/data_source_notification_hub_namespace_test.go rename to azurerm/internal/services/notificationhub/tests/notification_hub_namespace_data_source_test.go diff --git a/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_namespace_test.go b/azurerm/internal/services/notificationhub/tests/notification_hub_namespace_resource_test.go similarity index 100% rename from azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_namespace_test.go rename to azurerm/internal/services/notificationhub/tests/notification_hub_namespace_resource_test.go diff --git a/azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_test.go b/azurerm/internal/services/notificationhub/tests/notification_hub_resource_test.go similarity index 100% rename from azurerm/internal/services/notificationhub/tests/resource_arm_notification_hub_test.go rename to azurerm/internal/services/notificationhub/tests/notification_hub_resource_test.go From ef8b613f67f16dc5078966b969b214febab4ba61 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 16:01:41 -0500 Subject: [PATCH 198/223] updates `network` --- ...arm_application_gateway.go => application_gateway_resource.go} | 0 ...ecurity_group.go => application_security_group_data_source.go} | 0 ...n_security_group.go => application_security_group_resource.go} | 0 .../{resource_arm_bastion_host.go => bastion_host_resource.go} | 0 ...ization.go => express_route_circuit_authorization_resource.go} | 0 ...ress_route_circuit.go => express_route_circuit_data_source.go} | 0 ...rcuit_peering.go => express_route_circuit_peering_resource.go} | 0 ...express_route_circuit.go => express_route_circuit_resource.go} | 0 ...express_route_gateway.go => express_route_gateway_resource.go} | 0 ...ection.go => firewall_application_rule_collection_resource.go} | 0 .../network/{data_source_firewall.go => firewall_data_source.go} | 0 ...ule_collection.go => firewall_nat_rule_collection_resource.go} | 0 ...collection.go => firewall_network_rule_collection_resource.go} | 0 .../network/{resource_arm_firewall.go => firewall_resource.go} | 0 ...end_address_pool.go => lb_backend_address_pool_data_source.go} | 0 ...ackend_address_pool.go => lb_backend_address_pool_resource.go} | 0 .../services/network/{data_source_lb.go => lb_data_source.go} | 0 .../{resource_arm_lb_nat_pool.go => lb_nat_pool_resource.go} | 0 .../{resource_arm_lb_nat_rule.go => lb_nat_rule_resource.go} | 0 ...ource_arm_lb_outbound_rule.go => lb_outbound_rule_resource.go} | 0 .../network/{resource_arm_lb_probe.go => lb_probe_resource.go} | 0 .../services/network/{resource_arm_lb.go => lb_resource.go} | 0 .../network/{resource_arm_lb_rule.go => lb_rule_resource.go} | 0 ...local_network_gateway.go => local_network_gateway_resource.go} | 0 .../{data_source_nat_gateway.go => nat_gateway_data_source.go} | 0 .../{resource_arm_nat_gateway.go => nat_gateway_resource.go} | 0 ...nnection_monitor.go => network_connection_monitor_resource.go} | 0 ...ection_plan.go => network_ddos_protection_plan_data_source.go} | 0 ...rotection_plan.go => network_ddos_protection_plan_resource.go} | 0 ...network_interface_application_gateway_association_resource.go} | 0 ...etwork_interface_backend_address_pool_association_resource.go} | 0 ...urce_network_interface.go => network_interface_data_source.go} | 0 ...tion.go => network_interface_nat_rule_association_resource.go} | 0 ...rce_arm_network_interface.go => network_interface_resource.go} | 0 ...twork_packet_capture.go => network_packet_capture_resource.go} | 0 ...esource_arm_network_profile.go => network_profile_resource.go} | 0 ...rk_security_group.go => network_security_group_data_source.go} | 0 ...twork_security_group.go => network_security_group_resource.go} | 0 ...network_security_rule.go => network_security_rule_resource.go} | 0 ...etwork_service_tags.go => network_service_tags_data_source.go} | 0 ...a_source_network_watcher.go => network_watcher_data_source.go} | 0 ...k_watcher_flow_log.go => network_watcher_flow_log_resource.go} | 0 ...esource_arm_network_watcher.go => network_watcher_resource.go} | 0 ...{resource_arm_packet_capture.go => packet_capture_resource.go} | 0 ..._site_vpn_gateway.go => point_to_site_vpn_gateway_resource.go} | 0 ...t_connection.go => private_endpoint_connection_data_source.go} | 0 ...ource_arm_private_endpoint.go => private_endpoint_resource.go} | 0 ...rivate_link_service.go => private_link_service_data_source.go} | 0 ...o => private_link_service_endpoint_connections_data_source.go} | 0 ...m_private_link_service.go => private_link_service_resource.go} | 0 .../{data_source_public_ip.go => public_ip_data_source.go} | 0 ...source_public_ip_prefix.go => public_ip_prefix_data_source.go} | 0 ...ource_arm_public_ip_prefix.go => public_ip_prefix_resource.go} | 0 .../network/{resource_arm_public_ip.go => public_ip_resource.go} | 0 .../{data_source_public_ips.go => public_ips_data_source.go} | 0 .../services/network/{resource_arm_route.go => route_resource.go} | 0 .../{data_source_route_table.go => route_table_data_source.go} | 0 .../{resource_arm_route_table.go => route_table_resource.go} | 0 .../network/{data_source_subnet.go => subnet_data_source.go} | 0 ..._association.go => subnet_nat_gateway_association_resource.go} | 0 ...n.go => subnet_network_security_group_association_resource.go} | 0 .../network/{resource_arm_subnet.go => subnet_resource.go} | 0 ..._association.go => subnet_route_table_association_resource.go} | 0 ...ation_gateway_test.go => application_gateway_resource_test.go} | 0 ...oup_test.go => application_security_group_data_source_test.go} | 0 ..._group_test.go => application_security_group_resource_test.go} | 0 ...rce_arm_bastion_host_test.go => bastion_host_resource_test.go} | 0 ...st.go => express_route_circuit_authorization_resource_test.go} | 0 ..._circuit_test.go => express_route_circuit_data_source_test.go} | 0 ...ing_test.go => express_route_circuit_peering_resource_test.go} | 0 ...ute_circuit_test.go => express_route_circuit_resource_test.go} | 0 ...ute_gateway_test.go => express_route_gateway_resource_test.go} | 0 ...t.go => firewall_application_rule_collection_resource_test.go} | 0 ...{data_source_firewall_test.go => firewall_data_source_test.go} | 0 ...tion_test.go => firewall_nat_rule_collection_resource_test.go} | 0 ..._test.go => firewall_network_rule_collection_resource_test.go} | 0 .../{resource_arm_firewall_test.go => firewall_resource_test.go} | 0 ...t.go => loadbalancer_backend_address_pool_data_source_test.go} | 0 ...test.go => loadbalancer_backend_address_pool_resource_test.go} | 0 ...urce_loadbalancer_test.go => loadbalancer_data_source_test.go} | 0 ...er_nat_pool_test.go => loadbalancer_nat_pool_resource_test.go} | 0 ...er_nat_rule_test.go => loadbalancer_nat_rule_resource_test.go} | 0 ...d_rule_test.go => loadbalancer_outbound_rule_resource_test.go} | 0 ...balancer_probe_test.go => loadbalancer_probe_resource_test.go} | 0 ...rce_arm_loadbalancer_test.go => loadbalancer_resource_test.go} | 0 ...adbalancer_rule_test.go => loadbalancer_rule_resource_test.go} | 0 ...ork_gateway_test.go => local_network_gateway_resource_test.go} | 0 ...source_nat_gateway_test.go => nat_gateway_data_source_test.go} | 0 ...ource_arm_nat_gateway_test.go => nat_gateway_resource_test.go} | 0 ...onitor_test.go => network_connection_monitor_resource_test.go} | 0 ...n_test.go => network_ddos_protection_plan_data_source_test.go} | 0 ...plan_test.go => network_ddos_protection_plan_resource_test.go} | 0 ...rk_interface_application_gateway_association_resource_test.go} | 0 ...k_interface_backend_address_pool_association_resource_test.go} | 0 ...rk_interface_test.go => network_interface_data_source_test.go} | 0 ...go => network_interface_nat_rule_association_resource_test.go} | 0 ...twork_interface_test.go => network_interface_resource_test.go} | 0 ...et_capture_test.go => network_packet_capture_resource_test.go} | 0 ...m_network_profile_test.go => network_profile_resource_test.go} | 0 ...y_group_test.go => network_security_group_data_source_test.go} | 0 ...rity_group_test.go => network_security_group_resource_test.go} | 0 ...curity_rule_test.go => network_security_rule_resource_test.go} | 0 ...vice_tags_test.go => network_service_tags_data_source_test.go} | 0 ...etwork_watcher_test.go => network_watcher_data_source_test.go} | 0 ...flow_log_test.go => network_watcher_flow_log_resource_test.go} | 0 ...m_network_watcher_test.go => network_watcher_resource_test.go} | 0 ...arm_packet_capture_test.go => packet_capture_resource_test.go} | 0 ...gateway_test.go => point_to_site_vpn_gateway_resource_test.go} | 0 ...on_test.go => private_endpoint_connection_data_source_test.go} | 0 ...private_endpoint_test.go => private_endpoint_resource_test.go} | 0 ...k_service_test.go => private_link_service_data_source_test.go} | 0 ...private_link_service_endpoint_connections_data_source_test.go} | 0 ...link_service_test.go => private_link_service_resource_test.go} | 0 ...ata_source_public_ip_test.go => public_ip_data_source_test.go} | 0 ...lic_ip_prefix_test.go => public_ip_prefix_data_source_test.go} | 0 ...public_ip_prefix_test.go => public_ip_prefix_resource_test.go} | 0 ...{resource_arm_public_ip_test.go => public_ip_resource_test.go} | 0 ...a_source_public_ips_test.go => public_ips_data_source_test.go} | 0 .../tests/{resource_arm_route_test.go => route_resource_test.go} | 0 ...source_route_table_test.go => route_table_data_source_test.go} | 0 ...ource_arm_route_table_test.go => route_table_resource_test.go} | 0 .../{data_source_subnet_test.go => subnet_data_source_test.go} | 0 ...on_test.go => subnet_nat_gateway_association_resource_test.go} | 0 ...=> subnet_network_security_group_association_resource_test.go} | 0 .../{resource_arm_subnet_test.go => subnet_resource_test.go} | 0 ...on_test.go => subnet_route_table_association_resource_test.go} | 0 ...connection_test.go => virtual_hub_connection_resource_test.go} | 0 ...source_virtual_hub_test.go => virtual_hub_data_source_test.go} | 0 ...ource_arm_virtual_hub_test.go => virtual_hub_resource_test.go} | 0 ...irtual_network_test.go => virtual_network_data_source_test.go} | 0 ....go => virtual_network_gateway_connection_data_source_test.go} | 0 ...est.go => virtual_network_gateway_connection_resource_test.go} | 0 ...ateway_test.go => virtual_network_gateway_data_source_test.go} | 0 ...k_gateway_test.go => virtual_network_gateway_resource_test.go} | 0 ...k_peering_test.go => virtual_network_peering_resource_test.go} | 0 ...m_virtual_network_test.go => virtual_network_resource_test.go} | 0 ...ource_arm_virtual_wan_test.go => virtual_wan_resource_test.go} | 0 ...ource_arm_vpn_gateway_test.go => vpn_gateway_resource_test.go} | 0 ...guration_test.go => vpn_server_configuration_resource_test.go} | 0 ...y_test.go => web_application_firewall_policy_resource_test.go} | 0 ...rtual_hub_connection.go => virtual_hub_connection_resource.go} | 0 .../{data_source_virtual_hub.go => virtual_hub_data_source.go} | 0 .../{resource_arm_virtual_hub.go => virtual_hub_resource.go} | 0 ...a_source_virtual_network.go => virtual_network_data_source.go} | 0 ...ction.go => virtual_network_gateway_connection_data_source.go} | 0 ...nnection.go => virtual_network_gateway_connection_resource.go} | 0 ..._network_gateway.go => virtual_network_gateway_data_source.go} | 0 ...ual_network_gateway.go => virtual_network_gateway_resource.go} | 0 ...ual_network_peering.go => virtual_network_peering_resource.go} | 0 ...esource_arm_virtual_network.go => virtual_network_resource.go} | 0 .../{resource_arm_virtual_wan.go => virtual_wan_resource.go} | 0 .../{resource_arm_vpn_gateway.go => vpn_gateway_resource.go} | 0 ...rver_configuration.go => vpn_server_configuration_resource.go} | 0 ...wall_policy.go => web_application_firewall_policy_resource.go} | 0 154 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/network/{resource_arm_application_gateway.go => application_gateway_resource.go} (100%) rename azurerm/internal/services/network/{data_source_application_security_group.go => application_security_group_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_application_security_group.go => application_security_group_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_bastion_host.go => bastion_host_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_express_route_circuit_authorization.go => express_route_circuit_authorization_resource.go} (100%) rename azurerm/internal/services/network/{data_source_express_route_circuit.go => express_route_circuit_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_express_route_circuit_peering.go => express_route_circuit_peering_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_express_route_circuit.go => express_route_circuit_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_express_route_gateway.go => express_route_gateway_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_firewall_application_rule_collection.go => firewall_application_rule_collection_resource.go} (100%) rename azurerm/internal/services/network/{data_source_firewall.go => firewall_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_firewall_nat_rule_collection.go => firewall_nat_rule_collection_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_firewall_network_rule_collection.go => firewall_network_rule_collection_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_firewall.go => firewall_resource.go} (100%) rename azurerm/internal/services/network/{data_source_lb_backend_address_pool.go => lb_backend_address_pool_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_lb_backend_address_pool.go => lb_backend_address_pool_resource.go} (100%) rename azurerm/internal/services/network/{data_source_lb.go => lb_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_lb_nat_pool.go => lb_nat_pool_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_lb_nat_rule.go => lb_nat_rule_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_lb_outbound_rule.go => lb_outbound_rule_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_lb_probe.go => lb_probe_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_lb.go => lb_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_lb_rule.go => lb_rule_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_local_network_gateway.go => local_network_gateway_resource.go} (100%) rename azurerm/internal/services/network/{data_source_nat_gateway.go => nat_gateway_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_nat_gateway.go => nat_gateway_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_network_connection_monitor.go => network_connection_monitor_resource.go} (100%) rename azurerm/internal/services/network/{data_source_network_ddos_protection_plan.go => network_ddos_protection_plan_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_network_ddos_protection_plan.go => network_ddos_protection_plan_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_network_interface_application_gateway_association.go => network_interface_application_gateway_association_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_network_interface_backend_address_pool_association.go => network_interface_backend_address_pool_association_resource.go} (100%) rename azurerm/internal/services/network/{data_source_network_interface.go => network_interface_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_network_interface_nat_rule_association.go => network_interface_nat_rule_association_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_network_interface.go => network_interface_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_network_packet_capture.go => network_packet_capture_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_network_profile.go => network_profile_resource.go} (100%) rename azurerm/internal/services/network/{data_source_network_security_group.go => network_security_group_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_network_security_group.go => network_security_group_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_network_security_rule.go => network_security_rule_resource.go} (100%) rename azurerm/internal/services/network/{data_source_network_service_tags.go => network_service_tags_data_source.go} (100%) rename azurerm/internal/services/network/{data_source_network_watcher.go => network_watcher_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_network_watcher_flow_log.go => network_watcher_flow_log_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_network_watcher.go => network_watcher_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_packet_capture.go => packet_capture_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_point_to_site_vpn_gateway.go => point_to_site_vpn_gateway_resource.go} (100%) rename azurerm/internal/services/network/{data_source_private_endpoint_connection.go => private_endpoint_connection_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_private_endpoint.go => private_endpoint_resource.go} (100%) rename azurerm/internal/services/network/{data_source_private_link_service.go => private_link_service_data_source.go} (100%) rename azurerm/internal/services/network/{data_source_private_link_service_endpoint_connections.go => private_link_service_endpoint_connections_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_private_link_service.go => private_link_service_resource.go} (100%) rename azurerm/internal/services/network/{data_source_public_ip.go => public_ip_data_source.go} (100%) rename azurerm/internal/services/network/{data_source_public_ip_prefix.go => public_ip_prefix_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_public_ip_prefix.go => public_ip_prefix_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_public_ip.go => public_ip_resource.go} (100%) rename azurerm/internal/services/network/{data_source_public_ips.go => public_ips_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_route.go => route_resource.go} (100%) rename azurerm/internal/services/network/{data_source_route_table.go => route_table_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_route_table.go => route_table_resource.go} (100%) rename azurerm/internal/services/network/{data_source_subnet.go => subnet_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_subnet_nat_gateway_association.go => subnet_nat_gateway_association_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_subnet_network_security_group_association.go => subnet_network_security_group_association_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_subnet.go => subnet_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_subnet_route_table_association.go => subnet_route_table_association_resource.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_application_gateway_test.go => application_gateway_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_application_security_group_test.go => application_security_group_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_application_security_group_test.go => application_security_group_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_bastion_host_test.go => bastion_host_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_express_route_circuit_authorization_test.go => express_route_circuit_authorization_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_express_route_circuit_test.go => express_route_circuit_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_express_route_circuit_peering_test.go => express_route_circuit_peering_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_express_route_circuit_test.go => express_route_circuit_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_express_route_gateway_test.go => express_route_gateway_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_firewall_application_rule_collection_test.go => firewall_application_rule_collection_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_firewall_test.go => firewall_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_firewall_nat_rule_collection_test.go => firewall_nat_rule_collection_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_firewall_network_rule_collection_test.go => firewall_network_rule_collection_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_firewall_test.go => firewall_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_loadbalancer_backend_address_pool_test.go => loadbalancer_backend_address_pool_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_loadbalancer_backend_address_pool_test.go => loadbalancer_backend_address_pool_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_loadbalancer_test.go => loadbalancer_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_loadbalancer_nat_pool_test.go => loadbalancer_nat_pool_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_loadbalancer_nat_rule_test.go => loadbalancer_nat_rule_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_loadbalancer_outbound_rule_test.go => loadbalancer_outbound_rule_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_loadbalancer_probe_test.go => loadbalancer_probe_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_loadbalancer_test.go => loadbalancer_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_loadbalancer_rule_test.go => loadbalancer_rule_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_local_network_gateway_test.go => local_network_gateway_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_nat_gateway_test.go => nat_gateway_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_nat_gateway_test.go => nat_gateway_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_network_connection_monitor_test.go => network_connection_monitor_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_network_ddos_protection_plan_test.go => network_ddos_protection_plan_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_network_ddos_protection_plan_test.go => network_ddos_protection_plan_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_network_interface_application_gateway_association_test.go => network_interface_application_gateway_association_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_network_interface_backend_address_pool_association_test.go => network_interface_backend_address_pool_association_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_network_interface_test.go => network_interface_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_network_interface_nat_rule_association_test.go => network_interface_nat_rule_association_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_network_interface_test.go => network_interface_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_network_packet_capture_test.go => network_packet_capture_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_network_profile_test.go => network_profile_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_network_security_group_test.go => network_security_group_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_network_security_group_test.go => network_security_group_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_network_security_rule_test.go => network_security_rule_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_network_service_tags_test.go => network_service_tags_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_network_watcher_test.go => network_watcher_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_network_watcher_flow_log_test.go => network_watcher_flow_log_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_network_watcher_test.go => network_watcher_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_packet_capture_test.go => packet_capture_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_point_to_site_vpn_gateway_test.go => point_to_site_vpn_gateway_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_private_endpoint_connection_test.go => private_endpoint_connection_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_private_endpoint_test.go => private_endpoint_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_private_link_service_test.go => private_link_service_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_private_link_service_endpoint_connections_test.go => private_link_service_endpoint_connections_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_private_link_service_test.go => private_link_service_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_public_ip_test.go => public_ip_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_public_ip_prefix_test.go => public_ip_prefix_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_public_ip_prefix_test.go => public_ip_prefix_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_public_ip_test.go => public_ip_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_public_ips_test.go => public_ips_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_route_test.go => route_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_route_table_test.go => route_table_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_route_table_test.go => route_table_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_subnet_test.go => subnet_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_subnet_nat_gateway_association_test.go => subnet_nat_gateway_association_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_subnet_network_security_group_association_test.go => subnet_network_security_group_association_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_subnet_test.go => subnet_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_subnet_route_table_association_test.go => subnet_route_table_association_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_virtual_hub_connection_test.go => virtual_hub_connection_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_virtual_hub_test.go => virtual_hub_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_virtual_hub_test.go => virtual_hub_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_virtual_network_test.go => virtual_network_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_virtual_network_gateway_connection_test.go => virtual_network_gateway_connection_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_virtual_network_gateway_connection_test.go => virtual_network_gateway_connection_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{data_source_virtual_network_gateway_test.go => virtual_network_gateway_data_source_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_virtual_network_gateway_test.go => virtual_network_gateway_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_virtual_network_peering_test.go => virtual_network_peering_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_virtual_network_test.go => virtual_network_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_virtual_wan_test.go => virtual_wan_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_vpn_gateway_test.go => vpn_gateway_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_vpn_server_configuration_test.go => vpn_server_configuration_resource_test.go} (100%) rename azurerm/internal/services/network/tests/{resource_arm_web_application_firewall_policy_test.go => web_application_firewall_policy_resource_test.go} (100%) rename azurerm/internal/services/network/{resource_arm_virtual_hub_connection.go => virtual_hub_connection_resource.go} (100%) rename azurerm/internal/services/network/{data_source_virtual_hub.go => virtual_hub_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_virtual_hub.go => virtual_hub_resource.go} (100%) rename azurerm/internal/services/network/{data_source_virtual_network.go => virtual_network_data_source.go} (100%) rename azurerm/internal/services/network/{data_source_virtual_network_gateway_connection.go => virtual_network_gateway_connection_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_virtual_network_gateway_connection.go => virtual_network_gateway_connection_resource.go} (100%) rename azurerm/internal/services/network/{data_source_virtual_network_gateway.go => virtual_network_gateway_data_source.go} (100%) rename azurerm/internal/services/network/{resource_arm_virtual_network_gateway.go => virtual_network_gateway_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_virtual_network_peering.go => virtual_network_peering_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_virtual_network.go => virtual_network_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_virtual_wan.go => virtual_wan_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_vpn_gateway.go => vpn_gateway_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_vpn_server_configuration.go => vpn_server_configuration_resource.go} (100%) rename azurerm/internal/services/network/{resource_arm_web_application_firewall_policy.go => web_application_firewall_policy_resource.go} (100%) diff --git a/azurerm/internal/services/network/resource_arm_application_gateway.go b/azurerm/internal/services/network/application_gateway_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_application_gateway.go rename to azurerm/internal/services/network/application_gateway_resource.go diff --git a/azurerm/internal/services/network/data_source_application_security_group.go b/azurerm/internal/services/network/application_security_group_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_application_security_group.go rename to azurerm/internal/services/network/application_security_group_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_application_security_group.go b/azurerm/internal/services/network/application_security_group_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_application_security_group.go rename to azurerm/internal/services/network/application_security_group_resource.go diff --git a/azurerm/internal/services/network/resource_arm_bastion_host.go b/azurerm/internal/services/network/bastion_host_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_bastion_host.go rename to azurerm/internal/services/network/bastion_host_resource.go diff --git a/azurerm/internal/services/network/resource_arm_express_route_circuit_authorization.go b/azurerm/internal/services/network/express_route_circuit_authorization_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_express_route_circuit_authorization.go rename to azurerm/internal/services/network/express_route_circuit_authorization_resource.go diff --git a/azurerm/internal/services/network/data_source_express_route_circuit.go b/azurerm/internal/services/network/express_route_circuit_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_express_route_circuit.go rename to azurerm/internal/services/network/express_route_circuit_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_express_route_circuit_peering.go b/azurerm/internal/services/network/express_route_circuit_peering_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_express_route_circuit_peering.go rename to azurerm/internal/services/network/express_route_circuit_peering_resource.go diff --git a/azurerm/internal/services/network/resource_arm_express_route_circuit.go b/azurerm/internal/services/network/express_route_circuit_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_express_route_circuit.go rename to azurerm/internal/services/network/express_route_circuit_resource.go diff --git a/azurerm/internal/services/network/resource_arm_express_route_gateway.go b/azurerm/internal/services/network/express_route_gateway_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_express_route_gateway.go rename to azurerm/internal/services/network/express_route_gateway_resource.go diff --git a/azurerm/internal/services/network/resource_arm_firewall_application_rule_collection.go b/azurerm/internal/services/network/firewall_application_rule_collection_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_firewall_application_rule_collection.go rename to azurerm/internal/services/network/firewall_application_rule_collection_resource.go diff --git a/azurerm/internal/services/network/data_source_firewall.go b/azurerm/internal/services/network/firewall_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_firewall.go rename to azurerm/internal/services/network/firewall_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_firewall_nat_rule_collection.go b/azurerm/internal/services/network/firewall_nat_rule_collection_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_firewall_nat_rule_collection.go rename to azurerm/internal/services/network/firewall_nat_rule_collection_resource.go diff --git a/azurerm/internal/services/network/resource_arm_firewall_network_rule_collection.go b/azurerm/internal/services/network/firewall_network_rule_collection_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_firewall_network_rule_collection.go rename to azurerm/internal/services/network/firewall_network_rule_collection_resource.go diff --git a/azurerm/internal/services/network/resource_arm_firewall.go b/azurerm/internal/services/network/firewall_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_firewall.go rename to azurerm/internal/services/network/firewall_resource.go diff --git a/azurerm/internal/services/network/data_source_lb_backend_address_pool.go b/azurerm/internal/services/network/lb_backend_address_pool_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_lb_backend_address_pool.go rename to azurerm/internal/services/network/lb_backend_address_pool_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_lb_backend_address_pool.go b/azurerm/internal/services/network/lb_backend_address_pool_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_lb_backend_address_pool.go rename to azurerm/internal/services/network/lb_backend_address_pool_resource.go diff --git a/azurerm/internal/services/network/data_source_lb.go b/azurerm/internal/services/network/lb_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_lb.go rename to azurerm/internal/services/network/lb_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_lb_nat_pool.go b/azurerm/internal/services/network/lb_nat_pool_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_lb_nat_pool.go rename to azurerm/internal/services/network/lb_nat_pool_resource.go diff --git a/azurerm/internal/services/network/resource_arm_lb_nat_rule.go b/azurerm/internal/services/network/lb_nat_rule_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_lb_nat_rule.go rename to azurerm/internal/services/network/lb_nat_rule_resource.go diff --git a/azurerm/internal/services/network/resource_arm_lb_outbound_rule.go b/azurerm/internal/services/network/lb_outbound_rule_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_lb_outbound_rule.go rename to azurerm/internal/services/network/lb_outbound_rule_resource.go diff --git a/azurerm/internal/services/network/resource_arm_lb_probe.go b/azurerm/internal/services/network/lb_probe_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_lb_probe.go rename to azurerm/internal/services/network/lb_probe_resource.go diff --git a/azurerm/internal/services/network/resource_arm_lb.go b/azurerm/internal/services/network/lb_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_lb.go rename to azurerm/internal/services/network/lb_resource.go diff --git a/azurerm/internal/services/network/resource_arm_lb_rule.go b/azurerm/internal/services/network/lb_rule_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_lb_rule.go rename to azurerm/internal/services/network/lb_rule_resource.go diff --git a/azurerm/internal/services/network/resource_arm_local_network_gateway.go b/azurerm/internal/services/network/local_network_gateway_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_local_network_gateway.go rename to azurerm/internal/services/network/local_network_gateway_resource.go diff --git a/azurerm/internal/services/network/data_source_nat_gateway.go b/azurerm/internal/services/network/nat_gateway_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_nat_gateway.go rename to azurerm/internal/services/network/nat_gateway_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_nat_gateway.go b/azurerm/internal/services/network/nat_gateway_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_nat_gateway.go rename to azurerm/internal/services/network/nat_gateway_resource.go diff --git a/azurerm/internal/services/network/resource_arm_network_connection_monitor.go b/azurerm/internal/services/network/network_connection_monitor_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_network_connection_monitor.go rename to azurerm/internal/services/network/network_connection_monitor_resource.go diff --git a/azurerm/internal/services/network/data_source_network_ddos_protection_plan.go b/azurerm/internal/services/network/network_ddos_protection_plan_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_network_ddos_protection_plan.go rename to azurerm/internal/services/network/network_ddos_protection_plan_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_network_ddos_protection_plan.go b/azurerm/internal/services/network/network_ddos_protection_plan_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_network_ddos_protection_plan.go rename to azurerm/internal/services/network/network_ddos_protection_plan_resource.go diff --git a/azurerm/internal/services/network/resource_arm_network_interface_application_gateway_association.go b/azurerm/internal/services/network/network_interface_application_gateway_association_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_network_interface_application_gateway_association.go rename to azurerm/internal/services/network/network_interface_application_gateway_association_resource.go diff --git a/azurerm/internal/services/network/resource_arm_network_interface_backend_address_pool_association.go b/azurerm/internal/services/network/network_interface_backend_address_pool_association_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_network_interface_backend_address_pool_association.go rename to azurerm/internal/services/network/network_interface_backend_address_pool_association_resource.go diff --git a/azurerm/internal/services/network/data_source_network_interface.go b/azurerm/internal/services/network/network_interface_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_network_interface.go rename to azurerm/internal/services/network/network_interface_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_network_interface_nat_rule_association.go b/azurerm/internal/services/network/network_interface_nat_rule_association_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_network_interface_nat_rule_association.go rename to azurerm/internal/services/network/network_interface_nat_rule_association_resource.go diff --git a/azurerm/internal/services/network/resource_arm_network_interface.go b/azurerm/internal/services/network/network_interface_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_network_interface.go rename to azurerm/internal/services/network/network_interface_resource.go diff --git a/azurerm/internal/services/network/resource_arm_network_packet_capture.go b/azurerm/internal/services/network/network_packet_capture_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_network_packet_capture.go rename to azurerm/internal/services/network/network_packet_capture_resource.go diff --git a/azurerm/internal/services/network/resource_arm_network_profile.go b/azurerm/internal/services/network/network_profile_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_network_profile.go rename to azurerm/internal/services/network/network_profile_resource.go diff --git a/azurerm/internal/services/network/data_source_network_security_group.go b/azurerm/internal/services/network/network_security_group_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_network_security_group.go rename to azurerm/internal/services/network/network_security_group_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_network_security_group.go b/azurerm/internal/services/network/network_security_group_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_network_security_group.go rename to azurerm/internal/services/network/network_security_group_resource.go diff --git a/azurerm/internal/services/network/resource_arm_network_security_rule.go b/azurerm/internal/services/network/network_security_rule_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_network_security_rule.go rename to azurerm/internal/services/network/network_security_rule_resource.go diff --git a/azurerm/internal/services/network/data_source_network_service_tags.go b/azurerm/internal/services/network/network_service_tags_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_network_service_tags.go rename to azurerm/internal/services/network/network_service_tags_data_source.go diff --git a/azurerm/internal/services/network/data_source_network_watcher.go b/azurerm/internal/services/network/network_watcher_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_network_watcher.go rename to azurerm/internal/services/network/network_watcher_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_network_watcher_flow_log.go b/azurerm/internal/services/network/network_watcher_flow_log_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_network_watcher_flow_log.go rename to azurerm/internal/services/network/network_watcher_flow_log_resource.go diff --git a/azurerm/internal/services/network/resource_arm_network_watcher.go b/azurerm/internal/services/network/network_watcher_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_network_watcher.go rename to azurerm/internal/services/network/network_watcher_resource.go diff --git a/azurerm/internal/services/network/resource_arm_packet_capture.go b/azurerm/internal/services/network/packet_capture_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_packet_capture.go rename to azurerm/internal/services/network/packet_capture_resource.go diff --git a/azurerm/internal/services/network/resource_arm_point_to_site_vpn_gateway.go b/azurerm/internal/services/network/point_to_site_vpn_gateway_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_point_to_site_vpn_gateway.go rename to azurerm/internal/services/network/point_to_site_vpn_gateway_resource.go diff --git a/azurerm/internal/services/network/data_source_private_endpoint_connection.go b/azurerm/internal/services/network/private_endpoint_connection_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_private_endpoint_connection.go rename to azurerm/internal/services/network/private_endpoint_connection_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_private_endpoint.go b/azurerm/internal/services/network/private_endpoint_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_private_endpoint.go rename to azurerm/internal/services/network/private_endpoint_resource.go diff --git a/azurerm/internal/services/network/data_source_private_link_service.go b/azurerm/internal/services/network/private_link_service_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_private_link_service.go rename to azurerm/internal/services/network/private_link_service_data_source.go diff --git a/azurerm/internal/services/network/data_source_private_link_service_endpoint_connections.go b/azurerm/internal/services/network/private_link_service_endpoint_connections_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_private_link_service_endpoint_connections.go rename to azurerm/internal/services/network/private_link_service_endpoint_connections_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_private_link_service.go b/azurerm/internal/services/network/private_link_service_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_private_link_service.go rename to azurerm/internal/services/network/private_link_service_resource.go diff --git a/azurerm/internal/services/network/data_source_public_ip.go b/azurerm/internal/services/network/public_ip_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_public_ip.go rename to azurerm/internal/services/network/public_ip_data_source.go diff --git a/azurerm/internal/services/network/data_source_public_ip_prefix.go b/azurerm/internal/services/network/public_ip_prefix_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_public_ip_prefix.go rename to azurerm/internal/services/network/public_ip_prefix_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_public_ip_prefix.go b/azurerm/internal/services/network/public_ip_prefix_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_public_ip_prefix.go rename to azurerm/internal/services/network/public_ip_prefix_resource.go diff --git a/azurerm/internal/services/network/resource_arm_public_ip.go b/azurerm/internal/services/network/public_ip_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_public_ip.go rename to azurerm/internal/services/network/public_ip_resource.go diff --git a/azurerm/internal/services/network/data_source_public_ips.go b/azurerm/internal/services/network/public_ips_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_public_ips.go rename to azurerm/internal/services/network/public_ips_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_route.go b/azurerm/internal/services/network/route_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_route.go rename to azurerm/internal/services/network/route_resource.go diff --git a/azurerm/internal/services/network/data_source_route_table.go b/azurerm/internal/services/network/route_table_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_route_table.go rename to azurerm/internal/services/network/route_table_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_route_table.go b/azurerm/internal/services/network/route_table_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_route_table.go rename to azurerm/internal/services/network/route_table_resource.go diff --git a/azurerm/internal/services/network/data_source_subnet.go b/azurerm/internal/services/network/subnet_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_subnet.go rename to azurerm/internal/services/network/subnet_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_subnet_nat_gateway_association.go b/azurerm/internal/services/network/subnet_nat_gateway_association_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_subnet_nat_gateway_association.go rename to azurerm/internal/services/network/subnet_nat_gateway_association_resource.go diff --git a/azurerm/internal/services/network/resource_arm_subnet_network_security_group_association.go b/azurerm/internal/services/network/subnet_network_security_group_association_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_subnet_network_security_group_association.go rename to azurerm/internal/services/network/subnet_network_security_group_association_resource.go diff --git a/azurerm/internal/services/network/resource_arm_subnet.go b/azurerm/internal/services/network/subnet_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_subnet.go rename to azurerm/internal/services/network/subnet_resource.go diff --git a/azurerm/internal/services/network/resource_arm_subnet_route_table_association.go b/azurerm/internal/services/network/subnet_route_table_association_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_subnet_route_table_association.go rename to azurerm/internal/services/network/subnet_route_table_association_resource.go diff --git a/azurerm/internal/services/network/tests/resource_arm_application_gateway_test.go b/azurerm/internal/services/network/tests/application_gateway_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_application_gateway_test.go rename to azurerm/internal/services/network/tests/application_gateway_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_application_security_group_test.go b/azurerm/internal/services/network/tests/application_security_group_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_application_security_group_test.go rename to azurerm/internal/services/network/tests/application_security_group_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_application_security_group_test.go b/azurerm/internal/services/network/tests/application_security_group_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_application_security_group_test.go rename to azurerm/internal/services/network/tests/application_security_group_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_bastion_host_test.go b/azurerm/internal/services/network/tests/bastion_host_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_bastion_host_test.go rename to azurerm/internal/services/network/tests/bastion_host_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_authorization_test.go b/azurerm/internal/services/network/tests/express_route_circuit_authorization_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_express_route_circuit_authorization_test.go rename to azurerm/internal/services/network/tests/express_route_circuit_authorization_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_express_route_circuit_test.go b/azurerm/internal/services/network/tests/express_route_circuit_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_express_route_circuit_test.go rename to azurerm/internal/services/network/tests/express_route_circuit_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go b/azurerm/internal/services/network/tests/express_route_circuit_peering_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_express_route_circuit_peering_test.go rename to azurerm/internal/services/network/tests/express_route_circuit_peering_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go b/azurerm/internal/services/network/tests/express_route_circuit_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_express_route_circuit_test.go rename to azurerm/internal/services/network/tests/express_route_circuit_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go b/azurerm/internal/services/network/tests/express_route_gateway_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_express_route_gateway_test.go rename to azurerm/internal/services/network/tests/express_route_gateway_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_firewall_application_rule_collection_test.go b/azurerm/internal/services/network/tests/firewall_application_rule_collection_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_firewall_application_rule_collection_test.go rename to azurerm/internal/services/network/tests/firewall_application_rule_collection_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_firewall_test.go b/azurerm/internal/services/network/tests/firewall_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_firewall_test.go rename to azurerm/internal/services/network/tests/firewall_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_firewall_nat_rule_collection_test.go b/azurerm/internal/services/network/tests/firewall_nat_rule_collection_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_firewall_nat_rule_collection_test.go rename to azurerm/internal/services/network/tests/firewall_nat_rule_collection_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_firewall_network_rule_collection_test.go b/azurerm/internal/services/network/tests/firewall_network_rule_collection_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_firewall_network_rule_collection_test.go rename to azurerm/internal/services/network/tests/firewall_network_rule_collection_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_firewall_test.go b/azurerm/internal/services/network/tests/firewall_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_firewall_test.go rename to azurerm/internal/services/network/tests/firewall_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_loadbalancer_backend_address_pool_test.go b/azurerm/internal/services/network/tests/loadbalancer_backend_address_pool_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_loadbalancer_backend_address_pool_test.go rename to azurerm/internal/services/network/tests/loadbalancer_backend_address_pool_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_backend_address_pool_test.go b/azurerm/internal/services/network/tests/loadbalancer_backend_address_pool_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_loadbalancer_backend_address_pool_test.go rename to azurerm/internal/services/network/tests/loadbalancer_backend_address_pool_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_loadbalancer_test.go b/azurerm/internal/services/network/tests/loadbalancer_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_loadbalancer_test.go rename to azurerm/internal/services/network/tests/loadbalancer_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_nat_pool_test.go b/azurerm/internal/services/network/tests/loadbalancer_nat_pool_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_loadbalancer_nat_pool_test.go rename to azurerm/internal/services/network/tests/loadbalancer_nat_pool_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_nat_rule_test.go b/azurerm/internal/services/network/tests/loadbalancer_nat_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_loadbalancer_nat_rule_test.go rename to azurerm/internal/services/network/tests/loadbalancer_nat_rule_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_outbound_rule_test.go b/azurerm/internal/services/network/tests/loadbalancer_outbound_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_loadbalancer_outbound_rule_test.go rename to azurerm/internal/services/network/tests/loadbalancer_outbound_rule_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_probe_test.go b/azurerm/internal/services/network/tests/loadbalancer_probe_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_loadbalancer_probe_test.go rename to azurerm/internal/services/network/tests/loadbalancer_probe_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_test.go b/azurerm/internal/services/network/tests/loadbalancer_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_loadbalancer_test.go rename to azurerm/internal/services/network/tests/loadbalancer_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_loadbalancer_rule_test.go b/azurerm/internal/services/network/tests/loadbalancer_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_loadbalancer_rule_test.go rename to azurerm/internal/services/network/tests/loadbalancer_rule_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_local_network_gateway_test.go b/azurerm/internal/services/network/tests/local_network_gateway_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_local_network_gateway_test.go rename to azurerm/internal/services/network/tests/local_network_gateway_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_nat_gateway_test.go b/azurerm/internal/services/network/tests/nat_gateway_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_nat_gateway_test.go rename to azurerm/internal/services/network/tests/nat_gateway_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_nat_gateway_test.go b/azurerm/internal/services/network/tests/nat_gateway_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_nat_gateway_test.go rename to azurerm/internal/services/network/tests/nat_gateway_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_network_connection_monitor_test.go b/azurerm/internal/services/network/tests/network_connection_monitor_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_network_connection_monitor_test.go rename to azurerm/internal/services/network/tests/network_connection_monitor_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_network_ddos_protection_plan_test.go b/azurerm/internal/services/network/tests/network_ddos_protection_plan_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_network_ddos_protection_plan_test.go rename to azurerm/internal/services/network/tests/network_ddos_protection_plan_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_network_ddos_protection_plan_test.go b/azurerm/internal/services/network/tests/network_ddos_protection_plan_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_network_ddos_protection_plan_test.go rename to azurerm/internal/services/network/tests/network_ddos_protection_plan_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_network_interface_application_gateway_association_test.go b/azurerm/internal/services/network/tests/network_interface_application_gateway_association_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_network_interface_application_gateway_association_test.go rename to azurerm/internal/services/network/tests/network_interface_application_gateway_association_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_network_interface_backend_address_pool_association_test.go b/azurerm/internal/services/network/tests/network_interface_backend_address_pool_association_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_network_interface_backend_address_pool_association_test.go rename to azurerm/internal/services/network/tests/network_interface_backend_address_pool_association_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_network_interface_test.go b/azurerm/internal/services/network/tests/network_interface_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_network_interface_test.go rename to azurerm/internal/services/network/tests/network_interface_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_network_interface_nat_rule_association_test.go b/azurerm/internal/services/network/tests/network_interface_nat_rule_association_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_network_interface_nat_rule_association_test.go rename to azurerm/internal/services/network/tests/network_interface_nat_rule_association_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_network_interface_test.go b/azurerm/internal/services/network/tests/network_interface_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_network_interface_test.go rename to azurerm/internal/services/network/tests/network_interface_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_network_packet_capture_test.go b/azurerm/internal/services/network/tests/network_packet_capture_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_network_packet_capture_test.go rename to azurerm/internal/services/network/tests/network_packet_capture_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_network_profile_test.go b/azurerm/internal/services/network/tests/network_profile_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_network_profile_test.go rename to azurerm/internal/services/network/tests/network_profile_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_network_security_group_test.go b/azurerm/internal/services/network/tests/network_security_group_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_network_security_group_test.go rename to azurerm/internal/services/network/tests/network_security_group_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_network_security_group_test.go b/azurerm/internal/services/network/tests/network_security_group_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_network_security_group_test.go rename to azurerm/internal/services/network/tests/network_security_group_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_network_security_rule_test.go b/azurerm/internal/services/network/tests/network_security_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_network_security_rule_test.go rename to azurerm/internal/services/network/tests/network_security_rule_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_network_service_tags_test.go b/azurerm/internal/services/network/tests/network_service_tags_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_network_service_tags_test.go rename to azurerm/internal/services/network/tests/network_service_tags_data_source_test.go diff --git a/azurerm/internal/services/network/tests/data_source_network_watcher_test.go b/azurerm/internal/services/network/tests/network_watcher_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_network_watcher_test.go rename to azurerm/internal/services/network/tests/network_watcher_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_network_watcher_flow_log_test.go b/azurerm/internal/services/network/tests/network_watcher_flow_log_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_network_watcher_flow_log_test.go rename to azurerm/internal/services/network/tests/network_watcher_flow_log_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_network_watcher_test.go b/azurerm/internal/services/network/tests/network_watcher_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_network_watcher_test.go rename to azurerm/internal/services/network/tests/network_watcher_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_packet_capture_test.go b/azurerm/internal/services/network/tests/packet_capture_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_packet_capture_test.go rename to azurerm/internal/services/network/tests/packet_capture_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_point_to_site_vpn_gateway_test.go b/azurerm/internal/services/network/tests/point_to_site_vpn_gateway_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_point_to_site_vpn_gateway_test.go rename to azurerm/internal/services/network/tests/point_to_site_vpn_gateway_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_private_endpoint_connection_test.go b/azurerm/internal/services/network/tests/private_endpoint_connection_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_private_endpoint_connection_test.go rename to azurerm/internal/services/network/tests/private_endpoint_connection_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_private_endpoint_test.go b/azurerm/internal/services/network/tests/private_endpoint_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_private_endpoint_test.go rename to azurerm/internal/services/network/tests/private_endpoint_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_private_link_service_test.go b/azurerm/internal/services/network/tests/private_link_service_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_private_link_service_test.go rename to azurerm/internal/services/network/tests/private_link_service_data_source_test.go diff --git a/azurerm/internal/services/network/tests/data_source_private_link_service_endpoint_connections_test.go b/azurerm/internal/services/network/tests/private_link_service_endpoint_connections_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_private_link_service_endpoint_connections_test.go rename to azurerm/internal/services/network/tests/private_link_service_endpoint_connections_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_private_link_service_test.go b/azurerm/internal/services/network/tests/private_link_service_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_private_link_service_test.go rename to azurerm/internal/services/network/tests/private_link_service_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_public_ip_test.go b/azurerm/internal/services/network/tests/public_ip_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_public_ip_test.go rename to azurerm/internal/services/network/tests/public_ip_data_source_test.go diff --git a/azurerm/internal/services/network/tests/data_source_public_ip_prefix_test.go b/azurerm/internal/services/network/tests/public_ip_prefix_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_public_ip_prefix_test.go rename to azurerm/internal/services/network/tests/public_ip_prefix_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_public_ip_prefix_test.go b/azurerm/internal/services/network/tests/public_ip_prefix_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_public_ip_prefix_test.go rename to azurerm/internal/services/network/tests/public_ip_prefix_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_public_ip_test.go b/azurerm/internal/services/network/tests/public_ip_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_public_ip_test.go rename to azurerm/internal/services/network/tests/public_ip_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_public_ips_test.go b/azurerm/internal/services/network/tests/public_ips_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_public_ips_test.go rename to azurerm/internal/services/network/tests/public_ips_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_route_test.go b/azurerm/internal/services/network/tests/route_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_route_test.go rename to azurerm/internal/services/network/tests/route_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_route_table_test.go b/azurerm/internal/services/network/tests/route_table_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_route_table_test.go rename to azurerm/internal/services/network/tests/route_table_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_route_table_test.go b/azurerm/internal/services/network/tests/route_table_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_route_table_test.go rename to azurerm/internal/services/network/tests/route_table_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_subnet_test.go b/azurerm/internal/services/network/tests/subnet_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_subnet_test.go rename to azurerm/internal/services/network/tests/subnet_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_subnet_nat_gateway_association_test.go b/azurerm/internal/services/network/tests/subnet_nat_gateway_association_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_subnet_nat_gateway_association_test.go rename to azurerm/internal/services/network/tests/subnet_nat_gateway_association_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_subnet_network_security_group_association_test.go b/azurerm/internal/services/network/tests/subnet_network_security_group_association_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_subnet_network_security_group_association_test.go rename to azurerm/internal/services/network/tests/subnet_network_security_group_association_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_subnet_test.go b/azurerm/internal/services/network/tests/subnet_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_subnet_test.go rename to azurerm/internal/services/network/tests/subnet_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_subnet_route_table_association_test.go b/azurerm/internal/services/network/tests/subnet_route_table_association_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_subnet_route_table_association_test.go rename to azurerm/internal/services/network/tests/subnet_route_table_association_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_hub_connection_test.go b/azurerm/internal/services/network/tests/virtual_hub_connection_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_virtual_hub_connection_test.go rename to azurerm/internal/services/network/tests/virtual_hub_connection_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_virtual_hub_test.go b/azurerm/internal/services/network/tests/virtual_hub_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_virtual_hub_test.go rename to azurerm/internal/services/network/tests/virtual_hub_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_hub_test.go b/azurerm/internal/services/network/tests/virtual_hub_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_virtual_hub_test.go rename to azurerm/internal/services/network/tests/virtual_hub_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_virtual_network_test.go b/azurerm/internal/services/network/tests/virtual_network_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_virtual_network_test.go rename to azurerm/internal/services/network/tests/virtual_network_data_source_test.go diff --git a/azurerm/internal/services/network/tests/data_source_virtual_network_gateway_connection_test.go b/azurerm/internal/services/network/tests/virtual_network_gateway_connection_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_virtual_network_gateway_connection_test.go rename to azurerm/internal/services/network/tests/virtual_network_gateway_connection_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_connection_test.go b/azurerm/internal/services/network/tests/virtual_network_gateway_connection_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_connection_test.go rename to azurerm/internal/services/network/tests/virtual_network_gateway_connection_resource_test.go diff --git a/azurerm/internal/services/network/tests/data_source_virtual_network_gateway_test.go b/azurerm/internal/services/network/tests/virtual_network_gateway_data_source_test.go similarity index 100% rename from azurerm/internal/services/network/tests/data_source_virtual_network_gateway_test.go rename to azurerm/internal/services/network/tests/virtual_network_gateway_data_source_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_test.go b/azurerm/internal/services/network/tests/virtual_network_gateway_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_virtual_network_gateway_test.go rename to azurerm/internal/services/network/tests/virtual_network_gateway_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_network_peering_test.go b/azurerm/internal/services/network/tests/virtual_network_peering_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_virtual_network_peering_test.go rename to azurerm/internal/services/network/tests/virtual_network_peering_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_network_test.go b/azurerm/internal/services/network/tests/virtual_network_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_virtual_network_test.go rename to azurerm/internal/services/network/tests/virtual_network_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_virtual_wan_test.go b/azurerm/internal/services/network/tests/virtual_wan_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_virtual_wan_test.go rename to azurerm/internal/services/network/tests/virtual_wan_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_vpn_gateway_test.go b/azurerm/internal/services/network/tests/vpn_gateway_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_vpn_gateway_test.go rename to azurerm/internal/services/network/tests/vpn_gateway_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_vpn_server_configuration_test.go b/azurerm/internal/services/network/tests/vpn_server_configuration_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_vpn_server_configuration_test.go rename to azurerm/internal/services/network/tests/vpn_server_configuration_resource_test.go diff --git a/azurerm/internal/services/network/tests/resource_arm_web_application_firewall_policy_test.go b/azurerm/internal/services/network/tests/web_application_firewall_policy_resource_test.go similarity index 100% rename from azurerm/internal/services/network/tests/resource_arm_web_application_firewall_policy_test.go rename to azurerm/internal/services/network/tests/web_application_firewall_policy_resource_test.go diff --git a/azurerm/internal/services/network/resource_arm_virtual_hub_connection.go b/azurerm/internal/services/network/virtual_hub_connection_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_virtual_hub_connection.go rename to azurerm/internal/services/network/virtual_hub_connection_resource.go diff --git a/azurerm/internal/services/network/data_source_virtual_hub.go b/azurerm/internal/services/network/virtual_hub_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_virtual_hub.go rename to azurerm/internal/services/network/virtual_hub_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_virtual_hub.go b/azurerm/internal/services/network/virtual_hub_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_virtual_hub.go rename to azurerm/internal/services/network/virtual_hub_resource.go diff --git a/azurerm/internal/services/network/data_source_virtual_network.go b/azurerm/internal/services/network/virtual_network_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_virtual_network.go rename to azurerm/internal/services/network/virtual_network_data_source.go diff --git a/azurerm/internal/services/network/data_source_virtual_network_gateway_connection.go b/azurerm/internal/services/network/virtual_network_gateway_connection_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_virtual_network_gateway_connection.go rename to azurerm/internal/services/network/virtual_network_gateway_connection_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_virtual_network_gateway_connection.go b/azurerm/internal/services/network/virtual_network_gateway_connection_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_virtual_network_gateway_connection.go rename to azurerm/internal/services/network/virtual_network_gateway_connection_resource.go diff --git a/azurerm/internal/services/network/data_source_virtual_network_gateway.go b/azurerm/internal/services/network/virtual_network_gateway_data_source.go similarity index 100% rename from azurerm/internal/services/network/data_source_virtual_network_gateway.go rename to azurerm/internal/services/network/virtual_network_gateway_data_source.go diff --git a/azurerm/internal/services/network/resource_arm_virtual_network_gateway.go b/azurerm/internal/services/network/virtual_network_gateway_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_virtual_network_gateway.go rename to azurerm/internal/services/network/virtual_network_gateway_resource.go diff --git a/azurerm/internal/services/network/resource_arm_virtual_network_peering.go b/azurerm/internal/services/network/virtual_network_peering_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_virtual_network_peering.go rename to azurerm/internal/services/network/virtual_network_peering_resource.go diff --git a/azurerm/internal/services/network/resource_arm_virtual_network.go b/azurerm/internal/services/network/virtual_network_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_virtual_network.go rename to azurerm/internal/services/network/virtual_network_resource.go diff --git a/azurerm/internal/services/network/resource_arm_virtual_wan.go b/azurerm/internal/services/network/virtual_wan_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_virtual_wan.go rename to azurerm/internal/services/network/virtual_wan_resource.go diff --git a/azurerm/internal/services/network/resource_arm_vpn_gateway.go b/azurerm/internal/services/network/vpn_gateway_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_vpn_gateway.go rename to azurerm/internal/services/network/vpn_gateway_resource.go diff --git a/azurerm/internal/services/network/resource_arm_vpn_server_configuration.go b/azurerm/internal/services/network/vpn_server_configuration_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_vpn_server_configuration.go rename to azurerm/internal/services/network/vpn_server_configuration_resource.go diff --git a/azurerm/internal/services/network/resource_arm_web_application_firewall_policy.go b/azurerm/internal/services/network/web_application_firewall_policy_resource.go similarity index 100% rename from azurerm/internal/services/network/resource_arm_web_application_firewall_policy.go rename to azurerm/internal/services/network/web_application_firewall_policy_resource.go From d2ee416fe23344d823747af41c61e3d129a1fde7 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 16:01:50 -0500 Subject: [PATCH 199/223] updates `policy` --- ...rce_arm_policy_assignment.go => policy_assignment_resource.go} | 0 ...urce_policy_definition.go => policy_definition_data_source.go} | 0 ...rce_arm_policy_definition.go => policy_definition_resource.go} | 0 ...e_arm_policy_remediation.go => policy_remediation_resource.go} | 0 ...icy_set_definition.go => policy_set_definition_data_source.go} | 0 ...policy_set_definition.go => policy_set_definition_resource.go} | 0 ...licy_assignment_test.go => policy_assignment_resource_test.go} | 0 ...y_definition_test.go => policy_definition_data_source_test.go} | 0 ...licy_definition_test.go => policy_definition_resource_test.go} | 0 ...cy_remediation_test.go => policy_remediation_resource_test.go} | 0 ...finition_test.go => policy_set_definition_data_source_test.go} | 0 ..._definition_test.go => policy_set_definition_resource_test.go} | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/policy/{resource_arm_policy_assignment.go => policy_assignment_resource.go} (100%) rename azurerm/internal/services/policy/{data_source_policy_definition.go => policy_definition_data_source.go} (100%) rename azurerm/internal/services/policy/{resource_arm_policy_definition.go => policy_definition_resource.go} (100%) rename azurerm/internal/services/policy/{resource_arm_policy_remediation.go => policy_remediation_resource.go} (100%) rename azurerm/internal/services/policy/{data_source_policy_set_definition.go => policy_set_definition_data_source.go} (100%) rename azurerm/internal/services/policy/{resource_arm_policy_set_definition.go => policy_set_definition_resource.go} (100%) rename azurerm/internal/services/policy/tests/{resource_arm_policy_assignment_test.go => policy_assignment_resource_test.go} (100%) rename azurerm/internal/services/policy/tests/{data_source_policy_definition_test.go => policy_definition_data_source_test.go} (100%) rename azurerm/internal/services/policy/tests/{resource_arm_policy_definition_test.go => policy_definition_resource_test.go} (100%) rename azurerm/internal/services/policy/tests/{resource_arm_policy_remediation_test.go => policy_remediation_resource_test.go} (100%) rename azurerm/internal/services/policy/tests/{data_source_policy_set_definition_test.go => policy_set_definition_data_source_test.go} (100%) rename azurerm/internal/services/policy/tests/{resource_arm_policy_set_definition_test.go => policy_set_definition_resource_test.go} (100%) diff --git a/azurerm/internal/services/policy/resource_arm_policy_assignment.go b/azurerm/internal/services/policy/policy_assignment_resource.go similarity index 100% rename from azurerm/internal/services/policy/resource_arm_policy_assignment.go rename to azurerm/internal/services/policy/policy_assignment_resource.go diff --git a/azurerm/internal/services/policy/data_source_policy_definition.go b/azurerm/internal/services/policy/policy_definition_data_source.go similarity index 100% rename from azurerm/internal/services/policy/data_source_policy_definition.go rename to azurerm/internal/services/policy/policy_definition_data_source.go diff --git a/azurerm/internal/services/policy/resource_arm_policy_definition.go b/azurerm/internal/services/policy/policy_definition_resource.go similarity index 100% rename from azurerm/internal/services/policy/resource_arm_policy_definition.go rename to azurerm/internal/services/policy/policy_definition_resource.go diff --git a/azurerm/internal/services/policy/resource_arm_policy_remediation.go b/azurerm/internal/services/policy/policy_remediation_resource.go similarity index 100% rename from azurerm/internal/services/policy/resource_arm_policy_remediation.go rename to azurerm/internal/services/policy/policy_remediation_resource.go diff --git a/azurerm/internal/services/policy/data_source_policy_set_definition.go b/azurerm/internal/services/policy/policy_set_definition_data_source.go similarity index 100% rename from azurerm/internal/services/policy/data_source_policy_set_definition.go rename to azurerm/internal/services/policy/policy_set_definition_data_source.go diff --git a/azurerm/internal/services/policy/resource_arm_policy_set_definition.go b/azurerm/internal/services/policy/policy_set_definition_resource.go similarity index 100% rename from azurerm/internal/services/policy/resource_arm_policy_set_definition.go rename to azurerm/internal/services/policy/policy_set_definition_resource.go diff --git a/azurerm/internal/services/policy/tests/resource_arm_policy_assignment_test.go b/azurerm/internal/services/policy/tests/policy_assignment_resource_test.go similarity index 100% rename from azurerm/internal/services/policy/tests/resource_arm_policy_assignment_test.go rename to azurerm/internal/services/policy/tests/policy_assignment_resource_test.go diff --git a/azurerm/internal/services/policy/tests/data_source_policy_definition_test.go b/azurerm/internal/services/policy/tests/policy_definition_data_source_test.go similarity index 100% rename from azurerm/internal/services/policy/tests/data_source_policy_definition_test.go rename to azurerm/internal/services/policy/tests/policy_definition_data_source_test.go diff --git a/azurerm/internal/services/policy/tests/resource_arm_policy_definition_test.go b/azurerm/internal/services/policy/tests/policy_definition_resource_test.go similarity index 100% rename from azurerm/internal/services/policy/tests/resource_arm_policy_definition_test.go rename to azurerm/internal/services/policy/tests/policy_definition_resource_test.go diff --git a/azurerm/internal/services/policy/tests/resource_arm_policy_remediation_test.go b/azurerm/internal/services/policy/tests/policy_remediation_resource_test.go similarity index 100% rename from azurerm/internal/services/policy/tests/resource_arm_policy_remediation_test.go rename to azurerm/internal/services/policy/tests/policy_remediation_resource_test.go diff --git a/azurerm/internal/services/policy/tests/data_source_policy_set_definition_test.go b/azurerm/internal/services/policy/tests/policy_set_definition_data_source_test.go similarity index 100% rename from azurerm/internal/services/policy/tests/data_source_policy_set_definition_test.go rename to azurerm/internal/services/policy/tests/policy_set_definition_data_source_test.go diff --git a/azurerm/internal/services/policy/tests/resource_arm_policy_set_definition_test.go b/azurerm/internal/services/policy/tests/policy_set_definition_resource_test.go similarity index 100% rename from azurerm/internal/services/policy/tests/resource_arm_policy_set_definition_test.go rename to azurerm/internal/services/policy/tests/policy_set_definition_resource_test.go From 4ef6736b64dfa68ef7d9e26fd4d52a271f84a662 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 16:01:57 -0500 Subject: [PATCH 200/223] updates `portal` --- .../portal/{resource_arm_dashboard.go => dashboard_resource.go} | 0 ...{resource_arm_dashboard_test.go => dashboard_resource_test.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/portal/{resource_arm_dashboard.go => dashboard_resource.go} (100%) rename azurerm/internal/services/portal/tests/{resource_arm_dashboard_test.go => dashboard_resource_test.go} (100%) diff --git a/azurerm/internal/services/portal/resource_arm_dashboard.go b/azurerm/internal/services/portal/dashboard_resource.go similarity index 100% rename from azurerm/internal/services/portal/resource_arm_dashboard.go rename to azurerm/internal/services/portal/dashboard_resource.go diff --git a/azurerm/internal/services/portal/tests/resource_arm_dashboard_test.go b/azurerm/internal/services/portal/tests/dashboard_resource_test.go similarity index 100% rename from azurerm/internal/services/portal/tests/resource_arm_dashboard_test.go rename to azurerm/internal/services/portal/tests/dashboard_resource_test.go From e7ce639577696ab07643b35895deb82036789a34 Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 16:02:04 -0500 Subject: [PATCH 201/223] updates `postgres` --- ...esql_configuration.go => postgresql_configuration_resource.go} | 0 ...arm_postgresql_database.go => postgresql_database_resource.go} | 0 ...esql_firewall_rule.go => postgresql_firewall_rule_resource.go} | 0 ...urce_postgresql_server.go => postgresql_server_data_source.go} | 0 ...rce_arm_postgresql_server.go => postgresql_server_resource.go} | 0 ...etwork_rule.go => postgresql_virtual_network_rule_resource.go} | 0 ...guration_test.go => postgresql_configuration_resource_test.go} | 0 ...esql_database_test.go => postgresql_database_resource_test.go} | 0 ...all_rule_test.go => postgresql_firewall_rule_resource_test.go} | 0 ...resql_server_test.go => postgresql_server_data_source_test.go} | 0 ...stgresql_server_test.go => postgresql_server_resource_test.go} | 0 ...e_test.go => postgresql_virtual_network_rule_resource_test.go} | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/postgres/{resource_arm_postgresql_configuration.go => postgresql_configuration_resource.go} (100%) rename azurerm/internal/services/postgres/{resource_arm_postgresql_database.go => postgresql_database_resource.go} (100%) rename azurerm/internal/services/postgres/{resource_arm_postgresql_firewall_rule.go => postgresql_firewall_rule_resource.go} (100%) rename azurerm/internal/services/postgres/{data_source_postgresql_server.go => postgresql_server_data_source.go} (100%) rename azurerm/internal/services/postgres/{resource_arm_postgresql_server.go => postgresql_server_resource.go} (100%) rename azurerm/internal/services/postgres/{resource_arm_postgresql_virtual_network_rule.go => postgresql_virtual_network_rule_resource.go} (100%) rename azurerm/internal/services/postgres/tests/{resource_arm_postgresql_configuration_test.go => postgresql_configuration_resource_test.go} (100%) rename azurerm/internal/services/postgres/tests/{resource_arm_postgresql_database_test.go => postgresql_database_resource_test.go} (100%) rename azurerm/internal/services/postgres/tests/{resource_arm_postgresql_firewall_rule_test.go => postgresql_firewall_rule_resource_test.go} (100%) rename azurerm/internal/services/postgres/tests/{data_source_postgresql_server_test.go => postgresql_server_data_source_test.go} (100%) rename azurerm/internal/services/postgres/tests/{resource_arm_postgresql_server_test.go => postgresql_server_resource_test.go} (100%) rename azurerm/internal/services/postgres/tests/{resource_arm_postgresql_virtual_network_rule_test.go => postgresql_virtual_network_rule_resource_test.go} (100%) diff --git a/azurerm/internal/services/postgres/resource_arm_postgresql_configuration.go b/azurerm/internal/services/postgres/postgresql_configuration_resource.go similarity index 100% rename from azurerm/internal/services/postgres/resource_arm_postgresql_configuration.go rename to azurerm/internal/services/postgres/postgresql_configuration_resource.go diff --git a/azurerm/internal/services/postgres/resource_arm_postgresql_database.go b/azurerm/internal/services/postgres/postgresql_database_resource.go similarity index 100% rename from azurerm/internal/services/postgres/resource_arm_postgresql_database.go rename to azurerm/internal/services/postgres/postgresql_database_resource.go diff --git a/azurerm/internal/services/postgres/resource_arm_postgresql_firewall_rule.go b/azurerm/internal/services/postgres/postgresql_firewall_rule_resource.go similarity index 100% rename from azurerm/internal/services/postgres/resource_arm_postgresql_firewall_rule.go rename to azurerm/internal/services/postgres/postgresql_firewall_rule_resource.go diff --git a/azurerm/internal/services/postgres/data_source_postgresql_server.go b/azurerm/internal/services/postgres/postgresql_server_data_source.go similarity index 100% rename from azurerm/internal/services/postgres/data_source_postgresql_server.go rename to azurerm/internal/services/postgres/postgresql_server_data_source.go diff --git a/azurerm/internal/services/postgres/resource_arm_postgresql_server.go b/azurerm/internal/services/postgres/postgresql_server_resource.go similarity index 100% rename from azurerm/internal/services/postgres/resource_arm_postgresql_server.go rename to azurerm/internal/services/postgres/postgresql_server_resource.go diff --git a/azurerm/internal/services/postgres/resource_arm_postgresql_virtual_network_rule.go b/azurerm/internal/services/postgres/postgresql_virtual_network_rule_resource.go similarity index 100% rename from azurerm/internal/services/postgres/resource_arm_postgresql_virtual_network_rule.go rename to azurerm/internal/services/postgres/postgresql_virtual_network_rule_resource.go diff --git a/azurerm/internal/services/postgres/tests/resource_arm_postgresql_configuration_test.go b/azurerm/internal/services/postgres/tests/postgresql_configuration_resource_test.go similarity index 100% rename from azurerm/internal/services/postgres/tests/resource_arm_postgresql_configuration_test.go rename to azurerm/internal/services/postgres/tests/postgresql_configuration_resource_test.go diff --git a/azurerm/internal/services/postgres/tests/resource_arm_postgresql_database_test.go b/azurerm/internal/services/postgres/tests/postgresql_database_resource_test.go similarity index 100% rename from azurerm/internal/services/postgres/tests/resource_arm_postgresql_database_test.go rename to azurerm/internal/services/postgres/tests/postgresql_database_resource_test.go diff --git a/azurerm/internal/services/postgres/tests/resource_arm_postgresql_firewall_rule_test.go b/azurerm/internal/services/postgres/tests/postgresql_firewall_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/postgres/tests/resource_arm_postgresql_firewall_rule_test.go rename to azurerm/internal/services/postgres/tests/postgresql_firewall_rule_resource_test.go diff --git a/azurerm/internal/services/postgres/tests/data_source_postgresql_server_test.go b/azurerm/internal/services/postgres/tests/postgresql_server_data_source_test.go similarity index 100% rename from azurerm/internal/services/postgres/tests/data_source_postgresql_server_test.go rename to azurerm/internal/services/postgres/tests/postgresql_server_data_source_test.go diff --git a/azurerm/internal/services/postgres/tests/resource_arm_postgresql_server_test.go b/azurerm/internal/services/postgres/tests/postgresql_server_resource_test.go similarity index 100% rename from azurerm/internal/services/postgres/tests/resource_arm_postgresql_server_test.go rename to azurerm/internal/services/postgres/tests/postgresql_server_resource_test.go diff --git a/azurerm/internal/services/postgres/tests/resource_arm_postgresql_virtual_network_rule_test.go b/azurerm/internal/services/postgres/tests/postgresql_virtual_network_rule_resource_test.go similarity index 100% rename from azurerm/internal/services/postgres/tests/resource_arm_postgresql_virtual_network_rule_test.go rename to azurerm/internal/services/postgres/tests/postgresql_virtual_network_rule_resource_test.go From e9ab5ea904d7f078c5b440cc2e054d6667a11fbd Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 16:02:12 -0500 Subject: [PATCH 202/223] updates `powerbi` --- ...ource_arm_powerbi_embedded.go => powerbi_embedded_resource.go} | 0 ...powerbi_embedded_test.go => powerbi_embedded_resource_test.go} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/powerbi/{resource_arm_powerbi_embedded.go => powerbi_embedded_resource.go} (100%) rename azurerm/internal/services/powerbi/tests/{resource_arm_powerbi_embedded_test.go => powerbi_embedded_resource_test.go} (100%) diff --git a/azurerm/internal/services/powerbi/resource_arm_powerbi_embedded.go b/azurerm/internal/services/powerbi/powerbi_embedded_resource.go similarity index 100% rename from azurerm/internal/services/powerbi/resource_arm_powerbi_embedded.go rename to azurerm/internal/services/powerbi/powerbi_embedded_resource.go diff --git a/azurerm/internal/services/powerbi/tests/resource_arm_powerbi_embedded_test.go b/azurerm/internal/services/powerbi/tests/powerbi_embedded_resource_test.go similarity index 100% rename from azurerm/internal/services/powerbi/tests/resource_arm_powerbi_embedded_test.go rename to azurerm/internal/services/powerbi/tests/powerbi_embedded_resource_test.go From cb000a4a7ac6150375fa4df4c4c8300ec77cc20c Mon Sep 17 00:00:00 2001 From: Tracy Holmes Date: Wed, 6 May 2020 16:02:22 -0500 Subject: [PATCH 203/223] updates `privatedns` --- ...m_private_dns_a_record.go => private_dns_a_record_resource.go} | 0 ...ate_dns_aaaa_record.go => private_dns_aaaa_record_resource.go} | 0 ...e_dns_cname_record.go => private_dns_cname_record_resource.go} | 0 ...private_dns_mx_record.go => private_dns_mx_record_resource.go} | 0 ...ivate_dns_ptr_record.go => private_dns_ptr_record_resource.go} | 0 ...ivate_dns_srv_record.go => private_dns_srv_record_resource.go} | 0 ...ivate_dns_txt_record.go => private_dns_txt_record_resource.go} | 0 ...source_private_dns_zone.go => private_dns_zone_data_source.go} | 0 ...ource_arm_private_dns_zone.go => private_dns_zone_resource.go} | 0 ..._link.go => private_dns_zone_virtual_network_link_resource.go} | 0 ...dns_a_record_test.go => private_dns_a_record_resource_test.go} | 0 ...aa_record_test.go => private_dns_aaaa_record_resource_test.go} | 0 ...e_record_test.go => private_dns_cname_record_resource_test.go} | 0 ...s_mx_record_test.go => private_dns_mx_record_resource_test.go} | 0 ...ptr_record_test.go => private_dns_ptr_record_resource_test.go} | 0 ...srv_record_test.go => private_dns_srv_record_resource_test.go} | 0 ...txt_record_test.go => private_dns_txt_record_resource_test.go} | 0 ...vate_dns_zone_test.go => private_dns_zone_data_source_test.go} | 0 ...private_dns_zone_test.go => private_dns_zone_resource_test.go} | 0 ....go => private_dns_zone_virtual_network_link_resource_test.go} | 0 20 files changed, 0 insertions(+), 0 deletions(-) rename azurerm/internal/services/privatedns/{resource_arm_private_dns_a_record.go => private_dns_a_record_resource.go} (100%) rename azurerm/internal/services/privatedns/{resource_arm_private_dns_aaaa_record.go => private_dns_aaaa_record_resource.go} (100%) rename azurerm/internal/services/privatedns/{resource_arm_private_dns_cname_record.go => private_dns_cname_record_resource.go} (100%) rename azurerm/internal/services/privatedns/{resource_arm_private_dns_mx_record.go => private_dns_mx_record_resource.go} (100%) rename azurerm/internal/services/privatedns/{resource_arm_private_dns_ptr_record.go => private_dns_ptr_record_resource.go} (100%) rename azurerm/internal/services/privatedns/{resource_arm_private_dns_srv_record.go => private_dns_srv_record_resource.go} (100%) rename azurerm/internal/services/privatedns/{resource_arm_private_dns_txt_record.go => private_dns_txt_record_resource.go} (100%) rename azurerm/internal/services/privatedns/{data_source_private_dns_zone.go => private_dns_zone_data_source.go} (100%) rename azurerm/internal/services/privatedns/{resource_arm_private_dns_zone.go => private_dns_zone_resource.go} (100%) rename azurerm/internal/services/privatedns/{resource_arm_private_dns_zone_virtual_network_link.go => private_dns_zone_virtual_network_link_resource.go} (100%) rename azurerm/internal/services/privatedns/tests/{resource_arm_private_dns_a_record_test.go => private_dns_a_record_resource_test.go} (100%) rename azurerm/internal/services/privatedns/tests/{resource_arm_private_dns_aaaa_record_test.go => private_dns_aaaa_record_resource_test.go} (100%) rename azurerm/internal/services/privatedns/tests/{resource_arm_private_dns_cname_record_test.go => private_dns_cname_record_resource_test.go} (100%) rename azurerm/internal/services/privatedns/tests/{resource_arm_private_dns_mx_record_test.go => private_dns_mx_record_resource_test.go} (100%) rename azurerm/internal/services/privatedns/tests/{resource_arm_private_dns_ptr_record_test.go => private_dns_ptr_record_resource_test.go} (100%) rename azurerm/internal/services/privatedns/tests/{resource_arm_private_dns_srv_record_test.go => private_dns_srv_record_resource_test.go} (100%) rename azurerm/internal/services/privatedns/tests/{resource_arm_private_dns_txt_record_test.go => private_dns_txt_record_resource_test.go} (100%) rename azurerm/internal/services/privatedns/tests/{data_source_private_dns_zone_test.go => private_dns_zone_data_source_test.go} (100%) rename azurerm/internal/services/privatedns/tests/{resource_arm_private_dns_zone_test.go => private_dns_zone_resource_test.go} (100%) rename azurerm/internal/services/privatedns/tests/{resource_arm_private_dns_zone_virtual_network_link_test.go => private_dns_zone_virtual_network_link_resource_test.go} (100%) diff --git a/azurerm/internal/services/privatedns/resource_arm_private_dns_a_record.go b/azurerm/internal/services/privatedns/private_dns_a_record_resource.go similarity index 100% rename from azurerm/internal/services/privatedns/resource_arm_private_dns_a_record.go rename to azurerm/internal/services/privatedns/private_dns_a_record_resource.go diff --git a/azurerm/internal/services/privatedns/resource_arm_private_dns_aaaa_record.go b/azurerm/internal/services/privatedns/private_dns_aaaa_record_resource.go similarity index 100% rename from azurerm/internal/services/privatedns/resource_arm_private_dns_aaaa_record.go rename to azurerm/internal/services/privatedns/private_dns_aaaa_record_resource.go diff --git a/azurerm/internal/services/privatedns/resource_arm_private_dns_cname_record.go b/azurerm/internal/services/privatedns/private_dns_cname_record_resource.go similarity index 100% rename from azurerm/internal/services/privatedns/resource_arm_private_dns_cname_record.go rename to azurerm/internal/services/privatedns/private_dns_cname_record_resource.go diff --git a/azurerm/internal/services/privatedns/resource_arm_private_dns_mx_record.go b/azurerm/internal/services/privatedns/private_dns_mx_record_resource.go similarity index 100% rename from azurerm/internal/services/privatedns/resource_arm_private_dns_mx_record.go rename to azurerm/internal/services/privatedns/private_dns_mx_record_resource.go diff --git a/azurerm/internal/services/privatedns/resource_arm_private_dns_ptr_record.go b/azurerm/internal/services/privatedns/private_dns_ptr_record_resource.go similarity index 100% rename from azurerm/internal/services/privatedns/resource_arm_private_dns_ptr_record.go rename to azurerm/internal/services/privatedns/private_dns_ptr_record_resource.go diff --git a/azurerm/internal/services/privatedns/resource_arm_private_dns_srv_record.go b/azurerm/internal/services/privatedns/private_dns_srv_record_resource.go similarity index 100% rename from azurerm/internal/services/privatedns/resource_arm_private_dns_srv_record.go rename to azurerm/internal/services/privatedns/private_dns_srv_record_resource.go diff --git a/azurerm/internal/services/privatedns/resource_arm_private_dns_txt_record.go b/azurerm/internal/services/privatedns/private_dns_txt_record_resource.go similarity index 100% rename from azurerm/internal/services/privatedns/resource_arm_private_dns_txt_record.go rename to azurerm/internal/services/privatedns/private_dns_txt_record_resource.go diff --git a/azurerm/internal/services/privatedns/data_source_private_dns_zone.go b/azurerm/internal/services/privatedns/private_dns_zone_data_source.go similarity index 100% rename from azurerm/internal/services/privatedns/data_source_private_dns_zone.go rename to azurerm/internal/services/privatedns/private_dns_zone_data_source.go diff --git a/azurerm/internal/services/privatedns/resource_arm_private_dns_zone.go b/azurerm/internal/services/privatedns/private_dns_zone_resource.go similarity index 100% rename from azurerm/internal/services/privatedns/resource_arm_private_dns_zone.go rename to azurerm/internal/services/privatedns/private_dns_zone_resource.go diff --git a/azurerm/internal/services/privatedns/resource_arm_private_dns_zone_virtual_network_link.go b/azurerm/internal/services/privatedns/private_dns_zone_virtual_network_link_resource.go similarity index 100% rename from azurerm/internal/services/privatedns/resource_arm_private_dns_zone_virtual_network_link.go rename to azurerm/internal/services/privatedns/private_dns_zone_virtual_network_link_resource.go diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_a_record_test.go b/azurerm/internal/services/privatedns/tests/private_dns_a_record_resource_test.go similarity index 100% rename from azurerm/internal/services/privatedns/tests/resource_arm_private_dns_a_record_test.go rename to azurerm/internal/services/privatedns/tests/private_dns_a_record_resource_test.go diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_aaaa_record_test.go b/azurerm/internal/services/privatedns/tests/private_dns_aaaa_record_resource_test.go similarity index 100% rename from azurerm/internal/services/privatedns/tests/resource_arm_private_dns_aaaa_record_test.go rename to azurerm/internal/services/privatedns/tests/private_dns_aaaa_record_resource_test.go diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_cname_record_test.go b/azurerm/internal/services/privatedns/tests/private_dns_cname_record_resource_test.go similarity index 100% rename from azurerm/internal/services/privatedns/tests/resource_arm_private_dns_cname_record_test.go rename to azurerm/internal/services/privatedns/tests/private_dns_cname_record_resource_test.go diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_mx_record_test.go b/azurerm/internal/services/privatedns/tests/private_dns_mx_record_resource_test.go similarity index 100% rename from azurerm/internal/services/privatedns/tests/resource_arm_private_dns_mx_record_test.go rename to azurerm/internal/services/privatedns/tests/private_dns_mx_record_resource_test.go diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_ptr_record_test.go b/azurerm/internal/services/privatedns/tests/private_dns_ptr_record_resource_test.go similarity index 100% rename from azurerm/internal/services/privatedns/tests/resource_arm_private_dns_ptr_record_test.go rename to azurerm/internal/services/privatedns/tests/private_dns_ptr_record_resource_test.go diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_srv_record_test.go b/azurerm/internal/services/privatedns/tests/private_dns_srv_record_resource_test.go similarity index 100% rename from azurerm/internal/services/privatedns/tests/resource_arm_private_dns_srv_record_test.go rename to azurerm/internal/services/privatedns/tests/private_dns_srv_record_resource_test.go diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_txt_record_test.go b/azurerm/internal/services/privatedns/tests/private_dns_txt_record_resource_test.go similarity index 100% rename from azurerm/internal/services/privatedns/tests/resource_arm_private_dns_txt_record_test.go rename to azurerm/internal/services/privatedns/tests/private_dns_txt_record_resource_test.go diff --git a/azurerm/internal/services/privatedns/tests/data_source_private_dns_zone_test.go b/azurerm/internal/services/privatedns/tests/private_dns_zone_data_source_test.go similarity index 100% rename from azurerm/internal/services/privatedns/tests/data_source_private_dns_zone_test.go rename to azurerm/internal/services/privatedns/tests/private_dns_zone_data_source_test.go diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_zone_test.go b/azurerm/internal/services/privatedns/tests/private_dns_zone_resource_test.go similarity index 100% rename from azurerm/internal/services/privatedns/tests/resource_arm_private_dns_zone_test.go rename to azurerm/internal/services/privatedns/tests/private_dns_zone_resource_test.go diff --git a/azurerm/internal/services/privatedns/tests/resource_arm_private_dns_zone_virtual_network_link_test.go b/azurerm/internal/services/privatedns/tests/private_dns_zone_virtual_network_link_resource_test.go similarity index 100% rename from azurerm/internal/services/privatedns/tests/resource_arm_private_dns_zone_virtual_network_link_test.go rename to azurerm/internal/services/privatedns/tests/private_dns_zone_virtual_network_link_resource_test.go From f1caf0910a56690c24e787bb17c6b373479b4f68 Mon Sep 17 00:00:00 2001 From: Austin Cheung Date: Wed, 6 May 2020 15:26:15 -0700 Subject: [PATCH 204/223] address review --- azurerm/helpers/azure/app_service.go | 3 +- .../tests/resource_arm_app_service_test.go | 71 +++++++++++++++++++ 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/azurerm/helpers/azure/app_service.go b/azurerm/helpers/azure/app_service.go index d75b58d9da222..b18c16733640f 100644 --- a/azurerm/helpers/azure/app_service.go +++ b/azurerm/helpers/azure/app_service.go @@ -319,12 +319,13 @@ func SchemaAppServiceSiteConfig() *schema.Schema { "name": { Type: schema.TypeString, Optional: true, + Computed: true, ValidateFunc: validation.StringIsNotEmpty, }, "priority": { Type: schema.TypeInt, Optional: true, - Default: 65000, + Computed: true, ValidateFunc: validation.IntBetween(1, 2147483647), }, }, diff --git a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go index bc1ec8a6a0cd4..d74d742c60153 100644 --- a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go @@ -525,6 +525,32 @@ func TestAccAzureRMAppService_completeIpRestriction(t *testing.T) { Config: testAccAzureRMAppService_completeIpRestriction(data), Check: resource.ComposeTestCheckFunc( testCheckAzureRMAppServiceExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.0.ip_address", "10.10.10.10/32"), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.0.name", "test-restriction"), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.0.priority", "123"), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMAppService_manyCompleteIpRestrictions(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMAppServiceExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.#", "2"), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.0.ip_address", "10.10.10.10/32"), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.0.name", "test-restriction"), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.0.priority", "123"), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.1.ip_address", "20.20.20.0/24"), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.1.name", "test-restriction-2"), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.1.priority", "1234"), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMAppService_completeIpRestriction(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMAppServiceExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.#", "1"), resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.0.ip_address", "10.10.10.10/32"), resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.0.name", "test-restriction"), resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.ip_restriction.0.priority", "123"), @@ -2642,6 +2668,51 @@ resource "azurerm_app_service" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) } +func testAccAzureRMAppService_manyCompleteIpRestrictions(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_app_service_plan" "test" { + name = "acctestASP-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + sku { + tier = "Standard" + size = "S1" + } +} + +resource "azurerm_app_service" "test" { + name = "acctestAS-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + + site_config { + ip_restriction { + ip_address = "10.10.10.10/32" + name = "test-restriction" + priority = 123 + } + + ip_restriction { + ip_address = "20.20.20.0/24" + name = "test-restriction-2" + priority = 1234 + } + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} + func testAccAzureRMAppService_oneVNetSubnetIpRestriction(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { From 581e48e56b93f4fce91dd37d19e2ca72a0e80b4a Mon Sep 17 00:00:00 2001 From: Austin Cheung Date: Wed, 6 May 2020 16:16:23 -0700 Subject: [PATCH 205/223] formatting --- .../tests/resource_arm_app_service_test.go | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go index d74d742c60153..3abe9e0df1a00 100644 --- a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go @@ -2659,10 +2659,10 @@ resource "azurerm_app_service" "test" { site_config { ip_restriction { - ip_address = "10.10.10.10/32" - name = "test-restriction" - priority = 123 - } + ip_address = "10.10.10.10/32" + name = "test-restriction" + priority = 123 + } } } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) @@ -2698,16 +2698,16 @@ resource "azurerm_app_service" "test" { site_config { ip_restriction { - ip_address = "10.10.10.10/32" - name = "test-restriction" - priority = 123 + ip_address = "10.10.10.10/32" + name = "test-restriction" + priority = 123 } ip_restriction { ip_address = "20.20.20.0/24" - name = "test-restriction-2" - priority = 1234 - } + name = "test-restriction-2" + priority = 1234 + } } } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) From 4c3ce829971f51b1f5347906e1b6b7c52c9a009c Mon Sep 17 00:00:00 2001 From: Austin Cheung Date: Wed, 6 May 2020 16:27:19 -0700 Subject: [PATCH 206/223] formatting --- .../web/tests/resource_arm_app_service_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go index 3abe9e0df1a00..4ec77e889343f 100644 --- a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go @@ -2659,9 +2659,9 @@ resource "azurerm_app_service" "test" { site_config { ip_restriction { - ip_address = "10.10.10.10/32" - name = "test-restriction" - priority = 123 + ip_address = "10.10.10.10/32" + name = "test-restriction" + priority = 123 } } } @@ -2698,15 +2698,15 @@ resource "azurerm_app_service" "test" { site_config { ip_restriction { - ip_address = "10.10.10.10/32" - name = "test-restriction" - priority = 123 + ip_address = "10.10.10.10/32" + name = "test-restriction" + priority = 123 } ip_restriction { - ip_address = "20.20.20.0/24" - name = "test-restriction-2" - priority = 1234 + ip_address = "20.20.20.0/24" + name = "test-restriction-2" + priority = 1234 } } } From fc209f94842c4900350a288ca157894f472c033c Mon Sep 17 00:00:00 2001 From: Austin Cheung Date: Wed, 6 May 2020 16:30:11 -0700 Subject: [PATCH 207/223] formatting --- .../services/web/tests/resource_arm_app_service_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go index 4ec77e889343f..709c9b40fe8ba 100644 --- a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go @@ -2662,7 +2662,7 @@ resource "azurerm_app_service" "test" { ip_address = "10.10.10.10/32" name = "test-restriction" priority = 123 - } + } } } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) @@ -2701,13 +2701,13 @@ resource "azurerm_app_service" "test" { ip_address = "10.10.10.10/32" name = "test-restriction" priority = 123 - } + } ip_restriction { ip_address = "20.20.20.0/24" name = "test-restriction-2" priority = 1234 - } + } } } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) From 0f8b50a8a9c5d8e815623b24c550fb155e23ce7b Mon Sep 17 00:00:00 2001 From: magodo Date: Thu, 7 May 2020 10:52:37 +0800 Subject: [PATCH 208/223] Update website/docs/r/virtual_hub_connection.html.markdown Co-authored-by: Matthew Frahry --- website/docs/r/virtual_hub_connection.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/virtual_hub_connection.html.markdown b/website/docs/r/virtual_hub_connection.html.markdown index 35cedf4e8d253..a2f1da1f86311 100644 --- a/website/docs/r/virtual_hub_connection.html.markdown +++ b/website/docs/r/virtual_hub_connection.html.markdown @@ -62,7 +62,7 @@ The following arguments are supported: * `vitual_network_to_hub_gateways_traffic_allowed` - (Optional) Is Remote Virtual Network traffic allowed to transit the Hub's Virtual Network Gateway's? Changing this forces a new resource to be created. --> **NOTE** Please ensure that you deploy either a [Site-to-Site](https://www.terraform.io/docs/providers/azurerm/r/vpn_gateway.html)/[Point-to-Site](https://www.terraform.io/docs/providers/azurerm/r/point_to_site_vpn_gateway.html) VPN gateway or an [ExpressRoute gateway](https://www.terraform.io/docs/providers/azurerm/r/express_route_gateway.html) in the Virtual Hub before enable this field. +-> **NOTE** Please ensure that you deploy either a [Site-to-Site](https://www.terraform.io/docs/providers/azurerm/r/vpn_gateway.html)/[Point-to-Site](https://www.terraform.io/docs/providers/azurerm/r/point_to_site_vpn_gateway.html) VPN gateway or an [ExpressRoute gateway](https://www.terraform.io/docs/providers/azurerm/r/express_route_gateway.html) in the Virtual Hub before enabling this field. * `internet_security_enabled` - (Optional) Should Internet Security be enabled to secure internet traffic? Changing this forces a new resource to be created. From 7983489501acda1bce4e6219d65e2e607af90ccc Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Thu, 7 May 2020 11:00:31 +0800 Subject: [PATCH 209/223] Update doc for property sku of servicebus namespace --- website/docs/r/servicebus_namespace.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/servicebus_namespace.html.markdown b/website/docs/r/servicebus_namespace.html.markdown index f0da7e9ca3bc8..5e7f6d7704ffa 100644 --- a/website/docs/r/servicebus_namespace.html.markdown +++ b/website/docs/r/servicebus_namespace.html.markdown @@ -46,7 +46,7 @@ The following arguments are supported: * `location` - (Required) Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created. -* `sku` - (Required) Defines which tier to use. Options are basic, standard or premium. +* `sku` - (Required) Defines which tier to use. Options are basic, standard or premium. Changing this forces a new resource to be created. * `capacity` - (Optional) Specifies the capacity. When `sku` is `Premium`, capacity can be `1`, `2`, `4` or `8`. When `sku` is `Basic` or `Standard`, capacity can be `0` only. From 867fb0433820aca69cbc1fc072d703c4e2ae5efc Mon Sep 17 00:00:00 2001 From: rob Date: Thu, 7 May 2020 07:47:39 +0200 Subject: [PATCH 210/223] add note that analysis services server is started and stopped during update --- website/docs/r/analysis_services_server.html.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/docs/r/analysis_services_server.html.markdown b/website/docs/r/analysis_services_server.html.markdown index 29fa96b4687c8..363eb9d301425 100644 --- a/website/docs/r/analysis_services_server.html.markdown +++ b/website/docs/r/analysis_services_server.html.markdown @@ -38,6 +38,8 @@ resource "azurerm_analysis_services_server" "server" { } ``` +-> **NOTE:** The server resource will automatically be started and stopped during an update if it is in `paused` state. + ## Argument Reference The following arguments are supported: @@ -52,7 +54,7 @@ The following arguments are supported: * `admin_users` - (Optional) List of email addresses of admin users. -* `querypool_connection_mode` - (Optional) Controls how the read-write server is used in the query pool. If this values is set to `All` then read-write servers are also used for queries. Otherwise with `ReadOnly` these servers do not participate in query operations. +* `querypool_connection_mode` - (Optional) Controls how the read-write server is used in the query pool. If this value is set to `All` then read-write servers are also used for queries. Otherwise with `ReadOnly` these servers do not participate in query operations. * `backup_blob_container_uri` - (Optional) URI and SAS token for a blob container to store backups. From e5813a3f1048576a677eaba2465c07fa62b2b090 Mon Sep 17 00:00:00 2001 From: Tom Harvey Date: Thu, 7 May 2020 11:22:29 +0200 Subject: [PATCH 211/223] updating to include #6786 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5657996ce4640..83f427de0fc0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ FEATURES: IMPROVEMENTS: +* `azurerm_analysis_services_server` - support updating when the Server is paused [GH-6786] * `azurerm_application_gateway` - support for SSL Certificates without passwords [GH-6742] * `azurerm_hdinsight_hadoop_cluster` - support for metastores on cluster creation [GH-6145] * `azurerm_key_vault_certificate` - support for recovering a soft-deleted certificate if the `features` flag `recover_soft_deleted_key_vaults` is set to `true` [GH-6716] From a6362e492bd71002280852e7d9bcb41e5dfb021f Mon Sep 17 00:00:00 2001 From: jackofallops Date: Thu, 7 May 2020 10:43:02 +0100 Subject: [PATCH 212/223] fix broken test param for remoteDebugging --- .../services/web/tests/resource_arm_app_service_slot_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azurerm/internal/services/web/tests/resource_arm_app_service_slot_test.go b/azurerm/internal/services/web/tests/resource_arm_app_service_slot_test.go index 777493cc50754..00afcba2f6409 100644 --- a/azurerm/internal/services/web/tests/resource_arm_app_service_slot_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_app_service_slot_test.go @@ -857,7 +857,7 @@ func TestAccAzureRMAppServiceSlot_remoteDebugging(t *testing.T) { Check: resource.ComposeTestCheckFunc( testCheckAzureRMAppServiceSlotExists(data.ResourceName), resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.remote_debugging_enabled", "true"), - resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.remote_debugging_version", "VS2015"), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.remote_debugging_version", "VS2019"), ), }, }, @@ -3109,7 +3109,7 @@ resource "azurerm_app_service_slot" "test" { site_config { remote_debugging_enabled = true - remote_debugging_version = "VS2015" + remote_debugging_version = "VS2019" } tags = { From 4fcedbb13e782c54b83e7c0bc82e67644d119a8d Mon Sep 17 00:00:00 2001 From: jackofallops Date: Thu, 7 May 2020 10:54:05 +0100 Subject: [PATCH 213/223] fixes some broken tests --- .../tests/resource_arm_app_service_test.go | 37 ++++++++++--------- .../tests/resource_arm_function_app_test.go | 13 ++++--- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go index 5acb93cc831ce..bb2ae8eb93701 100644 --- a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go @@ -806,7 +806,7 @@ func TestAccAzureRMAppService_remoteDebugging(t *testing.T) { Check: resource.ComposeTestCheckFunc( testCheckAzureRMAppServiceExists(data.ResourceName), resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.remote_debugging_enabled", "true"), - resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.remote_debugging_version", "VS2015"), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.remote_debugging_version", "VS2019"), ), }, data.ImportStep(), @@ -1201,6 +1201,8 @@ func TestAccAzureRMAppService_ftpsState(t *testing.T) { }) } +// todo - linuxFxVersion seems to reject all supplied values - needs more detailed investigation. +// error message simply reads: Original Error: Code="BadRequest" Message="The parameter LinuxFxVersion has an invalid value." func TestAccAzureRMAppService_linuxFxVersion(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_app_service", "test") resource.ParallelTest(t, resource.TestCase{ @@ -2490,8 +2492,8 @@ resource "azurerm_resource_group" "test" { resource "azurerm_app_service_plan" "test" { name = "acctestASP-%d" - location = "${azurerm_resource_group.test.location}" - resource_group_name = "${azurerm_resource_group.test.name}" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name sku { tier = "Standard" @@ -2501,44 +2503,43 @@ resource "azurerm_app_service_plan" "test" { resource "azurerm_storage_account" "test" { name = "acct%d" - location = "${azurerm_resource_group.test.location}" - resource_group_name = "${azurerm_resource_group.test.name}" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name account_tier = "Standard" account_replication_type = "LRS" } resource "azurerm_storage_container" "test" { name = "acctestcontainer" - storage_account_name = "${azurerm_storage_account.test.name}" + storage_account_name = azurerm_storage_account.test.name } resource "azurerm_storage_share" "test" { name = "acctestshare" - resource_group_name = "${azurerm_resource_group.test.name}" - storage_account_name = "${azurerm_storage_account.test.name}" + storage_account_name = azurerm_storage_account.test.name } resource "azurerm_app_service" "test" { name = "acctestAS-%d" - location = "${azurerm_resource_group.test.location}" - resource_group_name = "${azurerm_resource_group.test.name}" - app_service_plan_id = "${azurerm_app_service_plan.test.id}" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id storage_account { name = "blobs" type = "AzureBlob" - account_name = "${azurerm_storage_account.test.name}" - share_name = "${azurerm_storage_container.test.name}" - access_key = "${azurerm_storage_account.test.primary_access_key}" + account_name = azurerm_storage_account.test.name + share_name = azurerm_storage_container.test.name + access_key = azurerm_storage_account.test.primary_access_key mount_path = "/blobs" } storage_account { name = "files" type = "AzureFiles" - account_name = "${azurerm_storage_account.test.name}" - share_name = "${azurerm_storage_share.test.name}" - access_key = "${azurerm_storage_account.test.primary_access_key}" + account_name = azurerm_storage_account.test.name + share_name = azurerm_storage_share.test.name + access_key = azurerm_storage_account.test.primary_access_key mount_path = "/files" } } @@ -3062,7 +3063,7 @@ resource "azurerm_app_service" "test" { site_config { remote_debugging_enabled = true - remote_debugging_version = "VS2015" + remote_debugging_version = "VS2019" } tags = { diff --git a/azurerm/internal/services/web/tests/resource_arm_function_app_test.go b/azurerm/internal/services/web/tests/resource_arm_function_app_test.go index 6e11f49c4a564..215c5f827b8fd 100644 --- a/azurerm/internal/services/web/tests/resource_arm_function_app_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_function_app_test.go @@ -251,9 +251,10 @@ func TestAccAzureRMFunctionApp_connectionStrings(t *testing.T) { Config: testAccAzureRMFunctionApp_connectionStrings(data), Check: resource.ComposeTestCheckFunc( testCheckAzureRMFunctionAppExists(data.ResourceName), - resource.TestCheckResourceAttr(data.ResourceName, "connection_string.0.name", "Example"), - resource.TestCheckResourceAttr(data.ResourceName, "connection_string.0.value", "some-postgresql-connection-string"), - resource.TestCheckResourceAttr(data.ResourceName, "connection_string.0.type", "PostgreSQL"), + resource.TestCheckResourceAttr(data.ResourceName, "connection_string.#", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "connection_string.163594034.name", "Example"), + resource.TestCheckResourceAttr(data.ResourceName, "connection_string.163594034.type", "PostgreSQL"), + resource.TestCheckResourceAttr(data.ResourceName, "connection_string.163594034.value", "some-postgresql-connection-string"), ), }, data.ImportStep(), @@ -313,9 +314,9 @@ func TestAccAzureRMFunctionApp_siteConfigMulti(t *testing.T) { resource.TestCheckResourceAttr(data.ResourceName, "app_settings.hello", "world"), resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.always_on", "true"), resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.linux_fx_version", "DOCKER|(golang:latest)"), - resource.TestCheckResourceAttr(data.ResourceName, "connection_string.0.name", "Example"), - resource.TestCheckResourceAttr(data.ResourceName, "connection_string.0.value", "some-postgresql-connection-string"), - resource.TestCheckResourceAttr(data.ResourceName, "connection_string.0.type", "PostgreSQL"), + resource.TestCheckResourceAttr(data.ResourceName, "connection_string.163594034.name", "Example"), + resource.TestCheckResourceAttr(data.ResourceName, "connection_string.163594034.type", "PostgreSQL"), + resource.TestCheckResourceAttr(data.ResourceName, "connection_string.163594034.value", "some-postgresql-connection-string"), ), }, }, From 0c663c556d39d19cd3265d62f0155fcd595ae643 Mon Sep 17 00:00:00 2001 From: jackofallops Date: Thu, 7 May 2020 11:14:13 +0100 Subject: [PATCH 214/223] update validation for new value in remoteDebuggingVersion --- azurerm/helpers/azure/app_service.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azurerm/helpers/azure/app_service.go b/azurerm/helpers/azure/app_service.go index fd9ae4b636f2e..5354401c47230 100644 --- a/azurerm/helpers/azure/app_service.go +++ b/azurerm/helpers/azure/app_service.go @@ -394,10 +394,11 @@ func SchemaAppServiceSiteConfig() *schema.Schema { Optional: true, Computed: true, ValidateFunc: validation.StringInSlice([]string{ - "VS2012", + "VS2012", // TODO for 3.0 - remove VS2012, VS2013, VS2015 "VS2013", "VS2015", "VS2017", + "VS2019", }, true), DiffSuppressFunc: suppress.CaseDifference, }, From cff1fa5989431d0c4b115d16fcabda264267cf09 Mon Sep 17 00:00:00 2001 From: jackofallops Date: Thu, 7 May 2020 12:10:38 +0100 Subject: [PATCH 215/223] added todo --- .../services/web/tests/resource_arm_function_app_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/azurerm/internal/services/web/tests/resource_arm_function_app_test.go b/azurerm/internal/services/web/tests/resource_arm_function_app_test.go index 215c5f827b8fd..f05ba6f727d44 100644 --- a/azurerm/internal/services/web/tests/resource_arm_function_app_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_function_app_test.go @@ -262,6 +262,7 @@ func TestAccAzureRMFunctionApp_connectionStrings(t *testing.T) { }) } +// TODO - Refactor this into more granular tests - currently fails due to race condition in a `ForceNew` step when changed to `kind = linux` func TestAccAzureRMFunctionApp_siteConfigMulti(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_function_app", "test") From e6ad22baad929299e241b0d77497a92923efac6c Mon Sep 17 00:00:00 2001 From: Sune Keller Date: Tue, 28 Apr 2020 12:27:18 +0200 Subject: [PATCH 216/223] Add health_check_path to site_config Signed-off-by: Sune Keller --- azurerm/helpers/azure/app_service.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/azurerm/helpers/azure/app_service.go b/azurerm/helpers/azure/app_service.go index 5354401c47230..56d623b2f9336 100644 --- a/azurerm/helpers/azure/app_service.go +++ b/azurerm/helpers/azure/app_service.go @@ -450,6 +450,11 @@ func SchemaAppServiceSiteConfig() *schema.Schema { }, false), }, + "health_check_path": { + Type: schema.TypeString, + Optional: true, + }, + "linux_fx_version": { Type: schema.TypeString, Optional: true, @@ -749,6 +754,11 @@ func SchemaAppServiceDataSourceSiteConfig() *schema.Schema { Computed: true, }, + "health_check_path": { + Type: schema.TypeString, + Computed: true, + }, + "linux_fx_version": { Type: schema.TypeString, Computed: true, @@ -1486,6 +1496,10 @@ func ExpandAppServiceSiteConfig(input interface{}) (*web.SiteConfig, error) { siteConfig.FtpsState = web.FtpsState(v.(string)) } + if v, ok := config["health_check_path"]; ok { + siteConfig.HealthCheckPath = utils.String(v.(string)) + } + if v, ok := config["min_tls_version"]; ok { siteConfig.MinTLSVersion = web.SupportedTLSVersions(v.(string)) } @@ -1606,6 +1620,11 @@ func FlattenAppServiceSiteConfig(input *web.SiteConfig) []interface{} { result["scm_type"] = string(input.ScmType) result["ftps_state"] = string(input.FtpsState) + + if input.HealthCheckPath != nil { + result["health_check_path"] = *input.HealthCheckPath + } + result["min_tls_version"] = string(input.MinTLSVersion) result["cors"] = FlattenWebCorsSettings(input.Cors) From cfa844c335babd1b235939401feadb27f46fcfc1 Mon Sep 17 00:00:00 2001 From: Sune Keller Date: Wed, 29 Apr 2020 09:14:11 +0200 Subject: [PATCH 217/223] Add acceptance test for health_check_path Signed-off-by: Sune Keller --- .../tests/resource_arm_app_service_test.go | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go index bb2ae8eb93701..569e9422ca48d 100644 --- a/azurerm/internal/services/web/tests/resource_arm_app_service_test.go +++ b/azurerm/internal/services/web/tests/resource_arm_app_service_test.go @@ -1201,6 +1201,25 @@ func TestAccAzureRMAppService_ftpsState(t *testing.T) { }) } +func TestAccAzureRMAppService_healthCheckPath(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_app_service", "test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMAppServiceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMAppService_healthCheckPath(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMAppServiceExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "site_config.0.health_check_path", "/health"), + ), + }, + data.ImportStep(), + }, + }) +} + // todo - linuxFxVersion seems to reject all supplied values - needs more detailed investigation. // error message simply reads: Original Error: Code="BadRequest" Message="The parameter LinuxFxVersion has an invalid value." func TestAccAzureRMAppService_linuxFxVersion(t *testing.T) { @@ -3391,6 +3410,41 @@ resource "azurerm_app_service" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) } +func testAccAzureRMAppService_healthCheckPath(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-%d" + location = "%s" +} + +resource "azurerm_app_service_plan" "test" { + name = "acctestASP-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + sku { + tier = "Standard" + size = "S1" + } +} + +resource "azurerm_app_service" "test" { + name = "acctestAS-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + app_service_plan_id = azurerm_app_service_plan.test.id + + site_config { + health_check_path = "/health" + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} + func testAccAzureRMAppService_linuxFxVersion(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { From c3fe74b290cd05dda4a94f1c325d619804d3ecf8 Mon Sep 17 00:00:00 2001 From: Sune Keller Date: Thu, 30 Apr 2020 23:43:49 +0200 Subject: [PATCH 218/223] Document health_check_path on azurerm_app_service Signed-off-by: Sune Keller --- website/docs/d/app_service.html.markdown | 2 ++ website/docs/r/app_service.html.markdown | 2 ++ 2 files changed, 4 insertions(+) diff --git a/website/docs/d/app_service.html.markdown b/website/docs/d/app_service.html.markdown index 07d6832efc6b0..8632a61ecc49f 100644 --- a/website/docs/d/app_service.html.markdown +++ b/website/docs/d/app_service.html.markdown @@ -103,6 +103,8 @@ A `ip_restriction` block exports the following: * `ftps_state` - State of FTP / FTPS service for this AppService. +* `health_check_path` - The health check path to be pinged by App Service. + * `ip_restriction` - One or more `ip_restriction` blocks as defined above. * `java_version` - The version of Java in use. diff --git a/website/docs/r/app_service.html.markdown b/website/docs/r/app_service.html.markdown index 5400097688d7c..89cf55a061c0a 100644 --- a/website/docs/r/app_service.html.markdown +++ b/website/docs/r/app_service.html.markdown @@ -187,6 +187,8 @@ A `site_config` block supports the following: * `ftps_state` - (Optional) State of FTP / FTPS service for this App Service. Possible values include: `AllAllowed`, `FtpsOnly` and `Disabled`. +* `health_check_path` - (Optional) The health check path to be pinged by App Service. [For more information - please see the corresponding Kudu Wiki page](https://github.com/projectkudu/kudu/wiki/Health-Check-(Preview)). + * `http2_enabled` - (Optional) Is HTTP2 Enabled on this App Service? Defaults to `false`. * `ip_restriction` - (Optional) A [List of objects](/docs/configuration/attr-as-blocks.html) representing ip restrictions as defined below. From 6cb1da5bb3791dbaba7e3949fe75ee4a842be368 Mon Sep 17 00:00:00 2001 From: Sune Keller Date: Thu, 7 May 2020 13:05:14 +0200 Subject: [PATCH 219/223] Note that App Service Health Check is in Preview Co-authored-by: Tom Harvey --- website/docs/r/app_service.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/r/app_service.html.markdown b/website/docs/r/app_service.html.markdown index 89cf55a061c0a..ca76a223325ee 100644 --- a/website/docs/r/app_service.html.markdown +++ b/website/docs/r/app_service.html.markdown @@ -189,6 +189,8 @@ A `site_config` block supports the following: * `health_check_path` - (Optional) The health check path to be pinged by App Service. [For more information - please see the corresponding Kudu Wiki page](https://github.com/projectkudu/kudu/wiki/Health-Check-(Preview)). +~> **Note:** This functionality is in Preview and is subject to changes (including breaking changes) on Azure's end + * `http2_enabled` - (Optional) Is HTTP2 Enabled on this App Service? Defaults to `false`. * `ip_restriction` - (Optional) A [List of objects](/docs/configuration/attr-as-blocks.html) representing ip restrictions as defined below. From e451b1115559d5a963c5ad7ebf8de419bd429705 Mon Sep 17 00:00:00 2001 From: Steve <11830746+jackofallops@users.noreply.github.com> Date: Thu, 7 May 2020 14:16:13 +0100 Subject: [PATCH 220/223] Update for #6661 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83f427de0fc0d..33446cb860742 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ FEATURES: IMPROVEMENTS: * `azurerm_analysis_services_server` - support updating when the Server is paused [GH-6786] +* `azurerm_app_service` - support for health_check_path preview feature added [GH-6661] * `azurerm_application_gateway` - support for SSL Certificates without passwords [GH-6742] * `azurerm_hdinsight_hadoop_cluster` - support for metastores on cluster creation [GH-6145] * `azurerm_key_vault_certificate` - support for recovering a soft-deleted certificate if the `features` flag `recover_soft_deleted_key_vaults` is set to `true` [GH-6716] From d1c5abbe9d796e096e3059d3a01643596027023d Mon Sep 17 00:00:00 2001 From: Steve <11830746+jackofallops@users.noreply.github.com> Date: Thu, 7 May 2020 14:27:48 +0100 Subject: [PATCH 221/223] Update for #6705 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33446cb860742..db6c030b470b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ IMPROVEMENTS: * `azurerm_analysis_services_server` - support updating when the Server is paused [GH-6786] * `azurerm_app_service` - support for health_check_path preview feature added [GH-6661] +* `azurerm_app_service` - support for `name` and `priority` on `ip_restrictions` [GH-6705] * `azurerm_application_gateway` - support for SSL Certificates without passwords [GH-6742] * `azurerm_hdinsight_hadoop_cluster` - support for metastores on cluster creation [GH-6145] * `azurerm_key_vault_certificate` - support for recovering a soft-deleted certificate if the `features` flag `recover_soft_deleted_key_vaults` is set to `true` [GH-6716] From 9498ad8c764efd77660927ba16c26f0fe0e53586 Mon Sep 17 00:00:00 2001 From: magodo Date: Thu, 7 May 2020 22:33:33 +0800 Subject: [PATCH 222/223] New resource: `azurerm_sentinel_alert_rule_scheduled` #6650 --- azurerm/helpers/validate/time.go | 34 +- .../services/sentinel/registration.go | 1 + ...ource_arm_sentinel_alert_rule_scheduled.go | 358 +++++++++ ..._arm_sentinel_alert_rule_scheduled_test.go | 239 ++++++ go.mod | 1 + go.sum | 5 + vendor/github.com/rickb777/date/LICENSE | 27 + vendor/github.com/rickb777/date/period/doc.go | 44 ++ .../github.com/rickb777/date/period/format.go | 128 +++ .../rickb777/date/period/marshal.go | 32 + .../github.com/rickb777/date/period/parse.go | 158 ++++ .../github.com/rickb777/date/period/period.go | 746 ++++++++++++++++++ vendor/github.com/rickb777/plural/.gitignore | 26 + vendor/github.com/rickb777/plural/.travis.yml | 11 + vendor/github.com/rickb777/plural/LICENSE | 27 + vendor/github.com/rickb777/plural/README.md | 28 + .../github.com/rickb777/plural/build+test.sh | 13 + vendor/github.com/rickb777/plural/doc.go | 20 + vendor/github.com/rickb777/plural/plural.go | 203 +++++ vendor/modules.txt | 4 + website/azurerm.erb | 4 + ...entinel_alert_rule_scheduled.html.markdown | 105 +++ 22 files changed, 2209 insertions(+), 5 deletions(-) create mode 100644 azurerm/internal/services/sentinel/resource_arm_sentinel_alert_rule_scheduled.go create mode 100644 azurerm/internal/services/sentinel/tests/resource_arm_sentinel_alert_rule_scheduled_test.go create mode 100644 vendor/github.com/rickb777/date/LICENSE create mode 100644 vendor/github.com/rickb777/date/period/doc.go create mode 100644 vendor/github.com/rickb777/date/period/format.go create mode 100644 vendor/github.com/rickb777/date/period/marshal.go create mode 100644 vendor/github.com/rickb777/date/period/parse.go create mode 100644 vendor/github.com/rickb777/date/period/period.go create mode 100644 vendor/github.com/rickb777/plural/.gitignore create mode 100644 vendor/github.com/rickb777/plural/.travis.yml create mode 100644 vendor/github.com/rickb777/plural/LICENSE create mode 100644 vendor/github.com/rickb777/plural/README.md create mode 100644 vendor/github.com/rickb777/plural/build+test.sh create mode 100644 vendor/github.com/rickb777/plural/doc.go create mode 100644 vendor/github.com/rickb777/plural/plural.go create mode 100644 website/docs/r/sentinel_alert_rule_scheduled.html.markdown diff --git a/azurerm/helpers/validate/time.go b/azurerm/helpers/validate/time.go index 223ab67da5089..60ecde6b128c1 100644 --- a/azurerm/helpers/validate/time.go +++ b/azurerm/helpers/validate/time.go @@ -2,13 +2,13 @@ package validate import ( "fmt" - "regexp" "time" "github.com/Azure/go-autorest/autorest/date" iso8601 "github.com/btubbs/datetime" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/rickb777/date/period" ) func ISO8601Duration(i interface{}, k string) (warnings []string, errors []error) { @@ -18,14 +18,38 @@ func ISO8601Duration(i interface{}, k string) (warnings []string, errors []error return } - matched, _ := regexp.MatchString(`^P([0-9]+Y)?([0-9]+M)?([0-9]+W)?([0-9]+D)?(T([0-9]+H)?([0-9]+M)?([0-9]+(\.?[0-9]+)?S)?)?$`, v) - - if !matched { - errors = append(errors, fmt.Errorf("expected %s to be in ISO 8601 duration format, got %s", k, v)) + if _, err := period.Parse(v); err != nil { + errors = append(errors, err) } return warnings, errors } +func ISO8601DurationBetween(min string, max string) func(i interface{}, k string) (warnings []string, errors []error) { + minDuration := period.MustParse(min).DurationApprox() + maxDuration := period.MustParse(max).DurationApprox() + if minDuration >= maxDuration { + panic(fmt.Sprintf("min duration (%v) >= max duration (%v)", minDuration, maxDuration)) + } + return func(i interface{}, k string) (warnings []string, errors []error) { + v, ok := i.(string) + if !ok { + return nil, []error{fmt.Errorf("expected type of %s to be string", k)} + } + + p, err := period.Parse(v) + if err != nil { + return nil, []error{err} + } + + duration := p.DurationApprox() + if duration < minDuration || duration > maxDuration { + return nil, []error{fmt.Errorf("expected %s to be in the range (%v - %v), got %v", k, minDuration, maxDuration, duration)} + } + + return nil, nil + } +} + func ISO8601DateTime(i interface{}, k string) (warnings []string, errors []error) { v, ok := i.(string) if !ok { diff --git a/azurerm/internal/services/sentinel/registration.go b/azurerm/internal/services/sentinel/registration.go index 9bcdea16837ac..8f0bcebfa534f 100644 --- a/azurerm/internal/services/sentinel/registration.go +++ b/azurerm/internal/services/sentinel/registration.go @@ -29,5 +29,6 @@ func (r Registration) SupportedDataSources() map[string]*schema.Resource { func (r Registration) SupportedResources() map[string]*schema.Resource { return map[string]*schema.Resource{ "azurerm_sentinel_alert_rule_ms_security_incident": resourceArmSentinelAlertRuleMsSecurityIncident(), + "azurerm_sentinel_alert_rule_scheduled": resourceArmSentinelAlertRuleScheduled(), } } diff --git a/azurerm/internal/services/sentinel/resource_arm_sentinel_alert_rule_scheduled.go b/azurerm/internal/services/sentinel/resource_arm_sentinel_alert_rule_scheduled.go new file mode 100644 index 0000000000000..563dfa549c5ba --- /dev/null +++ b/azurerm/internal/services/sentinel/resource_arm_sentinel_alert_rule_scheduled.go @@ -0,0 +1,358 @@ +package sentinel + +import ( + "fmt" + "log" + "time" + + "github.com/Azure/azure-sdk-for-go/services/preview/securityinsight/mgmt/2017-08-01-preview/securityinsight" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/rickb777/date/period" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/validate" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + loganalyticsParse "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loganalytics/parse" + loganalyticsValidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/loganalytics/validate" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/sentinel/parse" + azSchema "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/schema" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func resourceArmSentinelAlertRuleScheduled() *schema.Resource { + return &schema.Resource{ + Create: resourceArmSentinelAlertRuleScheduledCreateUpdate, + Read: resourceArmSentinelAlertRuleScheduledRead, + Update: resourceArmSentinelAlertRuleScheduledCreateUpdate, + Delete: resourceArmSentinelAlertRuleScheduledDelete, + + Importer: azSchema.ValidateResourceIDPriorToImportThen(func(id string) error { + _, err := parse.SentinelAlertRuleID(id) + return err + }, importSentinelAlertRule(securityinsight.Scheduled)), + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(30 * time.Minute), + Read: schema.DefaultTimeout(5 * time.Minute), + Update: schema.DefaultTimeout(30 * time.Minute), + Delete: schema.DefaultTimeout(30 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "log_analytics_workspace_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: loganalyticsValidate.LogAnalyticsWorkspaceID, + }, + + "display_name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "description": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "tactics": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + string(securityinsight.Collection), + string(securityinsight.CommandAndControl), + string(securityinsight.CredentialAccess), + string(securityinsight.DefenseEvasion), + string(securityinsight.Discovery), + string(securityinsight.Execution), + string(securityinsight.Exfiltration), + string(securityinsight.Impact), + string(securityinsight.InitialAccess), + string(securityinsight.LateralMovement), + string(securityinsight.Persistence), + string(securityinsight.PrivilegeEscalation), + }, false), + }, + }, + + "severity": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + string(securityinsight.High), + string(securityinsight.Medium), + string(securityinsight.Low), + string(securityinsight.Informational), + }, false), + }, + + "enabled": { + Type: schema.TypeBool, + Optional: true, + Default: true, + }, + + "query": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + + "query_frequency": { + Type: schema.TypeString, + Optional: true, + Default: "PT5H", + ValidateFunc: validate.ISO8601DurationBetween("PT5M", "PT24H"), + }, + + "query_period": { + Type: schema.TypeString, + Optional: true, + Default: "PT5H", + ValidateFunc: validate.ISO8601DurationBetween("PT5M", "P14D"), + }, + + "trigger_operator": { + Type: schema.TypeString, + Optional: true, + Default: string(securityinsight.GreaterThan), + ValidateFunc: validation.StringInSlice([]string{ + string(securityinsight.GreaterThan), + string(securityinsight.LessThan), + string(securityinsight.Equal), + string(securityinsight.NotEqual), + }, false), + }, + + "trigger_threshold": { + Type: schema.TypeInt, + Optional: true, + Default: 0, + ValidateFunc: validation.IntAtLeast(0), + }, + + "suppression_enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "suppression_duration": { + Type: schema.TypeString, + Optional: true, + Default: "PT5H", + ValidateFunc: validate.ISO8601DurationBetween("PT5M", "PT24H"), + }, + }, + } +} + +func resourceArmSentinelAlertRuleScheduledCreateUpdate(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Sentinel.AlertRulesClient + ctx, cancel := timeouts.ForCreateUpdate(meta.(*clients.Client).StopContext, d) + defer cancel() + + name := d.Get("name").(string) + workspaceID, err := loganalyticsParse.LogAnalyticsWorkspaceID(d.Get("log_analytics_workspace_id").(string)) + if err != nil { + return err + } + + if d.IsNewResource() { + resp, err := client.Get(ctx, workspaceID.ResourceGroup, workspaceID.Name, name) + if err != nil { + if !utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("checking for existing Sentinel Alert Rule Scheduled %q (Resource Group %q / Workspace %q): %+v", name, workspaceID.ResourceGroup, workspaceID.Name, err) + } + } + + id := alertRuleID(resp.Value) + if id != nil && *id != "" { + return tf.ImportAsExistsError("azurerm_sentinel_alert_rule_scheduled", *id) + } + } + + // Sanity checks + + // query frequency must <= query period: ensure there is no gaps in the overall query coverage. + queryFreq := d.Get("query_frequency").(string) + queryFreqDuration := period.MustParse(queryFreq).DurationApprox() + + queryPeriod := d.Get("query_period").(string) + queryPeriodDuration := period.MustParse(queryPeriod).DurationApprox() + if queryFreqDuration > queryPeriodDuration { + return fmt.Errorf("`query_frequency`(%v) should not be larger than `query period`(%v), which introduce gaps in the overall query coverage", queryFreq, queryPeriod) + } + + // query frequency must <= suppression duration: otherwise suppression has no effect. + suppressionDuration := d.Get("suppression_duration").(string) + suppressionEnabled := d.Get("suppression_enabled").(bool) + if suppressionEnabled { + suppressionDurationDuration := period.MustParse(suppressionDuration).DurationApprox() + if queryFreqDuration > suppressionDurationDuration { + return fmt.Errorf("`query_frequency`(%v) should not be larger than `suppression_duration`(%v), which makes suppression pointless", queryFreq, suppressionDuration) + } + } + + param := securityinsight.ScheduledAlertRule{ + Kind: securityinsight.KindScheduled, + ScheduledAlertRuleProperties: &securityinsight.ScheduledAlertRuleProperties{ + Description: utils.String(d.Get("description").(string)), + DisplayName: utils.String(d.Get("display_name").(string)), + Tactics: expandAlertRuleScheduledTactics(d.Get("tactics").(*schema.Set).List()), + Severity: securityinsight.AlertSeverity(d.Get("severity").(string)), + Enabled: utils.Bool(d.Get("enabled").(bool)), + Query: utils.String(d.Get("query").(string)), + QueryFrequency: &queryFreq, + QueryPeriod: &queryPeriod, + SuppressionEnabled: &suppressionEnabled, + SuppressionDuration: &suppressionDuration, + TriggerOperator: securityinsight.TriggerOperator(d.Get("trigger_operator").(string)), + TriggerThreshold: utils.Int32(int32(d.Get("trigger_threshold").(int))), + }, + } + + // Service avoid concurrent update of this resource via checking the "etag" to guarantee it is the same value as last Read. + if !d.IsNewResource() { + resp, err := client.Get(ctx, workspaceID.ResourceGroup, workspaceID.Name, name) + if err != nil { + return fmt.Errorf("retrieving Sentinel Alert Rule Scheduled %q (Resource Group %q / Workspace %q): %+v", name, workspaceID.ResourceGroup, workspaceID.Name, err) + } + + if err := assertAlertRuleKind(resp.Value, securityinsight.Scheduled); err != nil { + return fmt.Errorf("asserting alert rule of %q (Resource Group %q / Workspace %q): %+v", name, workspaceID.ResourceGroup, workspaceID.Name, err) + } + param.Etag = resp.Value.(securityinsight.ScheduledAlertRule).Etag + } + + if _, err := client.CreateOrUpdate(ctx, workspaceID.ResourceGroup, workspaceID.Name, name, param); err != nil { + return fmt.Errorf("creating Sentinel Alert Rule Scheduled %q (Resource Group %q / Workspace %q): %+v", name, workspaceID.ResourceGroup, workspaceID.Name, err) + } + + resp, err := client.Get(ctx, workspaceID.ResourceGroup, workspaceID.Name, name) + if err != nil { + return fmt.Errorf("retrieving Sentinel Alert Rule Scheduled %q (Resource Group %q / Workspace %q): %+v", name, workspaceID.ResourceGroup, workspaceID.Name, err) + } + + id := alertRuleID(resp.Value) + if id == nil || *id == "" { + return fmt.Errorf("empty or nil ID returned for Sentinel Alert Rule Scheduled %q (Resource Group %q / Workspace %q) ID", name, workspaceID.ResourceGroup, workspaceID.Name) + } + d.SetId(*id) + + return resourceArmSentinelAlertRuleScheduledRead(d, meta) +} + +func resourceArmSentinelAlertRuleScheduledRead(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Sentinel.AlertRulesClient + workspaceClient := meta.(*clients.Client).LogAnalytics.WorkspacesClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.SentinelAlertRuleID(d.Id()) + if err != nil { + return err + } + + resp, err := client.Get(ctx, id.ResourceGroup, id.Workspace, id.Name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + log.Printf("[DEBUG] Sentinel Alert Rule Scheduled %q was not found in Workspace %q in Resource Group %q - removing from state!", id.Name, id.Workspace, id.ResourceGroup) + d.SetId("") + return nil + } + + return fmt.Errorf("retrieving Sentinel Alert Rule Scheduled %q (Resource Group %q / Workspace %q): %+v", id.Name, id.ResourceGroup, id.Workspace, err) + } + + if err := assertAlertRuleKind(resp.Value, securityinsight.Scheduled); err != nil { + return fmt.Errorf("asserting alert rule of %q (Resource Group %q / Workspace %q): %+v", id.Name, id.ResourceGroup, id.Workspace, err) + } + rule := resp.Value.(securityinsight.ScheduledAlertRule) + + d.Set("name", id.Name) + + workspaceResp, err := workspaceClient.Get(ctx, id.ResourceGroup, id.Workspace) + if err != nil { + return fmt.Errorf("retrieving Log Analytics Workspace %q (Resource Group: %q) where this Alert Rule belongs to: %+v", id.Workspace, id.ResourceGroup, err) + } + d.Set("log_analytics_workspace_id", workspaceResp.ID) + + if prop := rule.ScheduledAlertRuleProperties; prop != nil { + d.Set("description", prop.Description) + d.Set("display_name", prop.DisplayName) + if err := d.Set("tactics", flattenAlertRuleScheduledTactics(prop.Tactics)); err != nil { + return fmt.Errorf("setting `tactics`: %+v", err) + } + d.Set("severity", string(prop.Severity)) + d.Set("enabled", prop.Enabled) + d.Set("query", prop.Query) + d.Set("query_frequency", prop.QueryFrequency) + d.Set("query_period", prop.QueryPeriod) + d.Set("trigger_operator", string(prop.TriggerOperator)) + + var threshold int32 + if prop.TriggerThreshold != nil { + threshold = *prop.TriggerThreshold + } + + d.Set("trigger_threshold", int(threshold)) + d.Set("suppression_enabled", prop.SuppressionEnabled) + d.Set("suppression_duration", prop.SuppressionDuration) + } + + return nil +} + +func resourceArmSentinelAlertRuleScheduledDelete(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).Sentinel.AlertRulesClient + ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.SentinelAlertRuleID(d.Id()) + if err != nil { + return err + } + + if _, err := client.Delete(ctx, id.ResourceGroup, id.Workspace, id.Name); err != nil { + return fmt.Errorf("deleting Sentinel Alert Rule Scheduled %q (Resource Group %q / Workspace %q): %+v", id.Name, id.ResourceGroup, id.Workspace, err) + } + + return nil +} + +func expandAlertRuleScheduledTactics(input []interface{}) *[]securityinsight.AttackTactic { + result := make([]securityinsight.AttackTactic, 0) + + for _, e := range input { + result = append(result, securityinsight.AttackTactic(e.(string))) + } + + return &result +} + +func flattenAlertRuleScheduledTactics(input *[]securityinsight.AttackTactic) []interface{} { + if input == nil { + return []interface{}{} + } + + output := make([]interface{}, 0) + + for _, e := range *input { + output = append(output, string(e)) + } + + return output +} diff --git a/azurerm/internal/services/sentinel/tests/resource_arm_sentinel_alert_rule_scheduled_test.go b/azurerm/internal/services/sentinel/tests/resource_arm_sentinel_alert_rule_scheduled_test.go new file mode 100644 index 0000000000000..1c5a448cb97a9 --- /dev/null +++ b/azurerm/internal/services/sentinel/tests/resource_arm_sentinel_alert_rule_scheduled_test.go @@ -0,0 +1,239 @@ +package tests + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/clients" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/sentinel/parse" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func TestAccAzureRMSentinelAlertRuleScheduled_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_sentinel_alert_rule_scheduled", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMSentinelAlertRuleScheduledDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMSentinelAlertRuleScheduled_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSentinelAlertRuleScheduledExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + +func TestAccAzureRMSentinelAlertRuleScheduled_complete(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_sentinel_alert_rule_scheduled", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMSentinelAlertRuleScheduledDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMSentinelAlertRuleScheduled_complete(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSentinelAlertRuleScheduledExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + +func TestAccAzureRMSentinelAlertRuleScheduled_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_sentinel_alert_rule_scheduled", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMSentinelAlertRuleScheduledDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMSentinelAlertRuleScheduled_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSentinelAlertRuleScheduledExists(data.ResourceName), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMSentinelAlertRuleScheduled_complete(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSentinelAlertRuleScheduledExists(data.ResourceName), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMSentinelAlertRuleScheduled_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSentinelAlertRuleScheduledExists(data.ResourceName), + ), + }, + data.ImportStep(), + }, + }) +} + +func TestAccAzureRMSentinelAlertRuleScheduled_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_sentinel_alert_rule_scheduled", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMSentinelAlertRuleScheduledDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMSentinelAlertRuleScheduled_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMSentinelAlertRuleScheduledExists(data.ResourceName), + ), + }, + data.RequiresImportErrorStep(testAccAzureRMSentinelAlertRuleScheduled_requiresImport), + }, + }) +} + +func testCheckAzureRMSentinelAlertRuleScheduledExists(resourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).Sentinel.AlertRulesClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Sentinel Alert Rule Scheduled not found: %s", resourceName) + } + + id, err := parse.SentinelAlertRuleID(rs.Primary.ID) + if err != nil { + return err + } + + if resp, err := client.Get(ctx, id.ResourceGroup, id.Workspace, id.Name); err != nil { + if utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Sentinel Alert Rule Scheduled %q (Resource Group %q) does not exist", id.Name, id.ResourceGroup) + } + return fmt.Errorf("Getting on Sentinel.AlertRules: %+v", err) + } + + return nil + } +} + +func testCheckAzureRMSentinelAlertRuleScheduledDestroy(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).Sentinel.AlertRulesClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + for _, rs := range s.RootModule().Resources { + if rs.Type != "azurerm_sentinel_alert_rule_scheduled" { + continue + } + + id, err := parse.SentinelAlertRuleID(rs.Primary.ID) + if err != nil { + return err + } + + if resp, err := client.Get(ctx, id.ResourceGroup, id.Workspace, id.Name); err != nil { + if !utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("Getting on Sentinel.AlertRules: %+v", err) + } + } + + return nil + } + + return nil +} + +func testAccAzureRMSentinelAlertRuleScheduled_basic(data acceptance.TestData) string { + template := testAccAzureRMSentinelAlertRuleScheduled_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_sentinel_alert_rule_scheduled" "test" { + name = "acctest-SentinelAlertRule-Sche-%d" + log_analytics_workspace_id = azurerm_log_analytics_workspace.test.id + display_name = "Some Rule" + severity = "High" + query = < 0 || (period.IsZero()) { + if len(weekNames) > 0 { + weeks := period.days / 70 + mdays := period.days % 70 + //fmt.Printf("%v %#v - %d %d\n", period, period, weeks, mdays) + if weeks > 0 { + parts = appendNonBlank(parts, weekNames.FormatInt(int(weeks))) + } + if mdays > 0 || weeks == 0 { + parts = appendNonBlank(parts, dayNames.FormatFloat(absFloat10(mdays))) + } + } else { + parts = appendNonBlank(parts, dayNames.FormatFloat(absFloat10(period.days))) + } + } + parts = appendNonBlank(parts, hourNames.FormatFloat(absFloat10(period.hours))) + parts = appendNonBlank(parts, minNames.FormatFloat(absFloat10(period.minutes))) + parts = appendNonBlank(parts, secNames.FormatFloat(absFloat10(period.seconds))) + + return strings.Join(parts, ", ") +} + +func appendNonBlank(parts []string, s string) []string { + if s == "" { + return parts + } + return append(parts, s) +} + +// PeriodDayNames provides the English default format names for the days part of the period. +// This is a sequence of plurals where the first match is used, otherwise the last one is used. +// The last one must include a "%v" placeholder for the number. +var PeriodDayNames = plural.FromZero("%v days", "%v day", "%v days") + +// PeriodWeekNames is as for PeriodDayNames but for weeks. +var PeriodWeekNames = plural.FromZero("", "%v week", "%v weeks") + +// PeriodMonthNames is as for PeriodDayNames but for months. +var PeriodMonthNames = plural.FromZero("", "%v month", "%v months") + +// PeriodYearNames is as for PeriodDayNames but for years. +var PeriodYearNames = plural.FromZero("", "%v year", "%v years") + +// PeriodHourNames is as for PeriodDayNames but for hours. +var PeriodHourNames = plural.FromZero("", "%v hour", "%v hours") + +// PeriodMinuteNames is as for PeriodDayNames but for minutes. +var PeriodMinuteNames = plural.FromZero("", "%v minute", "%v minutes") + +// PeriodSecondNames is as for PeriodDayNames but for seconds. +var PeriodSecondNames = plural.FromZero("", "%v second", "%v seconds") + +// String converts the period to ISO-8601 form. +func (period Period) String() string { + if period.IsZero() { + return "P0D" + } + + buf := &bytes.Buffer{} + if period.Sign() < 0 { + buf.WriteByte('-') + } + + buf.WriteByte('P') + + if period.years != 0 { + fmt.Fprintf(buf, "%gY", absFloat10(period.years)) + } + if period.months != 0 { + fmt.Fprintf(buf, "%gM", absFloat10(period.months)) + } + if period.days != 0 { + if period.days%70 == 0 { + fmt.Fprintf(buf, "%gW", absFloat10(period.days/7)) + } else { + fmt.Fprintf(buf, "%gD", absFloat10(period.days)) + } + } + if period.hours != 0 || period.minutes != 0 || period.seconds != 0 { + buf.WriteByte('T') + } + if period.hours != 0 { + fmt.Fprintf(buf, "%gH", absFloat10(period.hours)) + } + if period.minutes != 0 { + fmt.Fprintf(buf, "%gM", absFloat10(period.minutes)) + } + if period.seconds != 0 { + fmt.Fprintf(buf, "%gS", absFloat10(period.seconds)) + } + + return buf.String() +} + +func absFloat10(v int16) float32 { + f := float32(v) / 10 + if v < 0 { + return -f + } + return f +} diff --git a/vendor/github.com/rickb777/date/period/marshal.go b/vendor/github.com/rickb777/date/period/marshal.go new file mode 100644 index 0000000000000..c87ad5f6fb908 --- /dev/null +++ b/vendor/github.com/rickb777/date/period/marshal.go @@ -0,0 +1,32 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package period + +// MarshalBinary implements the encoding.BinaryMarshaler interface. +// This also provides support for gob encoding. +func (period Period) MarshalBinary() ([]byte, error) { + // binary method would take more space in many cases, so we simply use text + return period.MarshalText() +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. +// This also provides support for gob encoding. +func (period *Period) UnmarshalBinary(data []byte) error { + return period.UnmarshalText(data) +} + +// MarshalText implements the encoding.TextMarshaler interface for Periods. +func (period Period) MarshalText() ([]byte, error) { + return []byte(period.String()), nil +} + +// UnmarshalText implements the encoding.TextUnmarshaler interface for Periods. +func (period *Period) UnmarshalText(data []byte) (err error) { + u, err := Parse(string(data)) + if err == nil { + *period = u + } + return err +} diff --git a/vendor/github.com/rickb777/date/period/parse.go b/vendor/github.com/rickb777/date/period/parse.go new file mode 100644 index 0000000000000..270ae8d092dfc --- /dev/null +++ b/vendor/github.com/rickb777/date/period/parse.go @@ -0,0 +1,158 @@ +// Copyright 2015 Rick Beton. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package period + +import ( + "fmt" + "strconv" + "strings" +) + +// MustParse is as per Parse except that it panics if the string cannot be parsed. +// This is intended for setup code; don't use it for user inputs. +func MustParse(value string) Period { + d, err := Parse(value) + if err != nil { + panic(err) + } + return d +} + +// Parse parses strings that specify periods using ISO-8601 rules. +// +// In addition, a plus or minus sign can precede the period, e.g. "-P10D" +// +// The value is normalised, e.g. multiple of 12 months become years so "P24M" +// is the same as "P2Y". However, this is done without loss of precision, so +// for example whole numbers of days do not contribute to the months tally +// because the number of days per month is variable. +// +// The zero value can be represented in several ways: all of the following +// are equivalent: "P0Y", "P0M", "P0W", "P0D", "PT0H", PT0M", PT0S", and "P0". +// The canonical zero is "P0D". +func Parse(period string) (Period, error) { + if period == "" { + return Period{}, fmt.Errorf("cannot parse a blank string as a period") + } + + if period == "P0" { + return Period{}, nil + } + + result := period64{} + pcopy := period + if pcopy[0] == '-' { + result.neg = true + pcopy = pcopy[1:] + } else if pcopy[0] == '+' { + pcopy = pcopy[1:] + } + + if pcopy[0] != 'P' { + return Period{}, fmt.Errorf("expected 'P' period mark at the start: %s", period) + } + pcopy = pcopy[1:] + + st := parseState{period, pcopy, false, nil} + t := strings.IndexByte(pcopy, 'T') + if t >= 0 { + st.pcopy = pcopy[t+1:] + + result.hours, st = parseField(st, 'H') + if st.err != nil { + return Period{}, fmt.Errorf("expected a number before the 'H' marker: %s", period) + } + + result.minutes, st = parseField(st, 'M') + if st.err != nil { + return Period{}, fmt.Errorf("expected a number before the 'M' marker: %s", period) + } + + result.seconds, st = parseField(st, 'S') + if st.err != nil { + return Period{}, fmt.Errorf("expected a number before the 'S' marker: %s", period) + } + + if len(st.pcopy) != 0 { + return Period{}, fmt.Errorf("unexpected remaining components %s: %s", st.pcopy, period) + } + + st.pcopy = pcopy[:t] + } + + result.years, st = parseField(st, 'Y') + if st.err != nil { + return Period{}, fmt.Errorf("expected a number before the 'Y' marker: %s", period) + } + result.months, st = parseField(st, 'M') + if st.err != nil { + return Period{}, fmt.Errorf("expected a number before the 'M' marker: %s", period) + } + weeks, st := parseField(st, 'W') + if st.err != nil { + return Period{}, fmt.Errorf("expected a number before the 'W' marker: %s", period) + } + + days, st := parseField(st, 'D') + if st.err != nil { + return Period{}, fmt.Errorf("expected a number before the 'D' marker: %s", period) + } + + if len(st.pcopy) != 0 { + return Period{}, fmt.Errorf("unexpected remaining components %s: %s", st.pcopy, period) + } + + result.days = weeks*7 + days + //fmt.Printf("%#v\n", st) + + if !st.ok { + return Period{}, fmt.Errorf("expected 'Y', 'M', 'W', 'D', 'H', 'M', or 'S' marker: %s", period) + } + + return result.normalise64(true).toPeriod(), nil +} + +type parseState struct { + period, pcopy string + ok bool + err error +} + +func parseField(st parseState, mark byte) (int64, parseState) { + //fmt.Printf("%c %#v\n", mark, st) + r := int64(0) + m := strings.IndexByte(st.pcopy, mark) + if m > 0 { + r, st.err = parseDecimalFixedPoint(st.pcopy[:m], st.period) + if st.err != nil { + return 0, st + } + st.pcopy = st.pcopy[m+1:] + st.ok = true + } + return r, st +} + +// Fixed-point three decimal places +func parseDecimalFixedPoint(s, original string) (int64, error) { + //was := s + dec := strings.IndexByte(s, '.') + if dec < 0 { + dec = strings.IndexByte(s, ',') + } + + if dec >= 0 { + dp := len(s) - dec + if dp > 1 { + s = s[:dec] + s[dec+1:dec+2] + } else { + s = s[:dec] + s[dec+1:] + "0" + } + } else { + s = s + "0" + } + + return strconv.ParseInt(s, 10, 64) +} diff --git a/vendor/github.com/rickb777/date/period/period.go b/vendor/github.com/rickb777/date/period/period.go new file mode 100644 index 0000000000000..a9b39c6a0d6bb --- /dev/null +++ b/vendor/github.com/rickb777/date/period/period.go @@ -0,0 +1,746 @@ +// Copyright 2015 Rick Beton. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package period + +import ( + "fmt" + "time" +) + +const daysPerYearE4 int64 = 3652425 // 365.2425 days by the Gregorian rule +const daysPerMonthE4 int64 = 304369 // 30.4369 days per month +const daysPerMonthE6 int64 = 30436875 // 30.436875 days per month + +const oneE4 int64 = 10000 +const oneE5 int64 = 100000 +const oneE6 int64 = 1000000 +const oneE7 int64 = 10000000 + +const hundredMs = 100 * time.Millisecond + +// reminder: int64 overflow is after 9,223,372,036,854,775,807 (math.MaxInt64) + +// Period holds a period of time and provides conversion to/from ISO-8601 representations. +// Therefore there are six fields: years, months, days, hours, minutes, and seconds. +// +// In the ISO representation, decimal fractions are supported, although only the last non-zero +// component is allowed to have a fraction according to the Standard. For example "P2.5Y" +// is 2.5 years. +// +// However, in this implementation, the precision is limited to one decimal place only, by +// means of integers with fixed point arithmetic. (This avoids using float32 in the struct, +// so there are no problems testing equality using ==.) +// +// The implementation limits the range of possible values to ± 2^16 / 10 in each field. +// Note in particular that the range of years is limited to approximately ± 3276. +// +// The concept of weeks exists in string representations of periods, but otherwise weeks +// are unimportant. The period contains a number of days from which the number of weeks can +// be calculated when needed. +// +// Note that although fractional weeks can be parsed, they will never be returned via String(). +// This is because the number of weeks is always inferred from the number of days. +// +type Period struct { + years, months, days, hours, minutes, seconds int16 +} + +// NewYMD creates a simple period without any fractional parts. The fields are initialised verbatim +// without any normalisation; e.g. 12 months will not become 1 year. Use the Normalise method if you +// need to. +// +// All the parameters must have the same sign (otherwise a panic occurs). +func NewYMD(years, months, days int) Period { + return New(years, months, days, 0, 0, 0) +} + +// NewHMS creates a simple period without any fractional parts. The fields are initialised verbatim +// without any normalisation; e.g. 120 seconds will not become 2 minutes. Use the Normalise method +// if you need to. +// +// All the parameters must have the same sign (otherwise a panic occurs). +func NewHMS(hours, minutes, seconds int) Period { + return New(0, 0, 0, hours, minutes, seconds) +} + +// New creates a simple period without any fractional parts. The fields are initialised verbatim +// without any normalisation; e.g. 120 seconds will not become 2 minutes. Use the Normalise method +// if you need to. +// +// All the parameters must have the same sign (otherwise a panic occurs). +func New(years, months, days, hours, minutes, seconds int) Period { + if (years >= 0 && months >= 0 && days >= 0 && hours >= 0 && minutes >= 0 && seconds >= 0) || + (years <= 0 && months <= 0 && days <= 0 && hours <= 0 && minutes <= 0 && seconds <= 0) { + return Period{ + int16(years) * 10, int16(months) * 10, int16(days) * 10, + int16(hours) * 10, int16(minutes) * 10, int16(seconds) * 10, + } + } + panic(fmt.Sprintf("Periods must have homogeneous signs; got P%dY%dM%dDT%dH%dM%dS", + years, months, days, hours, minutes, seconds)) +} + +// TODO NewFloat + +// NewOf converts a time duration to a Period, and also indicates whether the conversion is precise. +// Any time duration that spans more than ± 3276 hours will be approximated by assuming that there +// are 24 hours per day, 365.2425 days per year (as per Gregorian calendar rules), and a month +// being 1/12 of that (approximately 30.4369 days). +// +// The result is not always fully normalised; for time differences less than 3276 hours (about 4.5 months), +// it will contain zero in the years, months and days fields but the number of days may be up to 3275; this +// reduces errors arising from the variable lengths of months. For larger time differences, greater than +// 3276 hours, the days, months and years fields are used as well. +func NewOf(duration time.Duration) (p Period, precise bool) { + var sign int16 = 1 + d := duration + if duration < 0 { + sign = -1 + d = -duration + } + + sign10 := sign * 10 + + totalHours := int64(d / time.Hour) + + // check for 16-bit overflow - occurs near the 4.5 month mark + if totalHours < 3277 { + // simple HMS case + minutes := d % time.Hour / time.Minute + seconds := d % time.Minute / hundredMs + return Period{0, 0, 0, sign10 * int16(totalHours), sign10 * int16(minutes), sign * int16(seconds)}, true + } + + totalDays := totalHours / 24 // ignoring daylight savings adjustments + + if totalDays < 3277 { + hours := totalHours - totalDays*24 + minutes := d % time.Hour / time.Minute + seconds := d % time.Minute / hundredMs + return Period{0, 0, sign10 * int16(totalDays), sign10 * int16(hours), sign10 * int16(minutes), sign * int16(seconds)}, false + } + + // TODO it is uncertain whether this is too imprecise and should be improved + years := (oneE4 * totalDays) / daysPerYearE4 + months := ((oneE4 * totalDays) / daysPerMonthE4) - (12 * years) + hours := totalHours - totalDays*24 + totalDays = ((totalDays * oneE4) - (daysPerMonthE4 * months) - (daysPerYearE4 * years)) / oneE4 + return Period{sign10 * int16(years), sign10 * int16(months), sign10 * int16(totalDays), sign10 * int16(hours), 0, 0}, false +} + +// Between converts the span between two times to a period. Based on the Gregorian conversion +// algorithms of `time.Time`, the resultant period is precise. +// +// To improve precision, result is not always fully normalised; for time differences less than 3276 hours +// (about 4.5 months), it will contain zero in the years, months and days fields but the number of hours +// may be up to 3275; this reduces errors arising from the variable lengths of months. For larger time +// differences (greater than 3276 hours) the days, months and years fields are used as well. +// +// Remember that the resultant period does not retain any knowledge of the calendar, so any subsequent +// computations applied to the period can only be precise if they concern either the date (year, month, +// day) part, or the clock (hour, minute, second) part, but not both. +func Between(t1, t2 time.Time) (p Period) { + if t1.Location() != t2.Location() { + t2 = t2.In(t1.Location()) + } + + sign := 1 + if t2.Before(t1) { + t1, t2, sign = t2, t1, -1 + } + + year, month, day, hour, min, sec, hundredth := daysDiff(t1, t2) + + if sign < 0 { + p = New(-year, -month, -day, -hour, -min, -sec) + p.seconds -= int16(hundredth) + } else { + p = New(year, month, day, hour, min, sec) + p.seconds += int16(hundredth) + } + return +} + +func daysDiff(t1, t2 time.Time) (year, month, day, hour, min, sec, hundredth int) { + duration := t2.Sub(t1) + + hh1, mm1, ss1 := t1.Clock() + hh2, mm2, ss2 := t2.Clock() + + day = int(duration / (24 * time.Hour)) + + hour = int(hh2 - hh1) + min = int(mm2 - mm1) + sec = int(ss2 - ss1) + hundredth = (t2.Nanosecond() - t1.Nanosecond()) / 100000000 + + // Normalize negative values + if sec < 0 { + sec += 60 + min-- + } + + if min < 0 { + min += 60 + hour-- + } + + if hour < 0 { + hour += 24 + // no need to reduce day - it's calculated differently. + } + + // test 16bit storage limit (with 1 fixed decimal place) + if day > 3276 { + y1, m1, d1 := t1.Date() + y2, m2, d2 := t2.Date() + year = y2 - y1 + month = int(m2 - m1) + day = d2 - d1 + } + + return +} + +// IsZero returns true if applied to a zero-length period. +func (period Period) IsZero() bool { + return period == Period{} +} + +// IsPositive returns true if any field is greater than zero. By design, this also implies that +// all the other fields are greater than or equal to zero. +func (period Period) IsPositive() bool { + return period.years > 0 || period.months > 0 || period.days > 0 || + period.hours > 0 || period.minutes > 0 || period.seconds > 0 +} + +// IsNegative returns true if any field is negative. By design, this also implies that +// all the other fields are negative or zero. +func (period Period) IsNegative() bool { + return period.years < 0 || period.months < 0 || period.days < 0 || + period.hours < 0 || period.minutes < 0 || period.seconds < 0 +} + +// Sign returns +1 for positive periods and -1 for negative periods. If the period is zero, it returns zero. +func (period Period) Sign() int { + if period.IsZero() { + return 0 + } + if period.IsNegative() { + return -1 + } + return 1 +} + +// OnlyYMD returns a new Period with only the year, month and day fields. The hour, +// minute and second fields are zeroed. +func (period Period) OnlyYMD() Period { + return Period{period.years, period.months, period.days, 0, 0, 0} +} + +// OnlyHMS returns a new Period with only the hour, minute and second fields. The year, +// month and day fields are zeroed. +func (period Period) OnlyHMS() Period { + return Period{0, 0, 0, period.hours, period.minutes, period.seconds} +} + +// Abs converts a negative period to a positive one. +func (period Period) Abs() Period { + return Period{absInt16(period.years), absInt16(period.months), absInt16(period.days), + absInt16(period.hours), absInt16(period.minutes), absInt16(period.seconds)} +} + +func absInt16(v int16) int16 { + if v < 0 { + return -v + } + return v +} + +// Negate changes the sign of the period. +func (period Period) Negate() Period { + return Period{-period.years, -period.months, -period.days, -period.hours, -period.minutes, -period.seconds} +} + +// Add adds two periods together. Use this method along with Negate in order to subtract periods. +// +// The result is not normalised and may overflow arithmetically (to make this unlikely, use Normalise on +// the inputs before adding them). +func (period Period) Add(that Period) Period { + return Period{ + period.years + that.years, + period.months + that.months, + period.days + that.days, + period.hours + that.hours, + period.minutes + that.minutes, + period.seconds + that.seconds, + } +} + +// Scale a period by a multiplication factor. Obviously, this can both enlarge and shrink it, +// and change the sign if negative. The result is normalised. +// +// Bear in mind that the internal representation is limited by fixed-point arithmetic with one +// decimal place; each field is only int16. +// +// Known issue: scaling by a large reduction factor (i.e. much less than one) doesn't work properly. +func (period Period) Scale(factor float32) Period { + + if -0.5 < factor && factor < 0.5 { + d, pr1 := period.Duration() + mul := float64(d) * float64(factor) + p2, pr2 := NewOf(time.Duration(mul)) + return p2.Normalise(pr1 && pr2) + } + + y := int64(float32(period.years) * factor) + m := int64(float32(period.months) * factor) + d := int64(float32(period.days) * factor) + hh := int64(float32(period.hours) * factor) + mm := int64(float32(period.minutes) * factor) + ss := int64(float32(period.seconds) * factor) + + return (&period64{y, m, d, hh, mm, ss, false}).normalise64(true).toPeriod() +} + +// Years gets the whole number of years in the period. +// The result is the number of years and does not include any other field. +func (period Period) Years() int { + return int(period.YearsFloat()) +} + +// YearsFloat gets the number of years in the period, including a fraction if any is present. +// The result is the number of years and does not include any other field. +func (period Period) YearsFloat() float32 { + return float32(period.years) / 10 +} + +// Months gets the whole number of months in the period. +// The result is the number of months and does not include any other field. +// +// Note that after normalisation, whole multiple of 12 months are added to +// the number of years, so the number of months will be reduced correspondingly. +func (period Period) Months() int { + return int(period.MonthsFloat()) +} + +// MonthsFloat gets the number of months in the period. +// The result is the number of months and does not include any other field. +// +// Note that after normalisation, whole multiple of 12 months are added to +// the number of years, so the number of months will be reduced correspondingly. +func (period Period) MonthsFloat() float32 { + return float32(period.months) / 10 +} + +// Days gets the whole number of days in the period. This includes the implied +// number of weeks but does not include any other field. +func (period Period) Days() int { + return int(period.DaysFloat()) +} + +// DaysFloat gets the number of days in the period. This includes the implied +// number of weeks but does not include any other field. +func (period Period) DaysFloat() float32 { + return float32(period.days) / 10 +} + +// Weeks calculates the number of whole weeks from the number of days. If the result +// would contain a fraction, it is truncated. +// The result is the number of weeks and does not include any other field. +// +// Note that weeks are synthetic: they are internally represented using days. +// See ModuloDays(), which returns the number of days excluding whole weeks. +func (period Period) Weeks() int { + return int(period.days) / 70 +} + +// WeeksFloat calculates the number of weeks from the number of days. +// The result is the number of weeks and does not include any other field. +func (period Period) WeeksFloat() float32 { + return float32(period.days) / 70 +} + +// ModuloDays calculates the whole number of days remaining after the whole number of weeks +// has been excluded. +func (period Period) ModuloDays() int { + days := absInt16(period.days) % 70 + f := int(days / 10) + if period.days < 0 { + return -f + } + return f +} + +// Hours gets the whole number of hours in the period. +// The result is the number of hours and does not include any other field. +func (period Period) Hours() int { + return int(period.HoursFloat()) +} + +// HoursFloat gets the number of hours in the period. +// The result is the number of hours and does not include any other field. +func (period Period) HoursFloat() float32 { + return float32(period.hours) / 10 +} + +// Minutes gets the whole number of minutes in the period. +// The result is the number of minutes and does not include any other field. +// +// Note that after normalisation, whole multiple of 60 minutes are added to +// the number of hours, so the number of minutes will be reduced correspondingly. +func (period Period) Minutes() int { + return int(period.MinutesFloat()) +} + +// MinutesFloat gets the number of minutes in the period. +// The result is the number of minutes and does not include any other field. +// +// Note that after normalisation, whole multiple of 60 minutes are added to +// the number of hours, so the number of minutes will be reduced correspondingly. +func (period Period) MinutesFloat() float32 { + return float32(period.minutes) / 10 +} + +// Seconds gets the whole number of seconds in the period. +// The result is the number of seconds and does not include any other field. +// +// Note that after normalisation, whole multiple of 60 seconds are added to +// the number of minutes, so the number of seconds will be reduced correspondingly. +func (period Period) Seconds() int { + return int(period.SecondsFloat()) +} + +// SecondsFloat gets the number of seconds in the period. +// The result is the number of seconds and does not include any other field. +// +// Note that after normalisation, whole multiple of 60 seconds are added to +// the number of minutes, so the number of seconds will be reduced correspondingly. +func (period Period) SecondsFloat() float32 { + return float32(period.seconds) / 10 +} + +// AddTo adds the period to a time, returning the result. +// A flag is also returned that is true when the conversion was precise and false otherwise. +// +// When the period specifies hours, minutes and seconds only, the result is precise. +// Also, when the period specifies whole years, months and days (i.e. without fractions), the +// result is precise. However, when years, months or days contains fractions, the result +// is only an approximation (it assumes that all days are 24 hours and every year is 365.2425 +// days, as per Gregorian calendar rules). +func (period Period) AddTo(t time.Time) (time.Time, bool) { + wholeYears := (period.years % 10) == 0 + wholeMonths := (period.months % 10) == 0 + wholeDays := (period.days % 10) == 0 + + if wholeYears && wholeMonths && wholeDays { + // in this case, time.AddDate provides an exact solution + stE3 := totalSecondsE3(period) + t1 := t.AddDate(int(period.years/10), int(period.months/10), int(period.days/10)) + return t1.Add(stE3 * time.Millisecond), true + } + + d, precise := period.Duration() + return t.Add(d), precise +} + +// DurationApprox converts a period to the equivalent duration in nanoseconds. +// When the period specifies hours, minutes and seconds only, the result is precise. +// however, when the period specifies years, months and days, it is impossible to be precise +// because the result may depend on knowing date and timezone information, so the duration +// is estimated on the basis of a year being 365.2425 days (as per Gregorian calendar rules) +// and a month being 1/12 of a that; days are all assumed to be 24 hours long. +func (period Period) DurationApprox() time.Duration { + d, _ := period.Duration() + return d +} + +// Duration converts a period to the equivalent duration in nanoseconds. +// A flag is also returned that is true when the conversion was precise and false otherwise. +// +// When the period specifies hours, minutes and seconds only, the result is precise. +// however, when the period specifies years, months and days, it is impossible to be precise +// because the result may depend on knowing date and timezone information, so the duration +// is estimated on the basis of a year being 365.2425 days as per Gregorian calendar rules) +// and a month being 1/12 of a that; days are all assumed to be 24 hours long. +func (period Period) Duration() (time.Duration, bool) { + // remember that the fields are all fixed-point 1E1 + tdE6 := time.Duration(totalDaysApproxE7(period) * 8640) + stE3 := totalSecondsE3(period) + return tdE6*time.Microsecond + stE3*time.Millisecond, tdE6 == 0 +} + +func totalSecondsE3(period Period) time.Duration { + // remember that the fields are all fixed-point 1E1 + // and these are divided by 1E1 + hhE3 := time.Duration(period.hours) * 360000 + mmE3 := time.Duration(period.minutes) * 6000 + ssE3 := time.Duration(period.seconds) * 100 + return hhE3 + mmE3 + ssE3 +} + +func totalDaysApproxE7(period Period) int64 { + // remember that the fields are all fixed-point 1E1 + ydE6 := int64(period.years) * (daysPerYearE4 * 100) + mdE6 := int64(period.months) * daysPerMonthE6 + ddE6 := int64(period.days) * oneE6 + return ydE6 + mdE6 + ddE6 +} + +// TotalDaysApprox gets the approximate total number of days in the period. The approximation assumes +// a year is 365.2425 days as per Gregorian calendar rules) and a month is 1/12 of that. Whole +// multiples of 24 hours are also included in the calculation. +func (period Period) TotalDaysApprox() int { + pn := period.Normalise(false) + tdE6 := totalDaysApproxE7(pn) + hE6 := (int64(pn.hours) * oneE6) / 24 + return int((tdE6 + hE6) / oneE7) +} + +// TotalMonthsApprox gets the approximate total number of months in the period. The days component +// is included by approximation, assuming a year is 365.2425 days (as per Gregorian calendar rules) +// and a month is 1/12 of that. Whole multiples of 24 hours are also included in the calculation. +func (period Period) TotalMonthsApprox() int { + pn := period.Normalise(false) + mE1 := int64(pn.years)*12 + int64(pn.months) + hE1 := int64(pn.hours) / 24 + dE1 := ((int64(pn.days) + hE1) * oneE6) / daysPerMonthE6 + return int((mE1 + dE1) / 10) +} + +// Normalise attempts to simplify the fields. It operates in either precise or imprecise mode. +// +// Because the number of hours per day is imprecise (due to daylight savings etc), and because +// the number of days per month is variable in the Gregorian calendar, there is a reluctance +// to transfer time too or from the days element. To give control over this, there are two modes. +// +// In precise mode: +// Multiples of 60 seconds become minutes. +// Multiples of 60 minutes become hours. +// Multiples of 12 months become years. +// +// Additionally, in imprecise mode: +// Multiples of 24 hours become days. +// Multiples of approx. 30.4 days become months. +// +// Note that leap seconds are disregarded: every minute is assumed to have 60 seconds. +func (period Period) Normalise(precise bool) Period { + const limit = 32670 - (32670 / 60) + + // can we use a quicker algorithm for HHMMSS with int16 arithmetic? + if period.years == 0 && period.months == 0 && + (!precise || period.days == 0) && + period.hours > -limit && period.hours < limit { + + return period.normaliseHHMMSS(precise) + } + + // can we use a quicker algorithm for YYMM with int16 arithmetic? + if (period.years != 0 || period.months != 0) && //period.months%10 == 0 && + period.days == 0 && period.hours == 0 && period.minutes == 0 && period.seconds == 0 { + + return period.normaliseYYMM() + } + + // do things the no-nonsense way using int64 arithmetic + return period.toPeriod64().normalise64(precise).toPeriod() +} + +func (period Period) normaliseHHMMSS(precise bool) Period { + s := period.Sign() + ap := period.Abs() + + // remember that the fields are all fixed-point 1E1 + ap.minutes += (ap.seconds / 600) * 10 + ap.seconds = ap.seconds % 600 + + ap.hours += (ap.minutes / 600) * 10 + ap.minutes = ap.minutes % 600 + + // up to 36 hours stays as hours + if !precise && ap.hours > 360 { + ap.days += (ap.hours / 240) * 10 + ap.hours = ap.hours % 240 + } + + d10 := ap.days % 10 + if d10 != 0 && (ap.hours != 0 || ap.minutes != 0 || ap.seconds != 0) { + ap.hours += d10 * 24 + ap.days -= d10 + } + + hh10 := ap.hours % 10 + if hh10 != 0 { + ap.minutes += hh10 * 60 + ap.hours -= hh10 + } + + mm10 := ap.minutes % 10 + if mm10 != 0 { + ap.seconds += mm10 * 60 + ap.minutes -= mm10 + } + + if s < 0 { + return ap.Negate() + } + return ap +} + +func (period Period) normaliseYYMM() Period { + s := period.Sign() + ap := period.Abs() + + // remember that the fields are all fixed-point 1E1 + if ap.months > 129 { + ap.years += (ap.months / 120) * 10 + ap.months = ap.months % 120 + } + + y10 := ap.years % 10 + if y10 != 0 && (ap.years < 10 || ap.months != 0) { + ap.months += y10 * 12 + ap.years -= y10 + } + + if s < 0 { + return ap.Negate() + } + return ap +} + +//------------------------------------------------------------------------------------------------- + +// used for stages in arithmetic +type period64 struct { + years, months, days, hours, minutes, seconds int64 + neg bool +} + +func (period Period) toPeriod64() *period64 { + return &period64{ + int64(period.years), int64(period.months), int64(period.days), + int64(period.hours), int64(period.minutes), int64(period.seconds), + false, + } +} + +func (p *period64) toPeriod() Period { + if p.neg { + return Period{ + int16(-p.years), int16(-p.months), int16(-p.days), + int16(-p.hours), int16(-p.minutes), int16(-p.seconds), + } + } + + return Period{ + int16(p.years), int16(p.months), int16(p.days), + int16(p.hours), int16(p.minutes), int16(p.seconds), + } +} + +func (p *period64) normalise64(precise bool) *period64 { + return p.abs().rippleUp(precise).moveFractionToRight() +} + +func (p *period64) abs() *period64 { + + if !p.neg { + if p.years < 0 { + p.years = -p.years + p.neg = true + } + + if p.months < 0 { + p.months = -p.months + p.neg = true + } + + if p.days < 0 { + p.days = -p.days + p.neg = true + } + + if p.hours < 0 { + p.hours = -p.hours + p.neg = true + } + + if p.minutes < 0 { + p.minutes = -p.minutes + p.neg = true + } + + if p.seconds < 0 { + p.seconds = -p.seconds + p.neg = true + } + } + return p +} + +func (p *period64) rippleUp(precise bool) *period64 { + // remember that the fields are all fixed-point 1E1 + + p.minutes = p.minutes + (p.seconds/600)*10 + p.seconds = p.seconds % 600 + + p.hours = p.hours + (p.minutes/600)*10 + p.minutes = p.minutes % 600 + + // 32670-(32670/60)-(32670/3600) = 32760 - 546 - 9.1 = 32204.9 + if !precise || p.hours > 32204 { + p.days += (p.hours / 240) * 10 + p.hours = p.hours % 240 + } + + if !precise || p.days > 32760 { + dE6 := p.days * oneE6 + p.months += dE6 / daysPerMonthE6 + p.days = (dE6 % daysPerMonthE6) / oneE6 + } + + p.years = p.years + (p.months/120)*10 + p.months = p.months % 120 + + return p +} + +// moveFractionToRight applies the rule that only the smallest field is permitted to have a decimal fraction. +func (p *period64) moveFractionToRight() *period64 { + // remember that the fields are all fixed-point 1E1 + + y10 := p.years % 10 + if y10 != 0 && (p.months != 0 || p.days != 0 || p.hours != 0 || p.minutes != 0 || p.seconds != 0) { + p.months += y10 * 12 + p.years = (p.years / 10) * 10 + } + + m10 := p.months % 10 + if m10 != 0 && (p.days != 0 || p.hours != 0 || p.minutes != 0 || p.seconds != 0) { + p.days += (m10 * daysPerMonthE6) / oneE6 + p.months = (p.months / 10) * 10 + } + + d10 := p.days % 10 + if d10 != 0 && (p.hours != 0 || p.minutes != 0 || p.seconds != 0) { + p.hours += d10 * 24 + p.days = (p.days / 10) * 10 + } + + hh10 := p.hours % 10 + if hh10 != 0 && (p.minutes != 0 || p.seconds != 0) { + p.minutes += hh10 * 60 + p.hours = (p.hours / 10) * 10 + } + + mm10 := p.minutes % 10 + if mm10 != 0 && p.seconds != 0 { + p.seconds += mm10 * 60 + p.minutes = (p.minutes / 10) * 10 + } + + return p +} diff --git a/vendor/github.com/rickb777/plural/.gitignore b/vendor/github.com/rickb777/plural/.gitignore new file mode 100644 index 0000000000000..49ef8df4f05e0 --- /dev/null +++ b/vendor/github.com/rickb777/plural/.gitignore @@ -0,0 +1,26 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj/ +_test/ +vendor/ + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof +*.out diff --git a/vendor/github.com/rickb777/plural/.travis.yml b/vendor/github.com/rickb777/plural/.travis.yml new file mode 100644 index 0000000000000..70996d4b7eebc --- /dev/null +++ b/vendor/github.com/rickb777/plural/.travis.yml @@ -0,0 +1,11 @@ +language: go + +go: + - tip + +install: + - go get -t -v . + - go get github.com/mattn/goveralls + +script: + - ./build+test.sh diff --git a/vendor/github.com/rickb777/plural/LICENSE b/vendor/github.com/rickb777/plural/LICENSE new file mode 100644 index 0000000000000..4faeca514a09b --- /dev/null +++ b/vendor/github.com/rickb777/plural/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2016, Rick Beton +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of plural nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/vendor/github.com/rickb777/plural/README.md b/vendor/github.com/rickb777/plural/README.md new file mode 100644 index 0000000000000..b73bc25666920 --- /dev/null +++ b/vendor/github.com/rickb777/plural/README.md @@ -0,0 +1,28 @@ +# plural - Simple Go API for Pluralisation. + +[![GoDoc](https://img.shields.io/badge/api-Godoc-blue.svg?style=flat-square)](https://godoc.org/github.com/rickb777/plural) +[![Build Status](https://travis-ci.org/rickb777/plural.svg?branch=master)](https://travis-ci.org/rickb777/plural) +[![Coverage Status](https://coveralls.io/repos/github/rickb777/plural/badge.svg?branch=master&service=github)](https://coveralls.io/github/rickb777/plural?branch=master) +[![Go Report Card](https://goreportcard.com/badge/github.com/rickb777/plural)](https://goreportcard.com/report/github.com/rickb777/plural) +[![Issues](https://img.shields.io/github/issues/rickb777/plural.svg)](https://github.com/rickb777/plural/issues) + +Package plural provides simple support for localising plurals in a flexible range of different styles. + +There are considerable differences around the world in the way plurals are handled. This is a simple +but competent API for catering with these differences when presenting to people formatted text with numbers. + +This package is able to format **countable things** and **continuous values**. It can handle integers +and floating point numbers equally and this allows you to decide to what extent each is appropriate. + +For example, `2 cars` might weigh `1.6 tonnes`; both categories are covered. + +This API is deliberately simple; it doesn't address the full gamut of internationalisation. If that's +what you need, you should consider products such as https://github.com/nicksnyder/go-i18n instead. + +## Installation + + go get -u github.com/rickb777/plural + +## Status + +This library has been in reliable production use for some time. Versioning follows the well-known semantic version pattern. diff --git a/vendor/github.com/rickb777/plural/build+test.sh b/vendor/github.com/rickb777/plural/build+test.sh new file mode 100644 index 0000000000000..d4a3834206581 --- /dev/null +++ b/vendor/github.com/rickb777/plural/build+test.sh @@ -0,0 +1,13 @@ +#!/bin/bash -e +cd $(dirname $0) +PATH=$HOME/gopath/bin:$GOPATH/bin:$PATH + +if ! type -p goveralls; then + echo go get github.com/mattn/goveralls + go get github.com/mattn/goveralls +fi + +echo date... +go test -v -covermode=count -coverprofile=date.out . +go tool cover -func=date.out +[ -z "$COVERALLS_TOKEN" ] || goveralls -coverprofile=date.out -service=travis-ci -repotoken $COVERALLS_TOKEN diff --git a/vendor/github.com/rickb777/plural/doc.go b/vendor/github.com/rickb777/plural/doc.go new file mode 100644 index 0000000000000..90adf6b550310 --- /dev/null +++ b/vendor/github.com/rickb777/plural/doc.go @@ -0,0 +1,20 @@ +// Copyright 2016 Rick Beton. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package plural provides simple support for localising plurals in a flexible range of different styles. +// +// There are considerable differences around the world in the way plurals are handled. This is +// a simple but competent API for catering with these differences when presenting to people formatted text with numbers. +// +// This package is able to format countable things and continuous values. It can handle integers +// and floating point numbers equally and this allows you to decide to what extent each is appropriate. +// +// For example, "2 cars" might weigh "1.6 tonnes"; both categories are covered. +// +// This API is deliberately simple; it doesn't address the full gamut of internationalisation. If that's +// what you need, you should consider products such as https://github.com/nicksnyder/go-i18n instead. +// +// Please see the examples and associated api documentation. +// +package plural diff --git a/vendor/github.com/rickb777/plural/plural.go b/vendor/github.com/rickb777/plural/plural.go new file mode 100644 index 0000000000000..794a433f6604e --- /dev/null +++ b/vendor/github.com/rickb777/plural/plural.go @@ -0,0 +1,203 @@ +package plural + +import ( + "fmt" + "strings" +) + +// Case is the inner element of this API and describes one case. When the number to be described +// matches the number here, the corresponding format string will be used. If the format string +// includes '%', then fmt.Sprintf will be used. Otherwise the format string will be returned verbatim. +type Case struct { + Number int + Format string +} + +// Plurals provides a list of plural cases in the order they will be searched. +// For plurals of continuous ranges (e.g. weight), the cases must be in ascending number order. +// For plurals of discrete ranges (i.e. integers), the cases can be in any order you require, +// but will conventionally be in ascending number order. +// If no match is found, the last case will be used. +type Plurals []Case + +// Format searches through the plural cases for the first match. If none is found, the last +// case is used. The value passed in can be any number type, or pointer to a number type, except +// complex numbers are not supported. The value will be converted to an int in order to +// find the first case that matches. +// The only possible error arises if value has a type that is not numeric. +// It panics if 'plurals' is empty. +func (plurals Plurals) Format(value interface{}) (string, error) { + switch x := value.(type) { + case int: + return plurals.FormatInt(x), nil + case int8: + return plurals.FormatInt(int(x)), nil + case int16: + return plurals.FormatInt(int(x)), nil + case int32: + return plurals.FormatInt(int(x)), nil + case int64: + return plurals.FormatInt(int(x)), nil + case uint8: + return plurals.FormatInt(int(x)), nil + case uint16: + return plurals.FormatInt(int(x)), nil + case uint32: + return plurals.FormatInt(int(x)), nil + case uint64: + return plurals.FormatInt(int(x)), nil + case float32: + return plurals.FormatFloat(x), nil + case float64: + return plurals.FormatFloat(float32(x)), nil + + case *int: + return plurals.FormatInt(*x), nil + case *int8: + return plurals.FormatInt(int(*x)), nil + case *int16: + return plurals.FormatInt(int(*x)), nil + case *int32: + return plurals.FormatInt(int(*x)), nil + case *int64: + return plurals.FormatInt(int(*x)), nil + case *uint: + return plurals.FormatInt(int(*x)), nil + case *uint8: + return plurals.FormatInt(int(*x)), nil + case *uint16: + return plurals.FormatInt(int(*x)), nil + case *uint32: + return plurals.FormatInt(int(*x)), nil + case *uint64: + return plurals.FormatInt(int(*x)), nil + case *float32: + return plurals.FormatFloat(*x), nil + case *float64: + return plurals.FormatFloat(float32(*x)), nil + + case nil: + return "", fmt.Errorf("Unexpected nil value for %s", plurals) + default: + return "", fmt.Errorf("Unexpected type %T for %v", x, value) + } +} + +// FormatInt expresses an int in plural form. It panics if 'plurals' is empty. +func (plurals Plurals) FormatInt(value int) string { + for _, c := range plurals { + if value == c.Number { + return c.FormatInt(value) + } + } + c := plurals[len(plurals)-1] + return c.FormatInt(value) +} + +// FormatFloat expresses a float32 in plural form. It panics if 'plurals' is empty. +func (plurals Plurals) FormatFloat(value float32) string { + for _, c := range plurals { + if value <= float32(c.Number) { + return c.FormatFloat(value) + } + } + c := plurals[len(plurals)-1] + return c.FormatFloat(value) +} + +// FormatInt renders a specific case with a given value. +func (c Case) FormatInt(value int) string { + if strings.IndexByte(c.Format, '%') < 0 { + return c.Format + } + return fmt.Sprintf(c.Format, value) +} + +// FormatFloat renders a specific case with a given value. +func (c Case) FormatFloat(value float32) string { + if strings.IndexByte(c.Format, '%') < 0 { + return c.Format + } + return fmt.Sprintf(c.Format, value) +} + +//------------------------------------------------------------------------------------------------- + +// String implements io.Stringer. +func (plurals Plurals) String() string { + ss := make([]string, 0, len(plurals)) + for _, c := range plurals { + ss = append(ss, c.String()) + } + return fmt.Sprintf("Plurals(%s)", strings.Join(ss, ", ")) +} + +// String implements io.Stringer. +func (c Case) String() string { + return fmt.Sprintf("{%v -> %q}", c.Number, c.Format) +} + +//------------------------------------------------------------------------------------------------- + +// ByOrdinal constructs a simple set of cases using small ordinals (0, 1, 2, 3 etc), which is a +// common requirement. It is an alias for FromZero. +func ByOrdinal(zeroth string, rest ...string) Plurals { + return FromZero(zeroth, rest...) +} + +// FromZero constructs a simple set of cases using small ordinals (0, 1, 2, 3 etc), which is a +// common requirement. It prevents creation of a Plurals list that is empty, which would be invalid. +// +// The 'zeroth' string becomes Case{0, first}. The rest are appended similarly. Notice that the +// counting starts from zero. +// +// So +// +// FromZero("nothing", "%v thing", "%v things") +// +// is simply a shorthand for +// +// Plurals{Case{0, "nothing"}, Case{1, "%v thing"}, Case{2, "%v things"}} +// +// which would also be valid but a little more verbose. +// +// This helper function is less flexible than constructing Plurals directly, but covers many common +// situations. +func FromZero(zeroth string, rest ...string) Plurals { + p := make(Plurals, 0, len(rest)+1) + p = append(p, Case{0, zeroth}) + for i, c := range rest { + p = append(p, Case{i+1, c}) + } + return p +} + +// FromOne constructs a simple set of cases using small positive numbers (1, 2, 3 etc), which is a +// common requirement. It prevents creation of a Plurals list that is empty, which would be invalid. +// +// The 'first' string becomes Case{1, first}. The rest are appended similarly. Notice that the +// counting starts from one. +// +// So +// +// FromOne("%v thing", "%v things") +// +// is simply a shorthand for +// +// Plurals{Case{1, "%v thing"}, Case{2, "%v things"}} +// +// which would also be valid but a little more verbose. +// +// Note the behaviour of formatting when the count is zero. As a consequence of Format evaluating +// the cases in order, FromOne(...).FormatInt(0) will pick the last case you provide, not the first. +// +// This helper function is less flexible than constructing Plurals directly, but covers many common +// situations. +func FromOne(first string, rest ...string) Plurals { + p := make(Plurals, 0, len(rest)+1) + p = append(p, Case{1, first}) + for i, c := range rest { + p = append(p, Case{i+2, c}) + } + return p +} diff --git a/vendor/modules.txt b/vendor/modules.txt index 779961db7630e..013ce9b3f746f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -325,6 +325,10 @@ github.com/posener/complete github.com/posener/complete/cmd github.com/posener/complete/cmd/install github.com/posener/complete/match +# github.com/rickb777/date v1.12.5-0.20200422084442-6300e543c4d9 +github.com/rickb777/date/period +# github.com/rickb777/plural v1.2.0 +github.com/rickb777/plural # github.com/satori/go.uuid v1.2.0 github.com/satori/go.uuid # github.com/satori/uuid v0.0.0-20160927100844-b061729afc07 diff --git a/website/azurerm.erb b/website/azurerm.erb index a22b4bb6a98b8..28474f9ca9d12 100644 --- a/website/azurerm.erb +++ b/website/azurerm.erb @@ -2279,6 +2279,10 @@
  • azurerm_sentinel_alert_rule_ms_security_incident
  • + +
  • + azurerm_sentinel_alert_rule_scheduled +
  • diff --git a/website/docs/r/sentinel_alert_rule_scheduled.html.markdown b/website/docs/r/sentinel_alert_rule_scheduled.html.markdown new file mode 100644 index 0000000000000..e911e56ec6a77 --- /dev/null +++ b/website/docs/r/sentinel_alert_rule_scheduled.html.markdown @@ -0,0 +1,105 @@ +--- +subcategory: "Sentinel" +layout: "azurerm" +page_title: "Azure Resource Manager: azurerm_sentinel_alert_rule_scheduled" +description: |- + Manages a Sentinel Scheduled Alert Rule. +--- + +# azurerm_sentinel_alert_rule_scheduled + +Manages a Sentinel Scheduled Alert Rule. + +## Example Usage + +```hcl +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "example" { + name = "example-resources" + location = "West Europe" +} + +resource "azurerm_log_analytics_workspace" "example" { + name = "example-workspace" + location = azurerm_resource_group.example.location + resource_group_name = azurerm_resource_group.example.name + sku = "pergb2018" +} + +resource "azurerm_sentinel_alert_rule_scheduled" "example" { + name = "example" + log_analytics_workspace_id = azurerm_log_analytics_workspace.example.id + display_name = "example" + severity = "High" + query = < **NOTE** `query_period` must larger than or equal to `query_frequency`, which ensures there is no gaps in the overall query coverage. + +* `suppression_duration` - (Optional) If `suppression_enabled` is `true`, this is ISO 8601 timespan duration, which specifies the amount of time the query should stop running after alert is generated. Defaults to `PT5H`. + +-> **NOTE** `suppression_duration` must larger than or equal to `query_frequency`, otherwise the suppression has no actual effect since no query will happen during the suppression duration. + +* `suppression_enabled` - (Optional) Should the Sentinel Scheduled Alert Rulea stop running query after alert is generated? Defaults to `false`. + +* `tactics` - (Optional) A list of categories of attacks by which to classify the rule. Possible values are `Collection`, `CommandAndControl`, `CredentialAccess`, `DefenseEvasion`, `Discovery`, `Execution`, `Exfiltration`, `Impact`, `InitialAccess`, `LateralMovement`, `Persistence` and `PrivilegeEscalation`. + +* `trigger_operator` - (Optional) The alert trigger operator, combined with `trigger_threshold`, setting alert threshold of this Sentinel Scheduled Alert Rule. Possible values are `Equal`, `GreaterThan`, `LessThan`, `NotEqual`. + +* `trigger_threshold` - (Optional) The baseline number of query results generated, combined with `trigger_operator`, setting alert threshold of this Sentinel Scheduled Alert Rule. + +## Attributes Reference + +In addition to the Arguments listed above - the following Attributes are exported: + +* `id` - The ID of the Sentinel Scheduled Alert Rule. + +## Timeouts + +The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: + +* `create` - (Defaults to 30 minutes) Used when creating the Sentinel Scheduled Alert Rule. +* `read` - (Defaults to 5 minutes) Used when retrieving the Sentinel Scheduled Alert Rule. +* `update` - (Defaults to 30 minutes) Used when updating the Sentinel Scheduled Alert Rule. +* `delete` - (Defaults to 30 minutes) Used when deleting the Sentinel Scheduled Alert Rule. + +## Import + +Sentinel Scheduled Alert Rules can be imported using the `resource id`, e.g. + +```shell +terraform import azurerm_sentinel_alert_rule_scheduled.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.OperationalInsights/workspaces/workspace1/providers/Microsoft.SecurityInsights/alertRules/rule1 +``` From 24b380766f299e05cd5263ba768843630e54e5fb Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Thu, 7 May 2020 07:34:10 -0700 Subject: [PATCH 223/223] Update for #6650 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db6c030b470b2..3aaf54c72616c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ FEATURES: * **New Data Source:** `azurerm_data_share_account` [GH-6575] * **New Resource:** `azurerm_data_share_account` [GH-6575] * **New Resource:** `azurerm_function_app_slot` [GH-6435] +* **New resource:** `azurerm_sentinel_alert_rule_scheduled` [GH-6650] IMPROVEMENTS: