From 5525a83600d22da62050990943ea8864294d0710 Mon Sep 17 00:00:00 2001 From: Konstantin Kosinsky Date: Tue, 17 Mar 2020 11:09:07 -0700 Subject: [PATCH 001/142] 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/142] 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/142] 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/142] 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/142] 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/142] 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/142] 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/142] 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/142] 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/142] 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/142] `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/142] 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/142] `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/142] 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/142] `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/142] 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/142] 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/142] 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/142] `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/142] `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/142] 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/142] 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/142] 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/142] ... --- 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/142] ... --- 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/142] 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 72652caf5e27e0aa5e135fd7dfa25f0ad017595f Mon Sep 17 00:00:00 2001 From: Konstantin Kosinsky Date: Fri, 24 Apr 2020 09:55:24 -0700 Subject: [PATCH 027/142] 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 189a4599e83e233afb59505f0a458bbf80285a6a Mon Sep 17 00:00:00 2001 From: Konstantin Kosinsky Date: Fri, 24 Apr 2020 17:54:18 -0700 Subject: [PATCH 028/142] 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 27e5d73ee364ca17e3376868b729bee247af8957 Mon Sep 17 00:00:00 2001 From: Austin Cheung Date: Wed, 29 Apr 2020 18:58:44 -0700 Subject: [PATCH 029/142] add name and priority to ip_restriction for app_service --- azurerm/helpers/azure/app_service.go | 34 +++++++++++ .../web/tests/data_source_app_service_test.go | 4 +- .../tests/resource_arm_app_service_test.go | 60 +++++++++++++++++++ website/docs/d/app_service.html.markdown | 4 ++ website/docs/r/app_service.html.markdown | 4 ++ 5 files changed, 105 insertions(+), 1 deletion(-) diff --git a/azurerm/helpers/azure/app_service.go b/azurerm/helpers/azure/app_service.go index fd9ae4b636f2e..48818cf1ab71f 100644 --- a/azurerm/helpers/azure/app_service.go +++ b/azurerm/helpers/azure/app_service.go @@ -316,6 +316,16 @@ func SchemaAppServiceSiteConfig() *schema.Schema { Optional: true, ValidateFunc: validation.StringIsNotEmpty, }, + "name": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + "priority": { + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntAtLeast(1), + }, }, }, }, @@ -679,6 +689,14 @@ func SchemaAppServiceDataSourceSiteConfig() *schema.Schema { Type: schema.TypeString, Computed: true, }, + "name": { + Type: schema.TypeString, + Computed: true, + }, + "priority": { + Type: schema.TypeInt, + Computed: true, + }, }, }, }, @@ -1419,6 +1437,8 @@ func ExpandAppServiceSiteConfig(input interface{}) (*web.SiteConfig, error) { ipAddress := restriction["ip_address"].(string) vNetSubnetID := restriction["virtual_network_subnet_id"].(string) + name := restriction["name"].(string) + priority := restriction["priority"].(int) if vNetSubnetID != "" && ipAddress != "" { return siteConfig, fmt.Errorf(fmt.Sprintf("only one of `ip_address` or `virtual_network_subnet_id` can be set for `site_config.0.ip_restriction.%d`", i)) } @@ -1440,6 +1460,14 @@ func ExpandAppServiceSiteConfig(input interface{}) (*web.SiteConfig, error) { ipSecurityRestriction.VnetSubnetResourceID = &vNetSubnetID } + if name != "" { + ipSecurityRestriction.Name = &name + } + + if priority != 0 { + ipSecurityRestriction.Priority = utils.Int32(int32(priority)) + } + restrictions = append(restrictions, ipSecurityRestriction) } siteConfig.IPSecurityRestrictions = &restrictions @@ -1564,6 +1592,12 @@ func FlattenAppServiceSiteConfig(input *web.SiteConfig) []interface{} { if vNetSubnetID := v.VnetSubnetResourceID; vNetSubnetID != nil { block["virtual_network_subnet_id"] = *vNetSubnetID } + if name := v.Name; name != nil { + block["name"] = *name + } + if priority := v.Priority; priority != nil { + block["priority"] = *priority + } restrictions = append(restrictions, block) } } diff --git a/azurerm/internal/services/web/tests/data_source_app_service_test.go b/azurerm/internal/services/web/tests/data_source_app_service_test.go index 263e30d8896ff..570d1e9fcf53c 100644 --- a/azurerm/internal/services/web/tests/data_source_app_service_test.go +++ b/azurerm/internal/services/web/tests/data_source_app_service_test.go @@ -137,6 +137,8 @@ func TestAccDataSourceAzureRMAppService_ipRestriction(t *testing.T) { Config: testAccDataSourceAppService_ipRestriction(data), Check: resource.ComposeTestCheckFunc( 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"), ), }, }, @@ -271,7 +273,7 @@ data "azurerm_app_service" "test" { } func testAccDataSourceAppService_ipRestriction(data acceptance.TestData) string { - config := testAccAzureRMAppService_oneIpRestriction(data) + config := testAccAzureRMAppService_completeIpRestriction(data) return fmt.Sprintf(` %s 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..89f26e2cc6d45 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 @@ -514,6 +514,27 @@ func TestAccAzureRMAppService_oneIpRestriction(t *testing.T) { }) } +func TestAccAzureRMAppService_completeIpRestriction(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_completeIpRestriction(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMAppServiceExists(data.ResourceName), + 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(), + }, + }) +} + func TestAccAzureRMAppService_oneVNetSubnetIpRestriction(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_app_service", "test") resource.ParallelTest(t, resource.TestCase{ @@ -2582,6 +2603,45 @@ resource "azurerm_app_service" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) } +func testAccAzureRMAppService_completeIpRestriction(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 + } + } +} +`, data.RandomInteger, data.Locations.Primary, data.RandomInteger, data.RandomInteger) +} + func testAccAzureRMAppService_oneVNetSubnetIpRestriction(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { diff --git a/website/docs/d/app_service.html.markdown b/website/docs/d/app_service.html.markdown index 07d6832efc6b0..b73d39320132e 100644 --- a/website/docs/d/app_service.html.markdown +++ b/website/docs/d/app_service.html.markdown @@ -85,6 +85,10 @@ A `ip_restriction` block exports the following: * `subnet_mask` - The Subnet mask used for this IP Restriction. +* `name` - The name for this IP Restriction. + +* `priority` - The priority for this IP Restriction. + --- `site_config` supports the following: diff --git a/website/docs/r/app_service.html.markdown b/website/docs/r/app_service.html.markdown index 71470c6a98923..a12c5e301a706 100644 --- a/website/docs/r/app_service.html.markdown +++ b/website/docs/r/app_service.html.markdown @@ -309,6 +309,10 @@ A `ip_restriction` block supports the following: -> **NOTE:** One of either `ip_address` or `virtual_network_subnet_id` must be specified +* `name` - (Optional) The name for this IP Restriction. + +* `priority` - (Optional) The priority for this IP Restriction. Restrictions are enforced in priority order. + --- A `microsoft` block supports the following: From 88f3786b5cf51581d2527f86db2c6c37dfb57750 Mon Sep 17 00:00:00 2001 From: Austin Cheung Date: Wed, 29 Apr 2020 22:21:04 -0700 Subject: [PATCH 030/142] make priority computed --- azurerm/helpers/azure/app_service.go | 1 + .../services/web/tests/resource_arm_app_service_test.go | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/azurerm/helpers/azure/app_service.go b/azurerm/helpers/azure/app_service.go index 48818cf1ab71f..e1ab1fc260b09 100644 --- a/azurerm/helpers/azure/app_service.go +++ b/azurerm/helpers/azure/app_service.go @@ -324,6 +324,7 @@ func SchemaAppServiceSiteConfig() *schema.Schema { "priority": { Type: schema.TypeInt, Optional: true, + Computed: true, ValidateFunc: validation.IntAtLeast(1), }, }, 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 89f26e2cc6d45..bc1ec8a6a0cd4 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 @@ -2633,9 +2633,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 } } } From 1270e902cfbb20d0ff50d7aa071dd88969219810 Mon Sep 17 00:00:00 2001 From: Austin Cheung Date: Fri, 1 May 2020 15:11:34 -0700 Subject: [PATCH 031/142] changes for review feedback --- azurerm/helpers/azure/app_service.go | 2 +- website/docs/r/app_service.html.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azurerm/helpers/azure/app_service.go b/azurerm/helpers/azure/app_service.go index e1ab1fc260b09..5e87f7f293229 100644 --- a/azurerm/helpers/azure/app_service.go +++ b/azurerm/helpers/azure/app_service.go @@ -325,7 +325,7 @@ func SchemaAppServiceSiteConfig() *schema.Schema { Type: schema.TypeInt, Optional: true, Computed: true, - ValidateFunc: validation.IntAtLeast(1), + ValidateFunc: validation.IntBetween(1, 65000), }, }, }, diff --git a/website/docs/r/app_service.html.markdown b/website/docs/r/app_service.html.markdown index a12c5e301a706..b044515baa89d 100644 --- a/website/docs/r/app_service.html.markdown +++ b/website/docs/r/app_service.html.markdown @@ -311,7 +311,7 @@ A `ip_restriction` block supports the following: * `name` - (Optional) The name for this IP Restriction. -* `priority` - (Optional) The priority for this IP Restriction. Restrictions are enforced in priority order. +* `priority` - (Optional) The priority for this IP Restriction. Restrictions are enforced in priority order. By default, priority is set to 65000 if not specified. --- From b3c16f4c7893e119214c0afdc25b91ab388484cd Mon Sep 17 00:00:00 2001 From: Austin Cheung Date: Fri, 1 May 2020 15:47:14 -0700 Subject: [PATCH 032/142] update max allowed priority --- azurerm/helpers/azure/app_service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azurerm/helpers/azure/app_service.go b/azurerm/helpers/azure/app_service.go index 5e87f7f293229..be90a7f434dfd 100644 --- a/azurerm/helpers/azure/app_service.go +++ b/azurerm/helpers/azure/app_service.go @@ -325,7 +325,7 @@ func SchemaAppServiceSiteConfig() *schema.Schema { Type: schema.TypeInt, Optional: true, Computed: true, - ValidateFunc: validation.IntBetween(1, 65000), + ValidateFunc: validation.IntBetween(1, 2147483647), }, }, }, From b2d58c483e95d3311a5b2338ee3d2ad49a4091fe Mon Sep 17 00:00:00 2001 From: Marten Bohlin Date: Sun, 3 May 2020 21:18:29 +0200 Subject: [PATCH 033/142] Workaround for strange response code in recovery services network mappings API. Fixes issue #6026 --- .../resource_arm_site_recovery_network_mapping.go | 6 ++++-- .../resource_arm_site_recovery_network_mapping_test.go | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/azurerm/internal/services/recoveryservices/resource_arm_site_recovery_network_mapping.go b/azurerm/internal/services/recoveryservices/resource_arm_site_recovery_network_mapping.go index 94a6efdb862c3..ccb323625854d 100644 --- a/azurerm/internal/services/recoveryservices/resource_arm_site_recovery_network_mapping.go +++ b/azurerm/internal/services/recoveryservices/resource_arm_site_recovery_network_mapping.go @@ -2,6 +2,7 @@ package recoveryservices import ( "fmt" + "net/http" "time" "github.com/Azure/azure-sdk-for-go/services/recoveryservices/mgmt/2018-01-10/siterecovery" @@ -106,8 +107,9 @@ func resourceArmSiteRecoveryNetworkMappingCreate(d *schema.ResourceData, meta in if features.ShouldResourcesBeImported() && d.IsNewResource() { existing, err := client.Get(ctx, fabricName, sourceNetworkName, name) if err != nil { - if !utils.ResponseWasNotFound(existing.Response) { - return fmt.Errorf("Error checking for presence of existing site recovery network mapping %s (vault %s): %+v", name, vaultName, err) + if !utils.ResponseWasNotFound(existing.Response) && + !utils.ResponseWasStatusCode(existing.Response, http.StatusBadRequest) { // API incorrectly returns 400 instead of 404 + return fmt.Errorf("hej Error checking for presence of existing site recovery network mapping %s (vault %s): %+v", name, vaultName, err) } } diff --git a/azurerm/internal/services/recoveryservices/tests/resource_arm_site_recovery_network_mapping_test.go b/azurerm/internal/services/recoveryservices/tests/resource_arm_site_recovery_network_mapping_test.go index f4d7217121d12..5a1d1ee2a303b 100644 --- a/azurerm/internal/services/recoveryservices/tests/resource_arm_site_recovery_network_mapping_test.go +++ b/azurerm/internal/services/recoveryservices/tests/resource_arm_site_recovery_network_mapping_test.go @@ -112,7 +112,7 @@ func testCheckAzureRMSiteRecoveryNetworkMappingExists(resourceName string) resou if err != nil { return err } - networkName := id.Path["virtualNetworks"] + networkName := id.Path["virtualnetworks"] client := acceptance.AzureProvider.Meta().(*clients.Client).RecoveryServices.NetworkMappingClient(resourceGroupName, vaultName) @@ -120,7 +120,7 @@ func testCheckAzureRMSiteRecoveryNetworkMappingExists(resourceName string) resou resp, err := client.Get(ctx, fabricName, networkName, mappingName) if err != nil { if resp.Response.StatusCode == http.StatusNotFound { - return fmt.Errorf("Bad: networkMapping %q (network %q) does not exist", mappingName, networkName) + return fmt.Errorf("Bad: networkMapping %q (network %q, %q) does not exist", mappingName, networkName, networkId) } return fmt.Errorf("Bad: Get on networkMappingClient: %+v", err) From c3da179a318df3caee2b635339007141bfa448b9 Mon Sep 17 00:00:00 2001 From: Austin Cheung Date: Sun, 3 May 2020 17:50:55 -0700 Subject: [PATCH 034/142] make dfault explicit --- azurerm/helpers/azure/app_service.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azurerm/helpers/azure/app_service.go b/azurerm/helpers/azure/app_service.go index be90a7f434dfd..d75b58d9da222 100644 --- a/azurerm/helpers/azure/app_service.go +++ b/azurerm/helpers/azure/app_service.go @@ -324,7 +324,7 @@ func SchemaAppServiceSiteConfig() *schema.Schema { "priority": { Type: schema.TypeInt, Optional: true, - Computed: true, + Default: 65000, ValidateFunc: validation.IntBetween(1, 2147483647), }, }, From 0cc4b04ce8b19749973bd7baa7794e4ba9b76fbc Mon Sep 17 00:00:00 2001 From: jackofallops Date: Mon, 4 May 2020 09:12:24 +0100 Subject: [PATCH 035/142] minor docs update --- .../r/hdinsight_hadoop_cluster.html.markdown | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/website/docs/r/hdinsight_hadoop_cluster.html.markdown b/website/docs/r/hdinsight_hadoop_cluster.html.markdown index bc7e707932a2b..bccdc6d1b00bd 100644 --- a/website/docs/r/hdinsight_hadoop_cluster.html.markdown +++ b/website/docs/r/hdinsight_hadoop_cluster.html.markdown @@ -259,46 +259,46 @@ A `metastores` block supports the following: * `hive` - (Optional) A `hive` block as defined below. -* `oozie` - (Optional) A `oozie` block as defined below. +* `oozie` - (Optional) An `oozie` block as defined below. -* `ambari` - (Optional) A `ambari` block as defined below. +* `ambari` - (Optional) An `ambari` block as defined below. --- 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. +* `server` - (Required) The fully-qualified domain name (FQDN) of the SQL server to use for the external Hive metastore. Changing this forces a new resource to be created. -* `database_name` - (Required) The external Hive metastore's existing SQL database. +* `database_name` - (Required) The external Hive metastore's existing SQL database. Changing this forces a new resource to be created. -* `username` - (Required) The external Hive metastore's existing SQL server admin username. +* `username` - (Required) The external Hive metastore's existing SQL server admin username. Changing this forces a new resource to be created. -* `password` - (Required) The external Hive metastore's existing SQL server admin password. +* `password` - (Required) The external Hive metastore's existing SQL server admin password. Changing this forces a new resource to be created. --- -A `oozie` block supports the following: +An `oozie` block supports the following: -* `server` - (Required) The fully-qualified domain name (FQDN) of the SQL server to use for the external Oozie metastore. +* `server` - (Required) The fully-qualified domain name (FQDN) of the SQL server to use for the external Oozie metastore. Changing this forces a new resource to be created. -* `database_name` - (Required) The external Oozie metastore's existing SQL database. +* `database_name` - (Required) The external Oozie metastore's existing SQL database. Changing this forces a new resource to be created. -* `username` - (Required) The external Oozie metastore's existing SQL server admin username. +* `username` - (Required) The external Oozie metastore's existing SQL server admin username. Changing this forces a new resource to be created. -* `password` - (Required) The external Oozie metastore's existing SQL server admin password. +* `password` - (Required) The external Oozie metastore's existing SQL server admin password. Changing this forces a new resource to be created. --- -A `ambari` block supports the following: +An `ambari` block supports the following: -* `server` - (Required) The fully-qualified domain name (FQDN) of the SQL server to use for the external Ambari metastore. +* `server` - (Required) The fully-qualified domain name (FQDN) of the SQL server to use for the external Ambari metastore. Changing this forces a new resource to be created. -* `database_name` - (Required) The external Hive metastore's existing SQL database. +* `database_name` - (Required) The external Hive metastore's existing SQL database. Changing this forces a new resource to be created. -* `username` - (Required) The external Ambari metastore's existing SQL server admin username. +* `username` - (Required) The external Ambari metastore's existing SQL server admin username. Changing this forces a new resource to be created. -* `password` - (Required) The external Ambari metastore's existing SQL server admin password. +* `password` - (Required) The external Ambari metastore's existing SQL server admin password. Changing this forces a new resource to be created. ## Attributes Reference From fd892f619628f829119daef879858fb2c15c2f43 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Mon, 4 May 2020 10:47:07 +0200 Subject: [PATCH 036/142] acctests: switching to use the native runner --- .teamcity/components/build_components.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.teamcity/components/build_components.kt b/.teamcity/components/build_components.kt index 66319c83fd7ec..862b7aaf484e7 100644 --- a/.teamcity/components/build_components.kt +++ b/.teamcity/components/build_components.kt @@ -7,7 +7,7 @@ import jetbrains.buildServer.configs.kotlin.v2019_2.triggers.schedule // unfortunately TeamCity's Go Test Json parser appears to be broken // as such for the moment let's use the old method with a feature-flag -const val useTeamCityGoTest = false +const val useTeamCityGoTest = true fun BuildFeatures.Golang() { if (useTeamCityGoTest) { @@ -81,4 +81,4 @@ fun Triggers.RunNightly(nightlyTestsEnabled: Boolean, startHour: Int) { timezone = "SERVER" } } -} \ No newline at end of file +} From 978cb72fa65e4bf080e8fb195be1f21b5214f3f3 Mon Sep 17 00:00:00 2001 From: Steve <11830746+jackofallops@users.noreply.github.com> Date: Mon, 4 May 2020 10:58:02 +0100 Subject: [PATCH 037/142] Update for #6145 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 537e115997218..3dfea1f9b9716 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ IMPROVEMENTS: * `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] * `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] From 72a81514d03f03c0741c242f3ce3dc971d28257e Mon Sep 17 00:00:00 2001 From: Marten Bohlin Date: Mon, 4 May 2020 15:34:45 +0200 Subject: [PATCH 038/142] Added reference to bug reported on azure-sdk-for-go. --- .../resource_arm_site_recovery_network_mapping.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/azurerm/internal/services/recoveryservices/resource_arm_site_recovery_network_mapping.go b/azurerm/internal/services/recoveryservices/resource_arm_site_recovery_network_mapping.go index ccb323625854d..62f812fffa877 100644 --- a/azurerm/internal/services/recoveryservices/resource_arm_site_recovery_network_mapping.go +++ b/azurerm/internal/services/recoveryservices/resource_arm_site_recovery_network_mapping.go @@ -108,8 +108,10 @@ func resourceArmSiteRecoveryNetworkMappingCreate(d *schema.ResourceData, meta in existing, err := client.Get(ctx, fabricName, sourceNetworkName, name) if err != nil { if !utils.ResponseWasNotFound(existing.Response) && - !utils.ResponseWasStatusCode(existing.Response, http.StatusBadRequest) { // API incorrectly returns 400 instead of 404 - return fmt.Errorf("hej Error checking for presence of existing site recovery network mapping %s (vault %s): %+v", name, vaultName, err) + // todo this workaround can be removed when this bug is fixed + // https://github.com/Azure/azure-sdk-for-go/issues/8705 + !utils.ResponseWasStatusCode(existing.Response, http.StatusBadRequest) { + return fmt.Errorf("Error checking for presence of existing site recovery network mapping %s (vault %s): %+v", name, vaultName, err) } } From 78074c8d81ef642ce7ad8827ed12064a7d267084 Mon Sep 17 00:00:00 2001 From: Yuping Wei <56525716+yupwei68@users.noreply.github.com> Date: Tue, 5 May 2020 11:35:40 +0800 Subject: [PATCH 039/142] New resource/Data source `azurerm_data_share_account` (#6575) fix #6480 --- azurerm/internal/clients/client.go | 3 + azurerm/internal/provider/services.go | 2 + .../services/datashare/client/client.go | 19 + .../data_source_data_share_account.go | 89 + .../services/datashare/parse/data_share.go | 31 + .../datashare/parse/data_share_test.go | 72 + .../services/datashare/registration.go | 31 + .../resource_arm_data_share_account.go | 235 + .../data_source_data_share_account_test.go | 43 + .../resource_arm_data_share_account_test.go | 250 + .../services/datashare/validate/data_share.go | 14 + .../datashare/validate/data_share_test.go | 57 + azurerm/internal/tags/schema.go | 12 + azurerm/internal/tags/validation.go | 41 +- .../mgmt/2019-11-01/datashare/accounts.go | 589 ++ .../mgmt/2019-11-01/datashare/client.go | 52 + .../datashare/consumerinvitations.go | 312 + .../datashare/consumersourcedatasets.go | 163 + .../2019-11-01/datashare/datasetmappings.go | 404 + .../mgmt/2019-11-01/datashare/datasets.go | 404 + .../mgmt/2019-11-01/datashare/invitations.go | 404 + .../mgmt/2019-11-01/datashare/models.go | 8908 +++++++++++++++++ .../mgmt/2019-11-01/datashare/operations.go | 147 + .../datashare/providersharesubscriptions.go | 403 + .../mgmt/2019-11-01/datashare/shares.go | 641 ++ .../datashare/sharesubscriptions.go | 957 ++ .../datashare/synchronizationsettings.go | 406 + .../mgmt/2019-11-01/datashare/triggers.go | 405 + .../mgmt/2019-11-01/datashare/version.go | 30 + vendor/modules.txt | 1 + website/allowed-subcategories | 1 + website/azurerm.erb | 14 + .../docs/d/data_share_account.html.markdown | 62 + .../docs/r/data_share_account.html.markdown | 95 + 34 files changed, 15296 insertions(+), 1 deletion(-) create mode 100644 azurerm/internal/services/datashare/client/client.go create mode 100644 azurerm/internal/services/datashare/data_source_data_share_account.go create mode 100644 azurerm/internal/services/datashare/parse/data_share.go create mode 100644 azurerm/internal/services/datashare/parse/data_share_test.go create mode 100644 azurerm/internal/services/datashare/registration.go create mode 100644 azurerm/internal/services/datashare/resource_arm_data_share_account.go create mode 100644 azurerm/internal/services/datashare/tests/data_source_data_share_account_test.go create mode 100644 azurerm/internal/services/datashare/tests/resource_arm_data_share_account_test.go create mode 100644 azurerm/internal/services/datashare/validate/data_share.go create mode 100644 azurerm/internal/services/datashare/validate/data_share_test.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/accounts.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/client.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/consumerinvitations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/consumersourcedatasets.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/datasetmappings.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/datasets.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/invitations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/models.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/operations.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/providersharesubscriptions.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/shares.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/sharesubscriptions.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/synchronizationsettings.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/triggers.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/version.go create mode 100644 website/docs/d/data_share_account.html.markdown create mode 100644 website/docs/r/data_share_account.html.markdown diff --git a/azurerm/internal/clients/client.go b/azurerm/internal/clients/client.go index 091e8abbbe142..fe72c41e485ed 100644 --- a/azurerm/internal/clients/client.go +++ b/azurerm/internal/clients/client.go @@ -26,6 +26,7 @@ import ( databricks "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/databricks/client" datafactory "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datafactory/client" datalake "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datalake/client" + datashare "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datashare/client" devspace "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/devspace/client" devtestlabs "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/devtestlabs/client" dns "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/dns/client" @@ -105,6 +106,7 @@ type Client struct { DataBricks *databricks.Client DataFactory *datafactory.Client Datalake *datalake.Client + DataShare *datashare.Client DevSpace *devspace.Client DevTestLabs *devtestlabs.Client Dns *dns.Client @@ -185,6 +187,7 @@ func (client *Client) Build(ctx context.Context, o *common.ClientOptions) error client.DataBricks = databricks.NewClient(o) client.DataFactory = datafactory.NewClient(o) client.Datalake = datalake.NewClient(o) + client.DataShare = datashare.NewClient(o) client.DevSpace = devspace.NewClient(o) client.DevTestLabs = devtestlabs.NewClient(o) client.Dns = dns.NewClient(o) diff --git a/azurerm/internal/provider/services.go b/azurerm/internal/provider/services.go index 944a428968535..a84eee7a0aa03 100644 --- a/azurerm/internal/provider/services.go +++ b/azurerm/internal/provider/services.go @@ -22,6 +22,7 @@ import ( "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/databricks" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datafactory" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datalake" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datashare" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/devspace" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/devtestlabs" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/dns" @@ -98,6 +99,7 @@ func SupportedServices() []common.ServiceRegistration { datafactory.Registration{}, datalake.Registration{}, databasemigration.Registration{}, + datashare.Registration{}, devspace.Registration{}, devtestlabs.Registration{}, dns.Registration{}, diff --git a/azurerm/internal/services/datashare/client/client.go b/azurerm/internal/services/datashare/client/client.go new file mode 100644 index 0000000000000..1292d3cfd94e3 --- /dev/null +++ b/azurerm/internal/services/datashare/client/client.go @@ -0,0 +1,19 @@ +package client + +import ( + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/common" +) + +type Client struct { + AccountClient *datashare.AccountsClient +} + +func NewClient(o *common.ClientOptions) *Client { + accountClient := datashare.NewAccountsClientWithBaseURI(o.ResourceManagerEndpoint, o.SubscriptionId) + o.ConfigureClient(&accountClient.Client, o.ResourceManagerAuthorizer) + + return &Client{ + AccountClient: &accountClient, + } +} diff --git a/azurerm/internal/services/datashare/data_source_data_share_account.go b/azurerm/internal/services/datashare/data_source_data_share_account.go new file mode 100644 index 0000000000000..8d467b8fab2b0 --- /dev/null +++ b/azurerm/internal/services/datashare/data_source_data_share_account.go @@ -0,0 +1,89 @@ +package datashare + +import ( + "fmt" + "log" + "time" + + "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/datashare/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" +) + +func dataSourceDataShareAccount() *schema.Resource { + return &schema.Resource{ + Read: dataSourceArmDataShareAccountRead, + + Timeouts: &schema.ResourceTimeout{ + Read: schema.DefaultTimeout(5 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validate.DataShareAccountName(), + }, + + "resource_group_name": azure.SchemaResourceGroupNameForDataSource(), + + "identity": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Computed: true, + }, + "principal_id": { + Type: schema.TypeString, + Computed: true, + }, + "tenant_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + "tags": tags.SchemaDataSource(), + }, + } +} + +func dataSourceArmDataShareAccountRead(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).DataShare.AccountClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + + resp, err := client.Get(ctx, resourceGroup, name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + log.Printf("[INFO] DataShare %q does not exist - removing from state", d.Id()) + d.SetId("") + return nil + } + return fmt.Errorf("retrieving DataShare Account %q (Resource Group %q): %+v", name, resourceGroup, err) + } + + if resp.ID == nil || *resp.ID == "" { + return fmt.Errorf("reading DataShare Account %q (Resource Group %q): ID is empty or nil", name, resourceGroup) + } + + d.SetId(*resp.ID) + d.Set("name", name) + d.Set("resource_group_name", resourceGroup) + if err := d.Set("identity", flattenAzureRmDataShareAccountIdentity(resp.Identity)); err != nil { + return fmt.Errorf("setting `identity`: %+v", err) + } + return tags.FlattenAndSet(d, resp.Tags) +} diff --git a/azurerm/internal/services/datashare/parse/data_share.go b/azurerm/internal/services/datashare/parse/data_share.go new file mode 100644 index 0000000000000..83bc7c3404a1c --- /dev/null +++ b/azurerm/internal/services/datashare/parse/data_share.go @@ -0,0 +1,31 @@ +package parse + +import ( + "fmt" + + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" +) + +type DataShareAccountId struct { + ResourceGroup string + Name string +} + +func DataShareAccountID(input string) (*DataShareAccountId, error) { + id, err := azure.ParseAzureResourceID(input) + if err != nil { + return nil, fmt.Errorf("parsing DataShareAccount ID %q: %+v", input, err) + } + + dataShareAccount := DataShareAccountId{ + ResourceGroup: id.ResourceGroup, + } + if dataShareAccount.Name, err = id.PopSegment("accounts"); err != nil { + return nil, err + } + if err := id.ValidateNoEmptySegments(input); err != nil { + return nil, err + } + + return &dataShareAccount, nil +} diff --git a/azurerm/internal/services/datashare/parse/data_share_test.go b/azurerm/internal/services/datashare/parse/data_share_test.go new file mode 100644 index 0000000000000..3c14595b2d91b --- /dev/null +++ b/azurerm/internal/services/datashare/parse/data_share_test.go @@ -0,0 +1,72 @@ +package parse + +import ( + "testing" +) + +func TestDataShareAccountID(t *testing.T) { + testData := []struct { + Name string + Input string + Expected *DataShareAccountId + }{ + { + Name: "Empty", + Input: "", + Expected: nil, + }, + { + Name: "No Resource Groups Segment", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000", + Expected: nil, + }, + { + Name: "No Resource Groups Value", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/", + Expected: nil, + }, + { + Name: "Resource Group ID", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/foo/", + Expected: nil, + }, + { + Name: "Missing Account Value", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.DataShare/accounts/", + Expected: nil, + }, + { + Name: "Datashare account ID", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.DataShare/accounts/account1", + Expected: &DataShareAccountId{ + Name: "account1", + ResourceGroup: "resGroup1", + }, + }, + { + Name: "Wrong Casing", + Input: "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resGroup1/providers/Microsoft.DataShare/Accounts/account1", + Expected: nil, + }, + } + + for _, v := range testData { + t.Logf("[DEBUG] Testing %q..", v.Name) + + actual, err := DataShareAccountID(v.Input) + if err != nil { + if v.Expected == nil { + continue + } + t.Fatalf("Expected a value but got an error: %s", err) + } + + if actual.ResourceGroup != v.Expected.ResourceGroup { + t.Fatalf("Expected %q but got %q for ResourceGroup", v.Expected.ResourceGroup, actual.ResourceGroup) + } + + if actual.Name != v.Expected.Name { + t.Fatalf("Expected %q but got %q for Name", v.Expected.Name, actual.Name) + } + } +} diff --git a/azurerm/internal/services/datashare/registration.go b/azurerm/internal/services/datashare/registration.go new file mode 100644 index 0000000000000..0ddb1dd85d4e9 --- /dev/null +++ b/azurerm/internal/services/datashare/registration.go @@ -0,0 +1,31 @@ +package datashare + +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 "Data Share" +} + +// WebsiteCategories returns a list of categories which can be used for the sidebar +func (r Registration) WebsiteCategories() []string { + return []string{ + "Data Share", + } +} + +// SupportedDataSources returns the supported Data Sources supported by this Service +func (r Registration) SupportedDataSources() map[string]*schema.Resource { + return map[string]*schema.Resource{ + "azurerm_data_share_account": dataSourceDataShareAccount(), + } +} + +// SupportedResources returns the supported Resources supported by this Service +func (r Registration) SupportedResources() map[string]*schema.Resource { + return map[string]*schema.Resource{ + "azurerm_data_share_account": resourceArmDataShareAccount(), + } +} diff --git a/azurerm/internal/services/datashare/resource_arm_data_share_account.go b/azurerm/internal/services/datashare/resource_arm_data_share_account.go new file mode 100644 index 0000000000000..c1828cac2c7b3 --- /dev/null +++ b/azurerm/internal/services/datashare/resource_arm_data_share_account.go @@ -0,0 +1,235 @@ +package datashare + +import ( + "fmt" + "log" + "time" + + "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + "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/location" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datashare/parse" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/datashare/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" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func resourceArmDataShareAccount() *schema.Resource { + return &schema.Resource{ + Create: resourceArmDataShareAccountCreate, + Read: resourceArmDataShareAccountRead, + Update: resourceArmDataShareAccountUpdate, + Delete: resourceArmDataShareAccountDelete, + + 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), + }, + + Importer: azSchema.ValidateResourceIDPriorToImport(func(id string) error { + _, err := parse.DataShareAccountID(id) + return err + }), + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validate.DataShareAccountName(), + }, + + "resource_group_name": azure.SchemaResourceGroupName(), + + "location": azure.SchemaLocation(), + + "identity": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "type": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + string(datashare.SystemAssigned), + }, false), + }, + "principal_id": { + Type: schema.TypeString, + Computed: true, + }, + "tenant_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + + // the api will save and return the tag keys in lowercase, so an extra validation of the key is all in lowercase is added + // issue has been created https://github.com/Azure/azure-rest-api-specs/issues/9280 + "tags": tags.SchemaEnforceLowerCaseKeys(), + }, + } +} +func resourceArmDataShareAccountCreate(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).DataShare.AccountClient + ctx, cancel := timeouts.ForCreate(meta.(*clients.Client).StopContext, d) + defer cancel() + + name := d.Get("name").(string) + resourceGroup := d.Get("resource_group_name").(string) + + existing, err := client.Get(ctx, resourceGroup, name) + if err != nil { + if !utils.ResponseWasNotFound(existing.Response) { + return fmt.Errorf("checking for present of existing DataShare Account %q (Resource Group %q): %+v", name, resourceGroup, err) + } + } + if existing.ID != nil && *existing.ID != "" { + return tf.ImportAsExistsError("azurerm_data_share_account", *existing.ID) + } + + account := datashare.Account{ + Name: utils.String(name), + Location: utils.String(location.Normalize(d.Get("location").(string))), + Identity: expandAzureRmDataShareAccountIdentity(d.Get("identity").([]interface{})), + Tags: tags.Expand(d.Get("tags").(map[string]interface{})), + } + + future, err := client.Create(ctx, resourceGroup, name, account) + if err != nil { + return fmt.Errorf("creating DataShare Account %q (Resource Group %q): %+v", name, resourceGroup, err) + } + + if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("waiting on creating future for DataShare Account %q (Resource Group %q): %+v", name, resourceGroup, err) + } + + resp, err := client.Get(ctx, resourceGroup, name) + if err != nil { + return fmt.Errorf("retrieving DataShare Account %q (Resource Group %q): %+v", name, resourceGroup, err) + } + + if resp.ID == nil || *resp.ID == "" { + return fmt.Errorf("reading DataShare Account %q (Resource Group %q): ID is empty or nil", name, resourceGroup) + } + + d.SetId(*resp.ID) + + return resourceArmDataShareAccountRead(d, meta) +} + +func resourceArmDataShareAccountRead(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).DataShare.AccountClient + ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.DataShareAccountID(d.Id()) + if err != nil { + return err + } + + resp, err := client.Get(ctx, id.ResourceGroup, id.Name) + if err != nil { + if utils.ResponseWasNotFound(resp.Response) { + log.Printf("[INFO] DataShare %q does not exist - removing from state", d.Id()) + d.SetId("") + return nil + } + return fmt.Errorf("retrieving DataShare Account %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + } + d.Set("name", id.Name) + d.Set("resource_group_name", id.ResourceGroup) + d.Set("location", location.NormalizeNilable(resp.Location)) + if err := d.Set("identity", flattenAzureRmDataShareAccountIdentity(resp.Identity)); err != nil { + return fmt.Errorf("setting `identity`: %+v", err) + } + + return tags.FlattenAndSet(d, resp.Tags) +} + +func resourceArmDataShareAccountUpdate(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).DataShare.AccountClient + ctx, cancel := timeouts.ForUpdate(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.DataShareAccountID(d.Id()) + if err != nil { + return err + } + + props := datashare.AccountUpdateParameters{} + + if d.HasChange("tags") { + props.Tags = tags.Expand(d.Get("tags").(map[string]interface{})) + } + + _, err = client.Update(ctx, id.ResourceGroup, id.Name, props) + if err != nil { + return fmt.Errorf("updating DataShare Account %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + } + + return resourceArmDataShareAccountRead(d, meta) +} + +func resourceArmDataShareAccountDelete(d *schema.ResourceData, meta interface{}) error { + client := meta.(*clients.Client).DataShare.AccountClient + ctx, cancel := timeouts.ForDelete(meta.(*clients.Client).StopContext, d) + defer cancel() + + id, err := parse.DataShareAccountID(d.Id()) + if err != nil { + return err + } + + future, err := client.Delete(ctx, id.ResourceGroup, id.Name) + if err != nil { + return fmt.Errorf("deleting DataShare Account %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err) + } + + if err = future.WaitForCompletionRef(ctx, client.Client); err != nil { + return fmt.Errorf("waiting for DataShare Account %q (Resource Group %q) to be deleted: %+v", id.Name, id.ResourceGroup, err) + } + return nil +} + +func expandAzureRmDataShareAccountIdentity(input []interface{}) *datashare.Identity { + identity := input[0].(map[string]interface{}) + return &datashare.Identity{ + Type: datashare.Type(identity["type"].(string)), + } +} + +func flattenAzureRmDataShareAccountIdentity(identity *datashare.Identity) []interface{} { + if identity == nil { + return make([]interface{}, 0) + } + + var principalId, tenantId string + + if identity.PrincipalID != nil { + principalId = *identity.PrincipalID + } + if identity.TenantID != nil { + tenantId = *identity.TenantID + } + + return []interface{}{ + map[string]interface{}{ + "type": string(identity.Type), + "principal_id": principalId, + "tenant_id": tenantId, + }, + } +} diff --git a/azurerm/internal/services/datashare/tests/data_source_data_share_account_test.go b/azurerm/internal/services/datashare/tests/data_source_data_share_account_test.go new file mode 100644 index 0000000000000..ca83c7d0eb6ed --- /dev/null +++ b/azurerm/internal/services/datashare/tests/data_source_data_share_account_test.go @@ -0,0 +1,43 @@ +package tests + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/acceptance" +) + +func TestAccDataSourceAzureRMDataShareAccount_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_data_share_account", "test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMDataShareAccountDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceDataShareAccount_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMDataShareAccountExists(data.ResourceName), + resource.TestCheckResourceAttr(data.ResourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(data.ResourceName, "tags.env", "Test"), + resource.TestCheckResourceAttr(data.ResourceName, "identity.0.type", "SystemAssigned"), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.principal_id"), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.tenant_id"), + ), + }, + }, + }) +} + +func testAccDataSourceDataShareAccount_basic(data acceptance.TestData) string { + config := testAccAzureRMDataShareAccount_complete(data) + return fmt.Sprintf(` +%s + +data "azurerm_data_share_account" "test" { + name = azurerm_data_share_account.test.name + resource_group_name = azurerm_resource_group.test.name +} +`, config) +} diff --git a/azurerm/internal/services/datashare/tests/resource_arm_data_share_account_test.go b/azurerm/internal/services/datashare/tests/resource_arm_data_share_account_test.go new file mode 100644 index 0000000000000..292b6229aa9e8 --- /dev/null +++ b/azurerm/internal/services/datashare/tests/resource_arm_data_share_account_test.go @@ -0,0 +1,250 @@ +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/datashare/parse" + "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" +) + +func TestAccAzureRMDataShareAccount_basic(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_data_share_account", "test") + + resource.Test(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMDataShareAccountDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMDataShareAccount_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMDataShareAccountExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.principal_id"), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.tenant_id"), + ), + }, + data.ImportStep(), + }, + }) +} + +func TestAccAzureRMDataShareAccount_requiresImport(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_data_share_account", "test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMDataShareAccountDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMDataShareAccount_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMDataShareAccountExists(data.ResourceName), + ), + }, + data.RequiresImportErrorStep(testAccAzureRMDataShareAccount_requiresImport), + }, + }) +} + +func TestAccAzureRMDataShareAccount_complete(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_data_share_account", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMDataShareAccountDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMDataShareAccount_complete(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMDataShareAccountExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.principal_id"), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.tenant_id"), + ), + }, + data.ImportStep(), + }, + }) +} + +func TestAccAzureRMDataShareAccount_update(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_data_share_account", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMDataShareAccountDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMDataShareAccount_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMDataShareAccountExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.principal_id"), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.tenant_id"), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMDataShareAccount_complete(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMDataShareAccountExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.principal_id"), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.tenant_id"), + ), + }, + data.ImportStep(), + { + Config: testAccAzureRMDataShareAccount_update(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMDataShareAccountExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.principal_id"), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.tenant_id"), + ), + }, + { + Config: testAccAzureRMDataShareAccount_basic(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMDataShareAccountExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.principal_id"), + resource.TestCheckResourceAttrSet(data.ResourceName, "identity.0.tenant_id"), + ), + }, + data.ImportStep(), + data.ImportStep(), + }, + }) +} + +func testCheckAzureRMDataShareAccountExists(resourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).DataShare.AccountClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("dataShare Account not found: %s", resourceName) + } + id, err := parse.DataShareAccountID(rs.Primary.ID) + if err != nil { + return err + } + if resp, err := client.Get(ctx, id.ResourceGroup, id.Name); err != nil { + if !utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("bad: data_share account %q does not exist", id.Name) + } + return fmt.Errorf("bad: Get on DataShareAccountClient: %+v", err) + } + return nil + } +} + +func testCheckAzureRMDataShareAccountDestroy(s *terraform.State) error { + client := acceptance.AzureProvider.Meta().(*clients.Client).DataShare.AccountClient + ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext + + for _, rs := range s.RootModule().Resources { + if rs.Type != "azurerm_data_share_account" { + continue + } + id, err := parse.DataShareAccountID(rs.Primary.ID) + if err != nil { + return err + } + if resp, err := client.Get(ctx, id.ResourceGroup, id.Name); err != nil { + if !utils.ResponseWasNotFound(resp.Response) { + return fmt.Errorf("bad: Get on data_share.accountClient: %+v", err) + } + } + return nil + } + return nil +} + +func testAccAzureRMDataShareAccount_template(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctest-datashare-%d" + location = "%s" +} +`, data.RandomInteger, data.Locations.Primary) +} + +func testAccAzureRMDataShareAccount_basic(data acceptance.TestData) string { + template := testAccAzureRMDataShareAccount_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_data_share_account" "test" { + name = "acctest-DSA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + identity { + type = "SystemAssigned" + } +} +`, template, data.RandomInteger) +} + +func testAccAzureRMDataShareAccount_requiresImport(data acceptance.TestData) string { + config := testAccAzureRMDataShareAccount_basic(data) + return fmt.Sprintf(` +%s + +resource "azurerm_data_share_account" "import" { + name = azurerm_data_share_account.test.name + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + identity { + type = "SystemAssigned" + } +} +`, config) +} + +func testAccAzureRMDataShareAccount_complete(data acceptance.TestData) string { + template := testAccAzureRMDataShareAccount_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_data_share_account" "test" { + name = "acctest-DSA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + identity { + type = "SystemAssigned" + } + + tags = { + env = "Test" + } +} +`, template, data.RandomInteger) +} + +func testAccAzureRMDataShareAccount_update(data acceptance.TestData) string { + template := testAccAzureRMDataShareAccount_template(data) + return fmt.Sprintf(` +%s + +resource "azurerm_data_share_account" "test" { + name = "acctest-DSA-%d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + identity { + type = "SystemAssigned" + } + + tags = { + env = "Stage" + } +} +`, template, data.RandomInteger) +} diff --git a/azurerm/internal/services/datashare/validate/data_share.go b/azurerm/internal/services/datashare/validate/data_share.go new file mode 100644 index 0000000000000..4bd6971dfe225 --- /dev/null +++ b/azurerm/internal/services/datashare/validate/data_share.go @@ -0,0 +1,14 @@ +package validate + +import ( + "regexp" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" +) + +func DataShareAccountName() schema.SchemaValidateFunc { + return validation.StringMatch( + regexp.MustCompile(`^[^<>%&:\\?/#*$^();,.\|+={}\[\]!~@]{3,90}$`), `Data share account name should have length of 3 - 90, and cannot contain <>%&:\?/#*$^();,.|+={}[]!~@.`, + ) +} diff --git a/azurerm/internal/services/datashare/validate/data_share_test.go b/azurerm/internal/services/datashare/validate/data_share_test.go new file mode 100644 index 0000000000000..7e3d706bef34f --- /dev/null +++ b/azurerm/internal/services/datashare/validate/data_share_test.go @@ -0,0 +1,57 @@ +package validate + +import "testing" + +func TestDataShareAccountName(t *testing.T) { + tests := []struct { + name string + input string + valid bool + }{ + { + name: "Invalid Character 1", + input: "DC\\", + valid: false, + }, + { + name: "Invalid Character 2", + input: "[abc]", + valid: false, + }, + { + name: "Valid Account Name", + input: "acc-test", + valid: true, + }, + { + name: "Invalid Character 3", + input: "test&", + valid: false, + }, + { + name: "Too Few Character", + input: "ab", + valid: false, + }, + { + name: "Valid Account Name 2", + input: "aa-BB_88", + valid: true, + }, + { + name: "Valid Account Name 3", + input: "aac-", + valid: true, + }, + } + var validationFunction = DataShareAccountName() + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + _, err := validationFunction(tt.input, "") + valid := err == nil + if valid != tt.valid { + t.Errorf("Expected valid status %t but got %t for input %s", tt.valid, valid, tt.input) + } + }) + } +} diff --git a/azurerm/internal/tags/schema.go b/azurerm/internal/tags/schema.go index 71b4e065dfe6c..1438b11a8a64f 100644 --- a/azurerm/internal/tags/schema.go +++ b/azurerm/internal/tags/schema.go @@ -40,3 +40,15 @@ func Schema() *schema.Schema { }, } } + +// Schema returns the Schema used for Tags +func SchemaEnforceLowerCaseKeys() *schema.Schema { + return &schema.Schema{ + Type: schema.TypeMap, + Optional: true, + ValidateFunc: EnforceLowerCaseKeys, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + } +} diff --git a/azurerm/internal/tags/validation.go b/azurerm/internal/tags/validation.go index 1bca2c7d3e615..216fbf2f15af7 100644 --- a/azurerm/internal/tags/validation.go +++ b/azurerm/internal/tags/validation.go @@ -1,6 +1,9 @@ package tags -import "fmt" +import ( + "fmt" + "strings" +) func Validate(v interface{}, _ string) (warnings []string, errors []error) { tagsMap := v.(map[string]interface{}) @@ -35,3 +38,39 @@ func TagValueToString(v interface{}) (string, error) { return "", fmt.Errorf("unknown tag type %T in tag value", value) } } + +func EnforceLowerCaseKeys(i interface{}, k string) (warnings []string, errors []error) { + tagsMap, ok := i.(map[string]interface{}) + if !ok { + errors = append(errors, fmt.Errorf("expected type of %s to be map", k)) + return warnings, errors + } + + if len(tagsMap) > 50 { + errors = append(errors, fmt.Errorf("a maximum of 50 tags can be applied to each ARM resource")) + } + + for key, value := range tagsMap { + if len(key) > 512 { + errors = append(errors, fmt.Errorf("the maximum length for a tag key is 512 characters: %q has %d characters", key, len(key))) + return warnings, errors + } + + if strings.ToLower(key) != key { + errors = append(errors, fmt.Errorf("a tag key %q expected to be all in lowercase", key)) + return warnings, errors + } + + v, err := TagValueToString(value) + if err != nil { + errors = append(errors, err) + return warnings, errors + } + if len(v) > 256 { + errors = append(errors, fmt.Errorf("the maximum length for a tag value is 256 characters: the value for %q has %d characters", key, len(v))) + return warnings, errors + } + } + + return warnings, errors +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/accounts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/accounts.go new file mode 100644 index 0000000000000..379f0d9c1aadb --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/accounts.go @@ -0,0 +1,589 @@ +package datashare + +// 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" +) + +// AccountsClient is the creates a Microsoft.DataShare management client. +type AccountsClient struct { + BaseClient +} + +// NewAccountsClient creates an instance of the AccountsClient client. +func NewAccountsClient(subscriptionID string) AccountsClient { + return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAccountsClientWithBaseURI creates an instance of the AccountsClient 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 NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { + return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// account - the account payload. +func (client AccountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, account Account) (result AccountsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Create") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: account, + Constraints: []validation.Constraint{{Target: "account.Identity", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("datashare.AccountsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, account) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client AccountsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, account Account) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}", pathParameters), + autorest.WithJSON(account), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) CreateSender(req *http.Request) (future AccountsCreateFuture, 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 +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client AccountsClient) CreateResponder(resp *http.Response) (result Account, 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 deleteAccount +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result AccountsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}", 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 AccountsClient) DeleteSender(req *http.Request) (future AccountsDeleteFuture, 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 AccountsClient) DeleteResponder(resp *http.Response) (result OperationResponse, 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 +} + +// Get get an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +func (client AccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}", 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 AccountsClient) 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 AccountsClient) GetResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list Accounts in ResourceGroup +// Parameters: +// resourceGroupName - the resource group name. +// skipToken - continuation token +func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, skipToken string) (result AccountListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.al, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AccountsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) (result AccountList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client AccountsClient) listByResourceGroupNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) { + req, err := lastResults.accountListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.AccountsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.AccountsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, skipToken string) (result AccountListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup") + 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.ListByResourceGroup(ctx, resourceGroupName, skipToken) + return +} + +// ListBySubscription list Accounts in Subscription +// Parameters: +// skipToken - continuation token +func (client AccountsClient) ListBySubscription(ctx context.Context, skipToken string) (result AccountListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.al, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client AccountsClient) ListBySubscriptionPreparer(ctx context.Context, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DataShare/accounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client AccountsClient) ListBySubscriptionResponder(resp *http.Response) (result AccountList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client AccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AccountList) (result AccountList, err error) { + req, err := lastResults.accountListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.AccountsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.AccountsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountsClient) ListBySubscriptionComplete(ctx context.Context, skipToken string) (result AccountListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListBySubscription") + 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.ListBySubscription(ctx, skipToken) + return +} + +// Update patch an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// accountUpdateParameters - the account update parameters. +func (client AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, accountUpdateParameters AccountUpdateParameters) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, accountUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, accountUpdateParameters AccountUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}", pathParameters), + autorest.WithJSON(accountUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + 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 AccountsClient) 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 AccountsClient) UpdateResponder(resp *http.Response) (result Account, 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/datashare/mgmt/2019-11-01/datashare/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/client.go new file mode 100644 index 0000000000000..03ccba7b56672 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/client.go @@ -0,0 +1,52 @@ +// Package datashare implements the Azure ARM Datashare service API version 2019-11-01. +// +// Creates a Microsoft.DataShare management client. +package datashare + +// 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 Datashare + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Datashare. +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/datashare/mgmt/2019-11-01/datashare/consumerinvitations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/consumerinvitations.go new file mode 100644 index 0000000000000..c40500a0418e5 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/consumerinvitations.go @@ -0,0 +1,312 @@ +package datashare + +// 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" +) + +// ConsumerInvitationsClient is the creates a Microsoft.DataShare management client. +type ConsumerInvitationsClient struct { + BaseClient +} + +// NewConsumerInvitationsClient creates an instance of the ConsumerInvitationsClient client. +func NewConsumerInvitationsClient(subscriptionID string) ConsumerInvitationsClient { + return NewConsumerInvitationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConsumerInvitationsClientWithBaseURI creates an instance of the ConsumerInvitationsClient 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 NewConsumerInvitationsClientWithBaseURI(baseURI string, subscriptionID string) ConsumerInvitationsClient { + return ConsumerInvitationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get an invitation +// Parameters: +// location - location of the invitation +// invitationID - an invitation id +func (client ConsumerInvitationsClient) Get(ctx context.Context, location string, invitationID string) (result ConsumerInvitation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerInvitationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, location, invitationID) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ConsumerInvitationsClient) GetPreparer(ctx context.Context, location string, invitationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "invitationId": autorest.Encode("path", invitationID), + "location": autorest.Encode("path", location), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.DataShare/locations/{location}/consumerInvitations/{invitationId}", 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 ConsumerInvitationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ConsumerInvitationsClient) GetResponder(resp *http.Response) (result ConsumerInvitation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListInvitations lists invitations +// Parameters: +// skipToken - the continuation token +func (client ConsumerInvitationsClient) ListInvitations(ctx context.Context, skipToken string) (result ConsumerInvitationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerInvitationsClient.ListInvitations") + defer func() { + sc := -1 + if result.cil.Response.Response != nil { + sc = result.cil.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listInvitationsNextResults + req, err := client.ListInvitationsPreparer(ctx, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "ListInvitations", nil, "Failure preparing request") + return + } + + resp, err := client.ListInvitationsSender(req) + if err != nil { + result.cil.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "ListInvitations", resp, "Failure sending request") + return + } + + result.cil, err = client.ListInvitationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "ListInvitations", resp, "Failure responding to request") + } + + return +} + +// ListInvitationsPreparer prepares the ListInvitations request. +func (client ConsumerInvitationsClient) ListInvitationsPreparer(ctx context.Context, skipToken string) (*http.Request, error) { + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.DataShare/ListInvitations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListInvitationsSender sends the ListInvitations request. The method will close the +// http.Response Body if it receives an error. +func (client ConsumerInvitationsClient) ListInvitationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListInvitationsResponder handles the response to the ListInvitations request. The method always +// closes the http.Response Body. +func (client ConsumerInvitationsClient) ListInvitationsResponder(resp *http.Response) (result ConsumerInvitationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listInvitationsNextResults retrieves the next set of results, if any. +func (client ConsumerInvitationsClient) listInvitationsNextResults(ctx context.Context, lastResults ConsumerInvitationList) (result ConsumerInvitationList, err error) { + req, err := lastResults.consumerInvitationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "listInvitationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListInvitationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "listInvitationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListInvitationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "listInvitationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListInvitationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConsumerInvitationsClient) ListInvitationsComplete(ctx context.Context, skipToken string) (result ConsumerInvitationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerInvitationsClient.ListInvitations") + 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.ListInvitations(ctx, skipToken) + return +} + +// RejectInvitation reject an invitation +// Parameters: +// location - location of the invitation +// invitation - an invitation payload +func (client ConsumerInvitationsClient) RejectInvitation(ctx context.Context, location string, invitation ConsumerInvitation) (result ConsumerInvitation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerInvitationsClient.RejectInvitation") + 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: invitation, + Constraints: []validation.Constraint{{Target: "invitation.ConsumerInvitationProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "invitation.ConsumerInvitationProperties.InvitationID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("datashare.ConsumerInvitationsClient", "RejectInvitation", err.Error()) + } + + req, err := client.RejectInvitationPreparer(ctx, location, invitation) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "RejectInvitation", nil, "Failure preparing request") + return + } + + resp, err := client.RejectInvitationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "RejectInvitation", resp, "Failure sending request") + return + } + + result, err = client.RejectInvitationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerInvitationsClient", "RejectInvitation", resp, "Failure responding to request") + } + + return +} + +// RejectInvitationPreparer prepares the RejectInvitation request. +func (client ConsumerInvitationsClient) RejectInvitationPreparer(ctx context.Context, location string, invitation ConsumerInvitation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + } + + const APIVersion = "2019-11-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("/providers/Microsoft.DataShare/locations/{location}/RejectInvitation", pathParameters), + autorest.WithJSON(invitation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RejectInvitationSender sends the RejectInvitation request. The method will close the +// http.Response Body if it receives an error. +func (client ConsumerInvitationsClient) RejectInvitationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RejectInvitationResponder handles the response to the RejectInvitation request. The method always +// closes the http.Response Body. +func (client ConsumerInvitationsClient) RejectInvitationResponder(resp *http.Response) (result ConsumerInvitation, 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/datashare/mgmt/2019-11-01/datashare/consumersourcedatasets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/consumersourcedatasets.go new file mode 100644 index 0000000000000..4a6e2fcf49750 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/consumersourcedatasets.go @@ -0,0 +1,163 @@ +package datashare + +// 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" +) + +// ConsumerSourceDataSetsClient is the creates a Microsoft.DataShare management client. +type ConsumerSourceDataSetsClient struct { + BaseClient +} + +// NewConsumerSourceDataSetsClient creates an instance of the ConsumerSourceDataSetsClient client. +func NewConsumerSourceDataSetsClient(subscriptionID string) ConsumerSourceDataSetsClient { + return NewConsumerSourceDataSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewConsumerSourceDataSetsClientWithBaseURI creates an instance of the ConsumerSourceDataSetsClient 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 NewConsumerSourceDataSetsClientWithBaseURI(baseURI string, subscriptionID string) ConsumerSourceDataSetsClient { + return ConsumerSourceDataSetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByShareSubscription get source dataSets of a shareSubscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// skipToken - continuation token +func (client ConsumerSourceDataSetsClient) ListByShareSubscription(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result ConsumerSourceDataSetListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerSourceDataSetsClient.ListByShareSubscription") + defer func() { + sc := -1 + if result.csdsl.Response.Response != nil { + sc = result.csdsl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareSubscriptionNextResults + req, err := client.ListByShareSubscriptionPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerSourceDataSetsClient", "ListByShareSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSubscriptionSender(req) + if err != nil { + result.csdsl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ConsumerSourceDataSetsClient", "ListByShareSubscription", resp, "Failure sending request") + return + } + + result.csdsl, err = client.ListByShareSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerSourceDataSetsClient", "ListByShareSubscription", resp, "Failure responding to request") + } + + return +} + +// ListByShareSubscriptionPreparer prepares the ListByShareSubscription request. +func (client ConsumerSourceDataSetsClient) ListByShareSubscriptionPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/ConsumerSourceDataSets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSubscriptionSender sends the ListByShareSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client ConsumerSourceDataSetsClient) ListByShareSubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByShareSubscriptionResponder handles the response to the ListByShareSubscription request. The method always +// closes the http.Response Body. +func (client ConsumerSourceDataSetsClient) ListByShareSubscriptionResponder(resp *http.Response) (result ConsumerSourceDataSetList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByShareSubscriptionNextResults retrieves the next set of results, if any. +func (client ConsumerSourceDataSetsClient) listByShareSubscriptionNextResults(ctx context.Context, lastResults ConsumerSourceDataSetList) (result ConsumerSourceDataSetList, err error) { + req, err := lastResults.consumerSourceDataSetListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ConsumerSourceDataSetsClient", "listByShareSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ConsumerSourceDataSetsClient", "listByShareSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ConsumerSourceDataSetsClient", "listByShareSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ConsumerSourceDataSetsClient) ListByShareSubscriptionComplete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result ConsumerSourceDataSetListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerSourceDataSetsClient.ListByShareSubscription") + 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.ListByShareSubscription(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/datasetmappings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/datasetmappings.go new file mode 100644 index 0000000000000..950ce174ae7b8 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/datasetmappings.go @@ -0,0 +1,404 @@ +package datashare + +// 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" +) + +// DataSetMappingsClient is the creates a Microsoft.DataShare management client. +type DataSetMappingsClient struct { + BaseClient +} + +// NewDataSetMappingsClient creates an instance of the DataSetMappingsClient client. +func NewDataSetMappingsClient(subscriptionID string) DataSetMappingsClient { + return NewDataSetMappingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataSetMappingsClientWithBaseURI creates an instance of the DataSetMappingsClient 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 NewDataSetMappingsClientWithBaseURI(baseURI string, subscriptionID string) DataSetMappingsClient { + return DataSetMappingsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a DataSetMapping +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the share subscription which will hold the data set sink. +// dataSetMappingName - the name of the data set mapping to be created. +// dataSetMapping - destination data set configuration details. +func (client DataSetMappingsClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string, dataSetMapping BasicDataSetMapping) (result DataSetMappingModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, dataSetMappingName, dataSetMapping) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client DataSetMappingsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string, dataSetMapping BasicDataSetMapping) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "dataSetMappingName": autorest.Encode("path", dataSetMappingName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}", pathParameters), + autorest.WithJSON(dataSetMapping), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client DataSetMappingsClient) CreateSender(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 +// closes the http.Response Body. +func (client DataSetMappingsClient) CreateResponder(resp *http.Response) (result DataSetMappingModel, 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 a DataSetMapping in a shareSubscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// dataSetMappingName - the name of the dataSetMapping. +func (client DataSetMappingsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, dataSetMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DataSetMappingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "dataSetMappingName": autorest.Encode("path", dataSetMappingName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}", 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 DataSetMappingsClient) 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 DataSetMappingsClient) 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 get a DataSetMapping in a shareSubscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// dataSetMappingName - the name of the dataSetMapping. +func (client DataSetMappingsClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string) (result DataSetMappingModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, dataSetMappingName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DataSetMappingsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, dataSetMappingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "dataSetMappingName": autorest.Encode("path", dataSetMappingName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}", 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 DataSetMappingsClient) 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 DataSetMappingsClient) GetResponder(resp *http.Response) (result DataSetMappingModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByShareSubscription list DataSetMappings in a share subscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the share subscription. +// skipToken - continuation token +func (client DataSetMappingsClient) ListByShareSubscription(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result DataSetMappingListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingsClient.ListByShareSubscription") + defer func() { + sc := -1 + if result.dsml.Response.Response != nil { + sc = result.dsml.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareSubscriptionNextResults + req, err := client.ListByShareSubscriptionPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "ListByShareSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSubscriptionSender(req) + if err != nil { + result.dsml.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "ListByShareSubscription", resp, "Failure sending request") + return + } + + result.dsml, err = client.ListByShareSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "ListByShareSubscription", resp, "Failure responding to request") + } + + return +} + +// ListByShareSubscriptionPreparer prepares the ListByShareSubscription request. +func (client DataSetMappingsClient) ListByShareSubscriptionPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSubscriptionSender sends the ListByShareSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client DataSetMappingsClient) ListByShareSubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByShareSubscriptionResponder handles the response to the ListByShareSubscription request. The method always +// closes the http.Response Body. +func (client DataSetMappingsClient) ListByShareSubscriptionResponder(resp *http.Response) (result DataSetMappingList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByShareSubscriptionNextResults retrieves the next set of results, if any. +func (client DataSetMappingsClient) listByShareSubscriptionNextResults(ctx context.Context, lastResults DataSetMappingList) (result DataSetMappingList, err error) { + req, err := lastResults.dataSetMappingListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "listByShareSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "listByShareSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetMappingsClient", "listByShareSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client DataSetMappingsClient) ListByShareSubscriptionComplete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result DataSetMappingListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingsClient.ListByShareSubscription") + 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.ListByShareSubscription(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/datasets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/datasets.go new file mode 100644 index 0000000000000..8bd6ae6a6b991 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/datasets.go @@ -0,0 +1,404 @@ +package datashare + +// 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" +) + +// DataSetsClient is the creates a Microsoft.DataShare management client. +type DataSetsClient struct { + BaseClient +} + +// NewDataSetsClient creates an instance of the DataSetsClient client. +func NewDataSetsClient(subscriptionID string) DataSetsClient { + return NewDataSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataSetsClientWithBaseURI creates an instance of the DataSetsClient 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 NewDataSetsClientWithBaseURI(baseURI string, subscriptionID string) DataSetsClient { + return DataSetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a DataSet +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share to add the data set to. +// dataSetName - the name of the dataSet. +// dataSet - the new data set information. +func (client DataSetsClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string, dataSet BasicDataSet) (result DataSetModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, shareName, dataSetName, dataSet) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client DataSetsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string, dataSet BasicDataSet) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "dataSetName": autorest.Encode("path", dataSetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}", pathParameters), + autorest.WithJSON(dataSet), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client DataSetsClient) CreateSender(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 +// closes the http.Response Body. +func (client DataSetsClient) CreateResponder(resp *http.Response) (result DataSetModel, 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 a DataSet in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// dataSetName - the name of the dataSet. +func (client DataSetsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (result DataSetsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareName, dataSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DataSetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "dataSetName": autorest.Encode("path", dataSetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}", 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 DataSetsClient) DeleteSender(req *http.Request) (future DataSetsDeleteFuture, 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 DataSetsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a DataSet in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// dataSetName - the name of the dataSet. +func (client DataSetsClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (result DataSetModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, shareName, dataSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DataSetsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, dataSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "dataSetName": autorest.Encode("path", dataSetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}", 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 DataSetsClient) 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 DataSetsClient) GetResponder(resp *http.Response) (result DataSetModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByShare list DataSets in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// skipToken - continuation token +func (client DataSetsClient) ListByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result DataSetListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetsClient.ListByShare") + defer func() { + sc := -1 + if result.dsl.Response.Response != nil { + sc = result.dsl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareNextResults + req, err := client.ListBySharePreparer(ctx, resourceGroupName, accountName, shareName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "ListByShare", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSender(req) + if err != nil { + result.dsl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "ListByShare", resp, "Failure sending request") + return + } + + result.dsl, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "ListByShare", resp, "Failure responding to request") + } + + return +} + +// ListBySharePreparer prepares the ListByShare request. +func (client DataSetsClient) ListBySharePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSender sends the ListByShare request. The method will close the +// http.Response Body if it receives an error. +func (client DataSetsClient) ListByShareSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByShareResponder handles the response to the ListByShare request. The method always +// closes the http.Response Body. +func (client DataSetsClient) ListByShareResponder(resp *http.Response) (result DataSetList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByShareNextResults retrieves the next set of results, if any. +func (client DataSetsClient) listByShareNextResults(ctx context.Context, lastResults DataSetList) (result DataSetList, err error) { + req, err := lastResults.dataSetListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.DataSetsClient", "listByShareNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.DataSetsClient", "listByShareNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsClient", "listByShareNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareComplete enumerates all values, automatically crossing page boundaries as required. +func (client DataSetsClient) ListByShareComplete(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result DataSetListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetsClient.ListByShare") + 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.ListByShare(ctx, resourceGroupName, accountName, shareName, skipToken) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/invitations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/invitations.go new file mode 100644 index 0000000000000..1482860b3e973 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/invitations.go @@ -0,0 +1,404 @@ +package datashare + +// 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" +) + +// InvitationsClient is the creates a Microsoft.DataShare management client. +type InvitationsClient struct { + BaseClient +} + +// NewInvitationsClient creates an instance of the InvitationsClient client. +func NewInvitationsClient(subscriptionID string) InvitationsClient { + return NewInvitationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewInvitationsClientWithBaseURI creates an instance of the InvitationsClient 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 NewInvitationsClientWithBaseURI(baseURI string, subscriptionID string) InvitationsClient { + return InvitationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create an invitation +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share to send the invitation for. +// invitationName - the name of the invitation. +// invitation - invitation details. +func (client InvitationsClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string, invitation Invitation) (result Invitation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, shareName, invitationName, invitation) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client InvitationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string, invitation Invitation) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "invitationName": autorest.Encode("path", invitationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}", pathParameters), + autorest.WithJSON(invitation), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client InvitationsClient) CreateSender(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 +// closes the http.Response Body. +func (client InvitationsClient) CreateResponder(resp *http.Response) (result Invitation, 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 an invitation in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// invitationName - the name of the invitation. +func (client InvitationsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareName, invitationName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client InvitationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "invitationName": autorest.Encode("path", invitationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}", 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 InvitationsClient) 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 InvitationsClient) 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 get an invitation in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// invitationName - the name of the invitation. +func (client InvitationsClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string) (result Invitation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, shareName, invitationName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client InvitationsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, invitationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "invitationName": autorest.Encode("path", invitationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/invitations/{invitationName}", 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 InvitationsClient) 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 InvitationsClient) GetResponder(resp *http.Response) (result Invitation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByShare list invitations in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// skipToken - the continuation token +func (client InvitationsClient) ListByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result InvitationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationsClient.ListByShare") + defer func() { + sc := -1 + if result.il.Response.Response != nil { + sc = result.il.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareNextResults + req, err := client.ListBySharePreparer(ctx, resourceGroupName, accountName, shareName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "ListByShare", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSender(req) + if err != nil { + result.il.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "ListByShare", resp, "Failure sending request") + return + } + + result.il, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "ListByShare", resp, "Failure responding to request") + } + + return +} + +// ListBySharePreparer prepares the ListByShare request. +func (client InvitationsClient) ListBySharePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/invitations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSender sends the ListByShare request. The method will close the +// http.Response Body if it receives an error. +func (client InvitationsClient) ListByShareSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByShareResponder handles the response to the ListByShare request. The method always +// closes the http.Response Body. +func (client InvitationsClient) ListByShareResponder(resp *http.Response) (result InvitationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByShareNextResults retrieves the next set of results, if any. +func (client InvitationsClient) listByShareNextResults(ctx context.Context, lastResults InvitationList) (result InvitationList, err error) { + req, err := lastResults.invitationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.InvitationsClient", "listByShareNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.InvitationsClient", "listByShareNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.InvitationsClient", "listByShareNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareComplete enumerates all values, automatically crossing page boundaries as required. +func (client InvitationsClient) ListByShareComplete(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result InvitationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationsClient.ListByShare") + 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.ListByShare(ctx, resourceGroupName, accountName, shareName, skipToken) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/models.go new file mode 100644 index 0000000000000..635c9959b48d2 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/models.go @@ -0,0 +1,8908 @@ +package datashare + +// 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/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare" + +// DataSetMappingStatus enumerates the values for data set mapping status. +type DataSetMappingStatus string + +const ( + // Broken ... + Broken DataSetMappingStatus = "Broken" + // Ok ... + Ok DataSetMappingStatus = "Ok" +) + +// PossibleDataSetMappingStatusValues returns an array of possible values for the DataSetMappingStatus const type. +func PossibleDataSetMappingStatusValues() []DataSetMappingStatus { + return []DataSetMappingStatus{Broken, Ok} +} + +// DataSetType enumerates the values for data set type. +type DataSetType string + +const ( + // AdlsGen1File ... + AdlsGen1File DataSetType = "AdlsGen1File" + // AdlsGen1Folder ... + AdlsGen1Folder DataSetType = "AdlsGen1Folder" + // AdlsGen2File ... + AdlsGen2File DataSetType = "AdlsGen2File" + // AdlsGen2FileSystem ... + AdlsGen2FileSystem DataSetType = "AdlsGen2FileSystem" + // AdlsGen2Folder ... + AdlsGen2Folder DataSetType = "AdlsGen2Folder" + // Blob ... + Blob DataSetType = "Blob" + // BlobFolder ... + BlobFolder DataSetType = "BlobFolder" + // Container ... + Container DataSetType = "Container" + // KustoCluster ... + KustoCluster DataSetType = "KustoCluster" + // KustoDatabase ... + KustoDatabase DataSetType = "KustoDatabase" + // SQLDBTable ... + SQLDBTable DataSetType = "SqlDBTable" + // SQLDWTable ... + SQLDWTable DataSetType = "SqlDWTable" +) + +// PossibleDataSetTypeValues returns an array of possible values for the DataSetType const type. +func PossibleDataSetTypeValues() []DataSetType { + return []DataSetType{AdlsGen1File, AdlsGen1Folder, AdlsGen2File, AdlsGen2FileSystem, AdlsGen2Folder, Blob, BlobFolder, Container, KustoCluster, KustoDatabase, SQLDBTable, SQLDWTable} +} + +// InvitationStatus enumerates the values for invitation status. +type InvitationStatus string + +const ( + // Accepted ... + Accepted InvitationStatus = "Accepted" + // Pending ... + Pending InvitationStatus = "Pending" + // Rejected ... + Rejected InvitationStatus = "Rejected" + // Withdrawn ... + Withdrawn InvitationStatus = "Withdrawn" +) + +// PossibleInvitationStatusValues returns an array of possible values for the InvitationStatus const type. +func PossibleInvitationStatusValues() []InvitationStatus { + return []InvitationStatus{Accepted, Pending, Rejected, Withdrawn} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindAdlsGen1File ... + KindAdlsGen1File Kind = "AdlsGen1File" + // KindAdlsGen1Folder ... + KindAdlsGen1Folder Kind = "AdlsGen1Folder" + // KindAdlsGen2File ... + KindAdlsGen2File Kind = "AdlsGen2File" + // KindAdlsGen2FileSystem ... + KindAdlsGen2FileSystem Kind = "AdlsGen2FileSystem" + // KindAdlsGen2Folder ... + KindAdlsGen2Folder Kind = "AdlsGen2Folder" + // KindBlob ... + KindBlob Kind = "Blob" + // KindBlobFolder ... + KindBlobFolder Kind = "BlobFolder" + // KindContainer ... + KindContainer Kind = "Container" + // KindDataSet ... + KindDataSet Kind = "DataSet" + // KindKustoCluster ... + KindKustoCluster Kind = "KustoCluster" + // KindKustoDatabase ... + KindKustoDatabase Kind = "KustoDatabase" + // KindSQLDBTable ... + KindSQLDBTable Kind = "SqlDBTable" + // KindSQLDWTable ... + KindSQLDWTable Kind = "SqlDWTable" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindAdlsGen1File, KindAdlsGen1Folder, KindAdlsGen2File, KindAdlsGen2FileSystem, KindAdlsGen2Folder, KindBlob, KindBlobFolder, KindContainer, KindDataSet, KindKustoCluster, KindKustoDatabase, KindSQLDBTable, KindSQLDWTable} +} + +// KindBasicDataSetMapping enumerates the values for kind basic data set mapping. +type KindBasicDataSetMapping string + +const ( + // KindBasicDataSetMappingKindAdlsGen2File ... + KindBasicDataSetMappingKindAdlsGen2File KindBasicDataSetMapping = "AdlsGen2File" + // KindBasicDataSetMappingKindAdlsGen2FileSystem ... + KindBasicDataSetMappingKindAdlsGen2FileSystem KindBasicDataSetMapping = "AdlsGen2FileSystem" + // KindBasicDataSetMappingKindAdlsGen2Folder ... + KindBasicDataSetMappingKindAdlsGen2Folder KindBasicDataSetMapping = "AdlsGen2Folder" + // KindBasicDataSetMappingKindBlob ... + KindBasicDataSetMappingKindBlob KindBasicDataSetMapping = "Blob" + // KindBasicDataSetMappingKindBlobFolder ... + KindBasicDataSetMappingKindBlobFolder KindBasicDataSetMapping = "BlobFolder" + // KindBasicDataSetMappingKindContainer ... + KindBasicDataSetMappingKindContainer KindBasicDataSetMapping = "Container" + // KindBasicDataSetMappingKindDataSetMapping ... + KindBasicDataSetMappingKindDataSetMapping KindBasicDataSetMapping = "DataSetMapping" + // KindBasicDataSetMappingKindKustoCluster ... + KindBasicDataSetMappingKindKustoCluster KindBasicDataSetMapping = "KustoCluster" + // KindBasicDataSetMappingKindKustoDatabase ... + KindBasicDataSetMappingKindKustoDatabase KindBasicDataSetMapping = "KustoDatabase" + // KindBasicDataSetMappingKindSQLDBTable ... + KindBasicDataSetMappingKindSQLDBTable KindBasicDataSetMapping = "SqlDBTable" + // KindBasicDataSetMappingKindSQLDWTable ... + KindBasicDataSetMappingKindSQLDWTable KindBasicDataSetMapping = "SqlDWTable" +) + +// PossibleKindBasicDataSetMappingValues returns an array of possible values for the KindBasicDataSetMapping const type. +func PossibleKindBasicDataSetMappingValues() []KindBasicDataSetMapping { + return []KindBasicDataSetMapping{KindBasicDataSetMappingKindAdlsGen2File, KindBasicDataSetMappingKindAdlsGen2FileSystem, KindBasicDataSetMappingKindAdlsGen2Folder, KindBasicDataSetMappingKindBlob, KindBasicDataSetMappingKindBlobFolder, KindBasicDataSetMappingKindContainer, KindBasicDataSetMappingKindDataSetMapping, KindBasicDataSetMappingKindKustoCluster, KindBasicDataSetMappingKindKustoDatabase, KindBasicDataSetMappingKindSQLDBTable, KindBasicDataSetMappingKindSQLDWTable} +} + +// KindBasicSourceShareSynchronizationSetting enumerates the values for kind basic source share synchronization +// setting. +type KindBasicSourceShareSynchronizationSetting string + +const ( + // KindScheduleBased ... + KindScheduleBased KindBasicSourceShareSynchronizationSetting = "ScheduleBased" + // KindSourceShareSynchronizationSetting ... + KindSourceShareSynchronizationSetting KindBasicSourceShareSynchronizationSetting = "SourceShareSynchronizationSetting" +) + +// PossibleKindBasicSourceShareSynchronizationSettingValues returns an array of possible values for the KindBasicSourceShareSynchronizationSetting const type. +func PossibleKindBasicSourceShareSynchronizationSettingValues() []KindBasicSourceShareSynchronizationSetting { + return []KindBasicSourceShareSynchronizationSetting{KindScheduleBased, KindSourceShareSynchronizationSetting} +} + +// KindBasicSynchronizationSetting enumerates the values for kind basic synchronization setting. +type KindBasicSynchronizationSetting string + +const ( + // KindBasicSynchronizationSettingKindScheduleBased ... + KindBasicSynchronizationSettingKindScheduleBased KindBasicSynchronizationSetting = "ScheduleBased" + // KindBasicSynchronizationSettingKindSynchronizationSetting ... + KindBasicSynchronizationSettingKindSynchronizationSetting KindBasicSynchronizationSetting = "SynchronizationSetting" +) + +// PossibleKindBasicSynchronizationSettingValues returns an array of possible values for the KindBasicSynchronizationSetting const type. +func PossibleKindBasicSynchronizationSettingValues() []KindBasicSynchronizationSetting { + return []KindBasicSynchronizationSetting{KindBasicSynchronizationSettingKindScheduleBased, KindBasicSynchronizationSettingKindSynchronizationSetting} +} + +// KindBasicTrigger enumerates the values for kind basic trigger. +type KindBasicTrigger string + +const ( + // KindBasicTriggerKindScheduleBased ... + KindBasicTriggerKindScheduleBased KindBasicTrigger = "ScheduleBased" + // KindBasicTriggerKindTrigger ... + KindBasicTriggerKindTrigger KindBasicTrigger = "Trigger" +) + +// PossibleKindBasicTriggerValues returns an array of possible values for the KindBasicTrigger const type. +func PossibleKindBasicTriggerValues() []KindBasicTrigger { + return []KindBasicTrigger{KindBasicTriggerKindScheduleBased, KindBasicTriggerKindTrigger} +} + +// OutputType enumerates the values for output type. +type OutputType string + +const ( + // Csv ... + Csv OutputType = "Csv" + // Parquet ... + Parquet OutputType = "Parquet" +) + +// PossibleOutputTypeValues returns an array of possible values for the OutputType const type. +func PossibleOutputTypeValues() []OutputType { + return []OutputType{Csv, Parquet} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Creating ... + Creating ProvisioningState = "Creating" + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Moving ... + Moving ProvisioningState = "Moving" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Creating, Deleting, Failed, Moving, Succeeded} +} + +// RecurrenceInterval enumerates the values for recurrence interval. +type RecurrenceInterval string + +const ( + // Day ... + Day RecurrenceInterval = "Day" + // Hour ... + Hour RecurrenceInterval = "Hour" +) + +// PossibleRecurrenceIntervalValues returns an array of possible values for the RecurrenceInterval const type. +func PossibleRecurrenceIntervalValues() []RecurrenceInterval { + return []RecurrenceInterval{Day, Hour} +} + +// ShareKind enumerates the values for share kind. +type ShareKind string + +const ( + // CopyBased ... + CopyBased ShareKind = "CopyBased" + // InPlace ... + InPlace ShareKind = "InPlace" +) + +// PossibleShareKindValues returns an array of possible values for the ShareKind const type. +func PossibleShareKindValues() []ShareKind { + return []ShareKind{CopyBased, InPlace} +} + +// ShareSubscriptionStatus enumerates the values for share subscription status. +type ShareSubscriptionStatus string + +const ( + // Active ... + Active ShareSubscriptionStatus = "Active" + // Revoked ... + Revoked ShareSubscriptionStatus = "Revoked" + // Revoking ... + Revoking ShareSubscriptionStatus = "Revoking" + // SourceDeleted ... + SourceDeleted ShareSubscriptionStatus = "SourceDeleted" +) + +// PossibleShareSubscriptionStatusValues returns an array of possible values for the ShareSubscriptionStatus const type. +func PossibleShareSubscriptionStatusValues() []ShareSubscriptionStatus { + return []ShareSubscriptionStatus{Active, Revoked, Revoking, SourceDeleted} +} + +// Status enumerates the values for status. +type Status string + +const ( + // StatusAccepted ... + StatusAccepted Status = "Accepted" + // StatusCanceled ... + StatusCanceled Status = "Canceled" + // StatusFailed ... + StatusFailed Status = "Failed" + // StatusInProgress ... + StatusInProgress Status = "InProgress" + // StatusSucceeded ... + StatusSucceeded Status = "Succeeded" + // StatusTransientFailure ... + StatusTransientFailure Status = "TransientFailure" +) + +// PossibleStatusValues returns an array of possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{StatusAccepted, StatusCanceled, StatusFailed, StatusInProgress, StatusSucceeded, StatusTransientFailure} +} + +// SynchronizationMode enumerates the values for synchronization mode. +type SynchronizationMode string + +const ( + // FullSync ... + FullSync SynchronizationMode = "FullSync" + // Incremental ... + Incremental SynchronizationMode = "Incremental" +) + +// PossibleSynchronizationModeValues returns an array of possible values for the SynchronizationMode const type. +func PossibleSynchronizationModeValues() []SynchronizationMode { + return []SynchronizationMode{FullSync, Incremental} +} + +// TriggerStatus enumerates the values for trigger status. +type TriggerStatus string + +const ( + // TriggerStatusActive ... + TriggerStatusActive TriggerStatus = "Active" + // TriggerStatusInactive ... + TriggerStatusInactive TriggerStatus = "Inactive" + // TriggerStatusSourceSynchronizationSettingDeleted ... + TriggerStatusSourceSynchronizationSettingDeleted TriggerStatus = "SourceSynchronizationSettingDeleted" +) + +// PossibleTriggerStatusValues returns an array of possible values for the TriggerStatus const type. +func PossibleTriggerStatusValues() []TriggerStatus { + return []TriggerStatus{TriggerStatusActive, TriggerStatusInactive, TriggerStatusSourceSynchronizationSettingDeleted} +} + +// Type enumerates the values for type. +type Type string + +const ( + // SystemAssigned ... + SystemAssigned Type = "SystemAssigned" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{SystemAssigned} +} + +// Account an account data transfer object. +type Account struct { + autorest.Response `json:"-"` + // Identity - Identity Info on the Account + Identity *Identity `json:"identity,omitempty"` + // AccountProperties - Properties on the account + *AccountProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Location - Location of the azure resource. + Location *string `json:"location,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Tags - Tags on the azure resource. + Tags map[string]*string `json:"tags"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.Identity != nil { + objectMap["identity"] = a.Identity + } + if a.AccountProperties != nil { + objectMap["properties"] = a.AccountProperties + } + if a.Location != nil { + objectMap["location"] = a.Location + } + if a.Tags != nil { + objectMap["tags"] = a.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Account struct. +func (a *Account) 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 "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + a.Identity = &identity + } + case "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + a.AccountProperties = &accountProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + a.Location = &location + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + a.Tags = tags + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + } + } + + return nil +} + +// AccountList list response for get Accounts. +type AccountList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]Account `json:"value,omitempty"` +} + +// AccountListIterator provides access to a complete listing of Account values. +type AccountListIterator struct { + i int + page AccountListPage +} + +// 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 *AccountListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountListIterator.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 *AccountListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AccountListIterator) 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 AccountListIterator) Response() AccountList { + 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 AccountListIterator) Value() Account { + if !iter.page.NotDone() { + return Account{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AccountListIterator type. +func NewAccountListIterator(page AccountListPage) AccountListIterator { + return AccountListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al AccountList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// accountListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al AccountList) accountListPreparer(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))) +} + +// AccountListPage contains a page of Account values. +type AccountListPage struct { + fn func(context.Context, AccountList) (AccountList, error) + al AccountList +} + +// 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 *AccountListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountListPage.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 *AccountListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AccountListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AccountListPage) Response() AccountList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AccountListPage) Values() []Account { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the AccountListPage type. +func NewAccountListPage(getNextPage func(context.Context, AccountList) (AccountList, error)) AccountListPage { + return AccountListPage{fn: getNextPage} +} + +// AccountProperties account property bag. +type AccountProperties struct { + // CreatedAt - READ-ONLY; Time at which the account was created. + CreatedAt *date.Time `json:"createdAt,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the Account. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` +} + +// AccountsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AccountsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AccountsCreateFuture) Result(client AccountsClient) (a Account, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.AccountsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent { + a, err = client.CreateResponder(a.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsCreateFuture", "Result", a.Response.Response, "Failure responding to request") + } + } + return +} + +// AccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AccountsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AccountsDeleteFuture) Result(client AccountsClient) (or OperationResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.AccountsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent { + or, err = client.DeleteResponder(or.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.AccountsDeleteFuture", "Result", or.Response.Response, "Failure responding to request") + } + } + return +} + +// AccountUpdateParameters update parameters for accounts +type AccountUpdateParameters struct { + // Tags - Tags on the azure resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AccountUpdateParameters. +func (aup AccountUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aup.Tags != nil { + objectMap["tags"] = aup.Tags + } + return json.Marshal(objectMap) +} + +// ADLSGen1FileDataSet an ADLS Gen 1 file data set. +type ADLSGen1FileDataSet struct { + // ADLSGen1FileProperties - ADLS Gen 1 file data set properties. + *ADLSGen1FileProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) MarshalJSON() ([]byte, error) { + ag1fds.Kind = KindAdlsGen1File + objectMap := make(map[string]interface{}) + if ag1fds.ADLSGen1FileProperties != nil { + objectMap["properties"] = ag1fds.ADLSGen1FileProperties + } + if ag1fds.Kind != "" { + objectMap["kind"] = ag1fds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return &ag1fds, true +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for ADLSGen1FileDataSet. +func (ag1fds ADLSGen1FileDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &ag1fds, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen1FileDataSet struct. +func (ag1fds *ADLSGen1FileDataSet) 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 aDLSGen1FileProperties ADLSGen1FileProperties + err = json.Unmarshal(*v, &aDLSGen1FileProperties) + if err != nil { + return err + } + ag1fds.ADLSGen1FileProperties = &aDLSGen1FileProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag1fds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag1fds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag1fds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag1fds.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen1FileProperties properties of the ADLS Gen1 file data set. +type ADLSGen1FileProperties struct { + // AccountName - The ADLS account name. + AccountName *string `json:"accountName,omitempty"` + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // FileName - The file name in the ADLS account. + FileName *string `json:"fileName,omitempty"` + // FolderPath - The folder path within the ADLS account. + FolderPath *string `json:"folderPath,omitempty"` + // ResourceGroup - Resource group of ADLS account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // SubscriptionID - Subscription id of ADLS account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen1FolderDataSet an ADLS Gen 1 folder data set. +type ADLSGen1FolderDataSet struct { + // ADLSGen1FolderProperties - ADLS Gen 1 folder data set properties. + *ADLSGen1FolderProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) MarshalJSON() ([]byte, error) { + ag1fds.Kind = KindAdlsGen1Folder + objectMap := make(map[string]interface{}) + if ag1fds.ADLSGen1FolderProperties != nil { + objectMap["properties"] = ag1fds.ADLSGen1FolderProperties + } + if ag1fds.Kind != "" { + objectMap["kind"] = ag1fds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return &ag1fds, true +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for ADLSGen1FolderDataSet. +func (ag1fds ADLSGen1FolderDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &ag1fds, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen1FolderDataSet struct. +func (ag1fds *ADLSGen1FolderDataSet) 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 aDLSGen1FolderProperties ADLSGen1FolderProperties + err = json.Unmarshal(*v, &aDLSGen1FolderProperties) + if err != nil { + return err + } + ag1fds.ADLSGen1FolderProperties = &aDLSGen1FolderProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag1fds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag1fds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag1fds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag1fds.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen1FolderProperties properties of the ADLS Gen1 folder data set. +type ADLSGen1FolderProperties struct { + // AccountName - The ADLS account name. + AccountName *string `json:"accountName,omitempty"` + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // FolderPath - The folder path within the ADLS account. + FolderPath *string `json:"folderPath,omitempty"` + // ResourceGroup - Resource group of ADLS account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // SubscriptionID - Subscription id of ADLS account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen2FileDataSet an ADLS Gen 2 file data set. +type ADLSGen2FileDataSet struct { + // ADLSGen2FileProperties - ADLS Gen 2 file data set properties. + *ADLSGen2FileProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) MarshalJSON() ([]byte, error) { + ag2fds.Kind = KindAdlsGen2File + objectMap := make(map[string]interface{}) + if ag2fds.ADLSGen2FileProperties != nil { + objectMap["properties"] = ag2fds.ADLSGen2FileProperties + } + if ag2fds.Kind != "" { + objectMap["kind"] = ag2fds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return &ag2fds, true +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for ADLSGen2FileDataSet. +func (ag2fds ADLSGen2FileDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &ag2fds, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen2FileDataSet struct. +func (ag2fds *ADLSGen2FileDataSet) 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 aDLSGen2FileProperties ADLSGen2FileProperties + err = json.Unmarshal(*v, &aDLSGen2FileProperties) + if err != nil { + return err + } + ag2fds.ADLSGen2FileProperties = &aDLSGen2FileProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag2fds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag2fds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag2fds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag2fds.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen2FileDataSetMapping an ADLS Gen2 file data set mapping. +type ADLSGen2FileDataSetMapping struct { + // ADLSGen2FileDataSetMappingProperties - ADLS Gen2 file data set mapping properties. + *ADLSGen2FileDataSetMappingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) MarshalJSON() ([]byte, error) { + ag2fdsm.Kind = KindBasicDataSetMappingKindAdlsGen2File + objectMap := make(map[string]interface{}) + if ag2fdsm.ADLSGen2FileDataSetMappingProperties != nil { + objectMap["properties"] = ag2fdsm.ADLSGen2FileDataSetMappingProperties + } + if ag2fdsm.Kind != "" { + objectMap["kind"] = ag2fdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return &ag2fdsm, true +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileDataSetMapping. +func (ag2fdsm ADLSGen2FileDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &ag2fdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen2FileDataSetMapping struct. +func (ag2fdsm *ADLSGen2FileDataSetMapping) 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 aDLSGen2FileDataSetMappingProperties ADLSGen2FileDataSetMappingProperties + err = json.Unmarshal(*v, &aDLSGen2FileDataSetMappingProperties) + if err != nil { + return err + } + ag2fdsm.ADLSGen2FileDataSetMappingProperties = &aDLSGen2FileDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag2fdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag2fdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag2fdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag2fdsm.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen2FileDataSetMappingProperties ADLS Gen 2 file data set mapping property bag. +type ADLSGen2FileDataSetMappingProperties struct { + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // FilePath - File path within the file system. + FilePath *string `json:"filePath,omitempty"` + // FileSystem - File system to which the file belongs. + FileSystem *string `json:"fileSystem,omitempty"` + // OutputType - Type of output file. Possible values include: 'Csv', 'Parquet' + OutputType OutputType `json:"outputType,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceGroup - Resource group of storage account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen2FileProperties properties of the ADLS Gen2 file data set. +type ADLSGen2FileProperties struct { + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // FilePath - File path within the file system. + FilePath *string `json:"filePath,omitempty"` + // FileSystem - File system to which the file belongs. + FileSystem *string `json:"fileSystem,omitempty"` + // ResourceGroup - Resource group of storage account + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen2FileSystemDataSet an ADLS Gen 2 file system data set. +type ADLSGen2FileSystemDataSet struct { + // ADLSGen2FileSystemProperties - ADLS Gen 2 file system data set properties. + *ADLSGen2FileSystemProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) MarshalJSON() ([]byte, error) { + ag2fsds.Kind = KindAdlsGen2FileSystem + objectMap := make(map[string]interface{}) + if ag2fsds.ADLSGen2FileSystemProperties != nil { + objectMap["properties"] = ag2fsds.ADLSGen2FileSystemProperties + } + if ag2fsds.Kind != "" { + objectMap["kind"] = ag2fsds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return &ag2fsds, true +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for ADLSGen2FileSystemDataSet. +func (ag2fsds ADLSGen2FileSystemDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &ag2fsds, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen2FileSystemDataSet struct. +func (ag2fsds *ADLSGen2FileSystemDataSet) 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 aDLSGen2FileSystemProperties ADLSGen2FileSystemProperties + err = json.Unmarshal(*v, &aDLSGen2FileSystemProperties) + if err != nil { + return err + } + ag2fsds.ADLSGen2FileSystemProperties = &aDLSGen2FileSystemProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag2fsds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag2fsds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag2fsds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag2fsds.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen2FileSystemDataSetMapping an ADLS Gen2 file system data set mapping. +type ADLSGen2FileSystemDataSetMapping struct { + // ADLSGen2FileSystemDataSetMappingProperties - ADLS Gen2 file system data set mapping properties. + *ADLSGen2FileSystemDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) MarshalJSON() ([]byte, error) { + ag2fsdsm.Kind = KindBasicDataSetMappingKindAdlsGen2FileSystem + objectMap := make(map[string]interface{}) + if ag2fsdsm.ADLSGen2FileSystemDataSetMappingProperties != nil { + objectMap["properties"] = ag2fsdsm.ADLSGen2FileSystemDataSetMappingProperties + } + if ag2fsdsm.Kind != "" { + objectMap["kind"] = ag2fsdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return &ag2fsdsm, true +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FileSystemDataSetMapping. +func (ag2fsdsm ADLSGen2FileSystemDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &ag2fsdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen2FileSystemDataSetMapping struct. +func (ag2fsdsm *ADLSGen2FileSystemDataSetMapping) 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 aDLSGen2FileSystemDataSetMappingProperties ADLSGen2FileSystemDataSetMappingProperties + err = json.Unmarshal(*v, &aDLSGen2FileSystemDataSetMappingProperties) + if err != nil { + return err + } + ag2fsdsm.ADLSGen2FileSystemDataSetMappingProperties = &aDLSGen2FileSystemDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag2fsdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag2fsdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag2fsdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag2fsdsm.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen2FileSystemDataSetMappingProperties ADLS Gen 2 file system data set mapping property bag. +type ADLSGen2FileSystemDataSetMappingProperties struct { + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // FileSystem - The file system name. + FileSystem *string `json:"fileSystem,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceGroup - Resource group of storage account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen2FileSystemProperties properties of the ADLS Gen2 file system data set. +type ADLSGen2FileSystemProperties struct { + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // FileSystem - The file system name. + FileSystem *string `json:"fileSystem,omitempty"` + // ResourceGroup - Resource group of storage account + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen2FolderDataSet an ADLS Gen 2 folder data set. +type ADLSGen2FolderDataSet struct { + // ADLSGen2FolderProperties - ADLS Gen 2 folder data set properties. + *ADLSGen2FolderProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) MarshalJSON() ([]byte, error) { + ag2fds.Kind = KindAdlsGen2Folder + objectMap := make(map[string]interface{}) + if ag2fds.ADLSGen2FolderProperties != nil { + objectMap["properties"] = ag2fds.ADLSGen2FolderProperties + } + if ag2fds.Kind != "" { + objectMap["kind"] = ag2fds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return &ag2fds, true +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for ADLSGen2FolderDataSet. +func (ag2fds ADLSGen2FolderDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &ag2fds, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen2FolderDataSet struct. +func (ag2fds *ADLSGen2FolderDataSet) 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 aDLSGen2FolderProperties ADLSGen2FolderProperties + err = json.Unmarshal(*v, &aDLSGen2FolderProperties) + if err != nil { + return err + } + ag2fds.ADLSGen2FolderProperties = &aDLSGen2FolderProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag2fds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag2fds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag2fds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag2fds.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen2FolderDataSetMapping an ADLS Gen2 folder data set mapping. +type ADLSGen2FolderDataSetMapping struct { + // ADLSGen2FolderDataSetMappingProperties - ADLS Gen2 folder data set mapping properties. + *ADLSGen2FolderDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) MarshalJSON() ([]byte, error) { + ag2fdsm.Kind = KindBasicDataSetMappingKindAdlsGen2Folder + objectMap := make(map[string]interface{}) + if ag2fdsm.ADLSGen2FolderDataSetMappingProperties != nil { + objectMap["properties"] = ag2fdsm.ADLSGen2FolderDataSetMappingProperties + } + if ag2fdsm.Kind != "" { + objectMap["kind"] = ag2fdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return &ag2fdsm, true +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for ADLSGen2FolderDataSetMapping. +func (ag2fdsm ADLSGen2FolderDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &ag2fdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for ADLSGen2FolderDataSetMapping struct. +func (ag2fdsm *ADLSGen2FolderDataSetMapping) 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 aDLSGen2FolderDataSetMappingProperties ADLSGen2FolderDataSetMappingProperties + err = json.Unmarshal(*v, &aDLSGen2FolderDataSetMappingProperties) + if err != nil { + return err + } + ag2fdsm.ADLSGen2FolderDataSetMappingProperties = &aDLSGen2FolderDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ag2fdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag2fdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag2fdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag2fdsm.Type = &typeVar + } + } + } + + return nil +} + +// ADLSGen2FolderDataSetMappingProperties ADLS Gen 2 folder data set mapping property bag. +type ADLSGen2FolderDataSetMappingProperties struct { + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // FileSystem - File system to which the folder belongs. + FileSystem *string `json:"fileSystem,omitempty"` + // FolderPath - Folder path within the file system. + FolderPath *string `json:"folderPath,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceGroup - Resource group of storage account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ADLSGen2FolderProperties properties of the ADLS Gen2 folder data set. +type ADLSGen2FolderProperties struct { + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // FileSystem - File system to which the folder belongs. + FileSystem *string `json:"fileSystem,omitempty"` + // FolderPath - Folder path within the file system. + FolderPath *string `json:"folderPath,omitempty"` + // ResourceGroup - Resource group of storage account + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// BlobContainerDataSet an Azure storage blob container data set. +type BlobContainerDataSet struct { + // BlobContainerProperties - Blob container data set properties. + *BlobContainerProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BlobContainerDataSet. +func (bcds BlobContainerDataSet) MarshalJSON() ([]byte, error) { + bcds.Kind = KindContainer + objectMap := make(map[string]interface{}) + if bcds.BlobContainerProperties != nil { + objectMap["properties"] = bcds.BlobContainerProperties + } + if bcds.Kind != "" { + objectMap["kind"] = bcds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return &bcds, true +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for BlobContainerDataSet. +func (bcds BlobContainerDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &bcds, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobContainerDataSet struct. +func (bcds *BlobContainerDataSet) 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 blobContainerProperties BlobContainerProperties + err = json.Unmarshal(*v, &blobContainerProperties) + if err != nil { + return err + } + bcds.BlobContainerProperties = &blobContainerProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bcds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bcds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bcds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bcds.Type = &typeVar + } + } + } + + return nil +} + +// BlobContainerDataSetMapping a Blob container data set mapping. +type BlobContainerDataSetMapping struct { + // BlobContainerMappingProperties - Blob container data set mapping properties. + *BlobContainerMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) MarshalJSON() ([]byte, error) { + bcdsm.Kind = KindBasicDataSetMappingKindContainer + objectMap := make(map[string]interface{}) + if bcdsm.BlobContainerMappingProperties != nil { + objectMap["properties"] = bcdsm.BlobContainerMappingProperties + } + if bcdsm.Kind != "" { + objectMap["kind"] = bcdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return &bcdsm, true +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for BlobContainerDataSetMapping. +func (bcdsm BlobContainerDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &bcdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobContainerDataSetMapping struct. +func (bcdsm *BlobContainerDataSetMapping) 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 blobContainerMappingProperties BlobContainerMappingProperties + err = json.Unmarshal(*v, &blobContainerMappingProperties) + if err != nil { + return err + } + bcdsm.BlobContainerMappingProperties = &blobContainerMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bcdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bcdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bcdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bcdsm.Type = &typeVar + } + } + } + + return nil +} + +// BlobContainerMappingProperties azure storage Blob container data set mapping property bag. +type BlobContainerMappingProperties struct { + // ContainerName - BLOB Container name. + ContainerName *string `json:"containerName,omitempty"` + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceGroup - Resource group of storage account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// BlobContainerProperties properties of the BLOB container data set. +type BlobContainerProperties struct { + // ContainerName - BLOB Container name. + ContainerName *string `json:"containerName,omitempty"` + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // ResourceGroup - Resource group of storage account + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// BlobDataSet an Azure storage blob data set. +type BlobDataSet struct { + // BlobProperties - Blob data set properties. + *BlobProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BlobDataSet. +func (bds BlobDataSet) MarshalJSON() ([]byte, error) { + bds.Kind = KindBlob + objectMap := make(map[string]interface{}) + if bds.BlobProperties != nil { + objectMap["properties"] = bds.BlobProperties + } + if bds.Kind != "" { + objectMap["kind"] = bds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return &bds, true +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for BlobDataSet. +func (bds BlobDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &bds, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobDataSet struct. +func (bds *BlobDataSet) 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 blobProperties BlobProperties + err = json.Unmarshal(*v, &blobProperties) + if err != nil { + return err + } + bds.BlobProperties = &blobProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bds.Type = &typeVar + } + } + } + + return nil +} + +// BlobDataSetMapping a Blob data set mapping. +type BlobDataSetMapping struct { + // BlobMappingProperties - Blob data set mapping properties. + *BlobMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) MarshalJSON() ([]byte, error) { + bdsm.Kind = KindBasicDataSetMappingKindBlob + objectMap := make(map[string]interface{}) + if bdsm.BlobMappingProperties != nil { + objectMap["properties"] = bdsm.BlobMappingProperties + } + if bdsm.Kind != "" { + objectMap["kind"] = bdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return &bdsm, true +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for BlobDataSetMapping. +func (bdsm BlobDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &bdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobDataSetMapping struct. +func (bdsm *BlobDataSetMapping) 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 blobMappingProperties BlobMappingProperties + err = json.Unmarshal(*v, &blobMappingProperties) + if err != nil { + return err + } + bdsm.BlobMappingProperties = &blobMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bdsm.Type = &typeVar + } + } + } + + return nil +} + +// BlobFolderDataSet an Azure storage blob folder data set. +type BlobFolderDataSet struct { + // BlobFolderProperties - Blob folder data set properties. + *BlobFolderProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BlobFolderDataSet. +func (bfds BlobFolderDataSet) MarshalJSON() ([]byte, error) { + bfds.Kind = KindBlobFolder + objectMap := make(map[string]interface{}) + if bfds.BlobFolderProperties != nil { + objectMap["properties"] = bfds.BlobFolderProperties + } + if bfds.Kind != "" { + objectMap["kind"] = bfds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return &bfds, true +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for BlobFolderDataSet. +func (bfds BlobFolderDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &bfds, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobFolderDataSet struct. +func (bfds *BlobFolderDataSet) 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 blobFolderProperties BlobFolderProperties + err = json.Unmarshal(*v, &blobFolderProperties) + if err != nil { + return err + } + bfds.BlobFolderProperties = &blobFolderProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bfds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bfds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bfds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bfds.Type = &typeVar + } + } + } + + return nil +} + +// BlobFolderDataSetMapping a Blob folder data set mapping. +type BlobFolderDataSetMapping struct { + // BlobFolderMappingProperties - Blob folder data set mapping properties. + *BlobFolderMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) MarshalJSON() ([]byte, error) { + bfdsm.Kind = KindBasicDataSetMappingKindBlobFolder + objectMap := make(map[string]interface{}) + if bfdsm.BlobFolderMappingProperties != nil { + objectMap["properties"] = bfdsm.BlobFolderMappingProperties + } + if bfdsm.Kind != "" { + objectMap["kind"] = bfdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return &bfdsm, true +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for BlobFolderDataSetMapping. +func (bfdsm BlobFolderDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &bfdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for BlobFolderDataSetMapping struct. +func (bfdsm *BlobFolderDataSetMapping) 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 blobFolderMappingProperties BlobFolderMappingProperties + err = json.Unmarshal(*v, &blobFolderMappingProperties) + if err != nil { + return err + } + bfdsm.BlobFolderMappingProperties = &blobFolderMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bfdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bfdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bfdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bfdsm.Type = &typeVar + } + } + } + + return nil +} + +// BlobFolderMappingProperties azure storage Blob folder data set mapping property bag. +type BlobFolderMappingProperties struct { + // ContainerName - Container that has the file path. + ContainerName *string `json:"containerName,omitempty"` + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // Prefix - Prefix for blob folder + Prefix *string `json:"prefix,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceGroup - Resource group of storage account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// BlobFolderProperties properties of the blob folder data set. +type BlobFolderProperties struct { + // ContainerName - Container that has the file path. + ContainerName *string `json:"containerName,omitempty"` + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // Prefix - Prefix for blob folder + Prefix *string `json:"prefix,omitempty"` + // ResourceGroup - Resource group of storage account + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// BlobMappingProperties azure storage Blob data set mapping property bag. +type BlobMappingProperties struct { + // ContainerName - Container that has the file path. + ContainerName *string `json:"containerName,omitempty"` + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // FilePath - File path within the source data set + FilePath *string `json:"filePath,omitempty"` + // OutputType - File output type. Possible values include: 'Csv', 'Parquet' + OutputType OutputType `json:"outputType,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceGroup - Resource group of storage account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set. + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// BlobProperties properties of the blob data set. +type BlobProperties struct { + // ContainerName - Container that has the file path. + ContainerName *string `json:"containerName,omitempty"` + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // FilePath - File path within the source data set + FilePath *string `json:"filePath,omitempty"` + // ResourceGroup - Resource group of storage account + ResourceGroup *string `json:"resourceGroup,omitempty"` + // StorageAccountName - Storage account name of the source data set + StorageAccountName *string `json:"storageAccountName,omitempty"` + // SubscriptionID - Subscription id of storage account + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// ConsumerInvitation a consumer Invitation data transfer object. +type ConsumerInvitation struct { + autorest.Response `json:"-"` + // ConsumerInvitationProperties - Properties on the account + *ConsumerInvitationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConsumerInvitation. +func (ci ConsumerInvitation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ci.ConsumerInvitationProperties != nil { + objectMap["properties"] = ci.ConsumerInvitationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConsumerInvitation struct. +func (ci *ConsumerInvitation) 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 consumerInvitationProperties ConsumerInvitationProperties + err = json.Unmarshal(*v, &consumerInvitationProperties) + if err != nil { + return err + } + ci.ConsumerInvitationProperties = &consumerInvitationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ci.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ci.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ci.Type = &typeVar + } + } + } + + return nil +} + +// ConsumerInvitationList list response for get InvitationList +type ConsumerInvitationList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]ConsumerInvitation `json:"value,omitempty"` +} + +// ConsumerInvitationListIterator provides access to a complete listing of ConsumerInvitation values. +type ConsumerInvitationListIterator struct { + i int + page ConsumerInvitationListPage +} + +// 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 *ConsumerInvitationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerInvitationListIterator.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 *ConsumerInvitationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConsumerInvitationListIterator) 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 ConsumerInvitationListIterator) Response() ConsumerInvitationList { + 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 ConsumerInvitationListIterator) Value() ConsumerInvitation { + if !iter.page.NotDone() { + return ConsumerInvitation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ConsumerInvitationListIterator type. +func NewConsumerInvitationListIterator(page ConsumerInvitationListPage) ConsumerInvitationListIterator { + return ConsumerInvitationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cil ConsumerInvitationList) IsEmpty() bool { + return cil.Value == nil || len(*cil.Value) == 0 +} + +// consumerInvitationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cil ConsumerInvitationList) consumerInvitationListPreparer(ctx context.Context) (*http.Request, error) { + if cil.NextLink == nil || len(to.String(cil.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cil.NextLink))) +} + +// ConsumerInvitationListPage contains a page of ConsumerInvitation values. +type ConsumerInvitationListPage struct { + fn func(context.Context, ConsumerInvitationList) (ConsumerInvitationList, error) + cil ConsumerInvitationList +} + +// 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 *ConsumerInvitationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerInvitationListPage.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.cil) + if err != nil { + return err + } + page.cil = 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 *ConsumerInvitationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConsumerInvitationListPage) NotDone() bool { + return !page.cil.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConsumerInvitationListPage) Response() ConsumerInvitationList { + return page.cil +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConsumerInvitationListPage) Values() []ConsumerInvitation { + if page.cil.IsEmpty() { + return nil + } + return *page.cil.Value +} + +// Creates a new instance of the ConsumerInvitationListPage type. +func NewConsumerInvitationListPage(getNextPage func(context.Context, ConsumerInvitationList) (ConsumerInvitationList, error)) ConsumerInvitationListPage { + return ConsumerInvitationListPage{fn: getNextPage} +} + +// ConsumerInvitationProperties properties of consumer invitation +type ConsumerInvitationProperties struct { + // DataSetCount - READ-ONLY; Number of data sets in a share + DataSetCount *int32 `json:"dataSetCount,omitempty"` + // Description - READ-ONLY; Description shared when the invitation was created + Description *string `json:"description,omitempty"` + // InvitationID - Unique id of the invitation. + InvitationID *string `json:"invitationId,omitempty"` + // InvitationStatus - READ-ONLY; The status of the invitation. Possible values include: 'Pending', 'Accepted', 'Rejected', 'Withdrawn' + InvitationStatus InvitationStatus `json:"invitationStatus,omitempty"` + // Location - READ-ONLY; invitation location + Location *string `json:"location,omitempty"` + // ProviderEmail - READ-ONLY; Email of the provider who created the resource + ProviderEmail *string `json:"providerEmail,omitempty"` + // ProviderName - READ-ONLY; Name of the provider who created the resource + ProviderName *string `json:"providerName,omitempty"` + // ProviderTenantName - READ-ONLY; Tenant name of the provider who created the resource + ProviderTenantName *string `json:"providerTenantName,omitempty"` + // RespondedAt - READ-ONLY; The time the recipient responded to the invitation. + RespondedAt *date.Time `json:"respondedAt,omitempty"` + // SentAt - READ-ONLY; Gets the time at which the invitation was sent. + SentAt *date.Time `json:"sentAt,omitempty"` + // ShareName - READ-ONLY; Gets the source share Name. + ShareName *string `json:"shareName,omitempty"` + // TermsOfUse - READ-ONLY; Terms of use shared when the invitation was created + TermsOfUse *string `json:"termsOfUse,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` +} + +// ConsumerSourceDataSet a consumer side dataSet data transfer object. +type ConsumerSourceDataSet struct { + // ConsumerSourceDataSetProperties - source dataSet properties + *ConsumerSourceDataSetProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConsumerSourceDataSet. +func (csds ConsumerSourceDataSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csds.ConsumerSourceDataSetProperties != nil { + objectMap["properties"] = csds.ConsumerSourceDataSetProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ConsumerSourceDataSet struct. +func (csds *ConsumerSourceDataSet) 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 consumerSourceDataSetProperties ConsumerSourceDataSetProperties + err = json.Unmarshal(*v, &consumerSourceDataSetProperties) + if err != nil { + return err + } + csds.ConsumerSourceDataSetProperties = &consumerSourceDataSetProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + csds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + csds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + csds.Type = &typeVar + } + } + } + + return nil +} + +// ConsumerSourceDataSetList a consumer side list of source dataSets +type ConsumerSourceDataSetList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]ConsumerSourceDataSet `json:"value,omitempty"` +} + +// ConsumerSourceDataSetListIterator provides access to a complete listing of ConsumerSourceDataSet values. +type ConsumerSourceDataSetListIterator struct { + i int + page ConsumerSourceDataSetListPage +} + +// 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 *ConsumerSourceDataSetListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerSourceDataSetListIterator.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 *ConsumerSourceDataSetListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ConsumerSourceDataSetListIterator) 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 ConsumerSourceDataSetListIterator) Response() ConsumerSourceDataSetList { + 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 ConsumerSourceDataSetListIterator) Value() ConsumerSourceDataSet { + if !iter.page.NotDone() { + return ConsumerSourceDataSet{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ConsumerSourceDataSetListIterator type. +func NewConsumerSourceDataSetListIterator(page ConsumerSourceDataSetListPage) ConsumerSourceDataSetListIterator { + return ConsumerSourceDataSetListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (csdsl ConsumerSourceDataSetList) IsEmpty() bool { + return csdsl.Value == nil || len(*csdsl.Value) == 0 +} + +// consumerSourceDataSetListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (csdsl ConsumerSourceDataSetList) consumerSourceDataSetListPreparer(ctx context.Context) (*http.Request, error) { + if csdsl.NextLink == nil || len(to.String(csdsl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(csdsl.NextLink))) +} + +// ConsumerSourceDataSetListPage contains a page of ConsumerSourceDataSet values. +type ConsumerSourceDataSetListPage struct { + fn func(context.Context, ConsumerSourceDataSetList) (ConsumerSourceDataSetList, error) + csdsl ConsumerSourceDataSetList +} + +// 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 *ConsumerSourceDataSetListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ConsumerSourceDataSetListPage.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.csdsl) + if err != nil { + return err + } + page.csdsl = 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 *ConsumerSourceDataSetListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ConsumerSourceDataSetListPage) NotDone() bool { + return !page.csdsl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ConsumerSourceDataSetListPage) Response() ConsumerSourceDataSetList { + return page.csdsl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ConsumerSourceDataSetListPage) Values() []ConsumerSourceDataSet { + if page.csdsl.IsEmpty() { + return nil + } + return *page.csdsl.Value +} + +// Creates a new instance of the ConsumerSourceDataSetListPage type. +func NewConsumerSourceDataSetListPage(getNextPage func(context.Context, ConsumerSourceDataSetList) (ConsumerSourceDataSetList, error)) ConsumerSourceDataSetListPage { + return ConsumerSourceDataSetListPage{fn: getNextPage} +} + +// ConsumerSourceDataSetProperties properties of consumer source dataSet +type ConsumerSourceDataSetProperties struct { + // DataSetID - READ-ONLY; DataSet Id + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetLocation - READ-ONLY; Location of the data set. + DataSetLocation *string `json:"dataSetLocation,omitempty"` + // DataSetName - READ-ONLY; DataSet name + DataSetName *string `json:"dataSetName,omitempty"` + // DataSetPath - READ-ONLY; DataSet path + DataSetPath *string `json:"dataSetPath,omitempty"` + // DataSetType - READ-ONLY; Type of data set. Possible values include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SQLDBTable', 'SQLDWTable' + DataSetType DataSetType `json:"dataSetType,omitempty"` +} + +// BasicDataSet a DataSet data transfer object. +type BasicDataSet interface { + AsBlobDataSet() (*BlobDataSet, bool) + AsBlobFolderDataSet() (*BlobFolderDataSet, bool) + AsBlobContainerDataSet() (*BlobContainerDataSet, bool) + AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) + AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) + AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) + AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) + AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) + AsKustoClusterDataSet() (*KustoClusterDataSet, bool) + AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) + AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) + AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) + AsDataSet() (*DataSet, bool) +} + +// DataSet a DataSet data transfer object. +type DataSet struct { + autorest.Response `json:"-"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +func unmarshalBasicDataSet(body []byte) (BasicDataSet, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindBlob): + var bds BlobDataSet + err := json.Unmarshal(body, &bds) + return bds, err + case string(KindBlobFolder): + var bfds BlobFolderDataSet + err := json.Unmarshal(body, &bfds) + return bfds, err + case string(KindContainer): + var bcds BlobContainerDataSet + err := json.Unmarshal(body, &bcds) + return bcds, err + case string(KindAdlsGen2File): + var ag2fds ADLSGen2FileDataSet + err := json.Unmarshal(body, &ag2fds) + return ag2fds, err + case string(KindAdlsGen2Folder): + var ag2fds ADLSGen2FolderDataSet + err := json.Unmarshal(body, &ag2fds) + return ag2fds, err + case string(KindAdlsGen2FileSystem): + var ag2fsds ADLSGen2FileSystemDataSet + err := json.Unmarshal(body, &ag2fsds) + return ag2fsds, err + case string(KindAdlsGen1Folder): + var ag1fds ADLSGen1FolderDataSet + err := json.Unmarshal(body, &ag1fds) + return ag1fds, err + case string(KindAdlsGen1File): + var ag1fds ADLSGen1FileDataSet + err := json.Unmarshal(body, &ag1fds) + return ag1fds, err + case string(KindKustoCluster): + var kcds KustoClusterDataSet + err := json.Unmarshal(body, &kcds) + return kcds, err + case string(KindKustoDatabase): + var kdds KustoDatabaseDataSet + err := json.Unmarshal(body, &kdds) + return kdds, err + case string(KindSQLDWTable): + var sdtds SQLDWTableDataSet + err := json.Unmarshal(body, &sdtds) + return sdtds, err + case string(KindSQLDBTable): + var sdtds SQLDBTableDataSet + err := json.Unmarshal(body, &sdtds) + return sdtds, err + default: + var ds DataSet + err := json.Unmarshal(body, &ds) + return ds, err + } +} +func unmarshalBasicDataSetArray(body []byte) ([]BasicDataSet, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dsArray := make([]BasicDataSet, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ds, err := unmarshalBasicDataSet(*rawMessage) + if err != nil { + return nil, err + } + dsArray[index] = ds + } + return dsArray, nil +} + +// MarshalJSON is the custom marshaler for DataSet. +func (ds DataSet) MarshalJSON() ([]byte, error) { + ds.Kind = KindDataSet + objectMap := make(map[string]interface{}) + if ds.Kind != "" { + objectMap["kind"] = ds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsDataSet() (*DataSet, bool) { + return &ds, true +} + +// AsBasicDataSet is the BasicDataSet implementation for DataSet. +func (ds DataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &ds, true +} + +// DataSetList list response for get DataSets +type DataSetList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]BasicDataSet `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataSetList struct. +func (dsl *DataSetList) 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 + } + dsl.NextLink = &nextLink + } + case "value": + if v != nil { + value, err := unmarshalBasicDataSetArray(*v) + if err != nil { + return err + } + dsl.Value = &value + } + } + } + + return nil +} + +// DataSetListIterator provides access to a complete listing of DataSet values. +type DataSetListIterator struct { + i int + page DataSetListPage +} + +// 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 *DataSetListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetListIterator.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 *DataSetListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DataSetListIterator) 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 DataSetListIterator) Response() DataSetList { + 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 DataSetListIterator) Value() BasicDataSet { + if !iter.page.NotDone() { + return DataSet{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DataSetListIterator type. +func NewDataSetListIterator(page DataSetListPage) DataSetListIterator { + return DataSetListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dsl DataSetList) IsEmpty() bool { + return dsl.Value == nil || len(*dsl.Value) == 0 +} + +// dataSetListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dsl DataSetList) dataSetListPreparer(ctx context.Context) (*http.Request, error) { + if dsl.NextLink == nil || len(to.String(dsl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dsl.NextLink))) +} + +// DataSetListPage contains a page of BasicDataSet values. +type DataSetListPage struct { + fn func(context.Context, DataSetList) (DataSetList, error) + dsl DataSetList +} + +// 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 *DataSetListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetListPage.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.dsl) + if err != nil { + return err + } + page.dsl = 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 *DataSetListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DataSetListPage) NotDone() bool { + return !page.dsl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DataSetListPage) Response() DataSetList { + return page.dsl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DataSetListPage) Values() []BasicDataSet { + if page.dsl.IsEmpty() { + return nil + } + return *page.dsl.Value +} + +// Creates a new instance of the DataSetListPage type. +func NewDataSetListPage(getNextPage func(context.Context, DataSetList) (DataSetList, error)) DataSetListPage { + return DataSetListPage{fn: getNextPage} +} + +// BasicDataSetMapping a data set mapping data transfer object. +type BasicDataSetMapping interface { + AsBlobDataSetMapping() (*BlobDataSetMapping, bool) + AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) + AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) + AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) + AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) + AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) + AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) + AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) + AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) + AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) + AsDataSetMapping() (*DataSetMapping, bool) +} + +// DataSetMapping a data set mapping data transfer object. +type DataSetMapping struct { + autorest.Response `json:"-"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +func unmarshalBasicDataSetMapping(body []byte) (BasicDataSetMapping, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindBasicDataSetMappingKindBlob): + var bdsm BlobDataSetMapping + err := json.Unmarshal(body, &bdsm) + return bdsm, err + case string(KindBasicDataSetMappingKindBlobFolder): + var bfdsm BlobFolderDataSetMapping + err := json.Unmarshal(body, &bfdsm) + return bfdsm, err + case string(KindBasicDataSetMappingKindContainer): + var bcdsm BlobContainerDataSetMapping + err := json.Unmarshal(body, &bcdsm) + return bcdsm, err + case string(KindBasicDataSetMappingKindAdlsGen2File): + var ag2fdsm ADLSGen2FileDataSetMapping + err := json.Unmarshal(body, &ag2fdsm) + return ag2fdsm, err + case string(KindBasicDataSetMappingKindAdlsGen2Folder): + var ag2fdsm ADLSGen2FolderDataSetMapping + err := json.Unmarshal(body, &ag2fdsm) + return ag2fdsm, err + case string(KindBasicDataSetMappingKindAdlsGen2FileSystem): + var ag2fsdsm ADLSGen2FileSystemDataSetMapping + err := json.Unmarshal(body, &ag2fsdsm) + return ag2fsdsm, err + case string(KindBasicDataSetMappingKindKustoCluster): + var kcdsm KustoClusterDataSetMapping + err := json.Unmarshal(body, &kcdsm) + return kcdsm, err + case string(KindBasicDataSetMappingKindKustoDatabase): + var kddsm KustoDatabaseDataSetMapping + err := json.Unmarshal(body, &kddsm) + return kddsm, err + case string(KindBasicDataSetMappingKindSQLDWTable): + var sdtdsm SQLDWTableDataSetMapping + err := json.Unmarshal(body, &sdtdsm) + return sdtdsm, err + case string(KindBasicDataSetMappingKindSQLDBTable): + var sdtdsm SQLDBTableDataSetMapping + err := json.Unmarshal(body, &sdtdsm) + return sdtdsm, err + default: + var dsm DataSetMapping + err := json.Unmarshal(body, &dsm) + return dsm, err + } +} +func unmarshalBasicDataSetMappingArray(body []byte) ([]BasicDataSetMapping, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + dsmArray := make([]BasicDataSetMapping, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dsm, err := unmarshalBasicDataSetMapping(*rawMessage) + if err != nil { + return nil, err + } + dsmArray[index] = dsm + } + return dsmArray, nil +} + +// MarshalJSON is the custom marshaler for DataSetMapping. +func (dsm DataSetMapping) MarshalJSON() ([]byte, error) { + dsm.Kind = KindBasicDataSetMappingKindDataSetMapping + objectMap := make(map[string]interface{}) + if dsm.Kind != "" { + objectMap["kind"] = dsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return &dsm, true +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for DataSetMapping. +func (dsm DataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &dsm, true +} + +// DataSetMappingList list response for get DataSetMappings +type DataSetMappingList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]BasicDataSetMapping `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataSetMappingList struct. +func (dsml *DataSetMappingList) 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 + } + dsml.NextLink = &nextLink + } + case "value": + if v != nil { + value, err := unmarshalBasicDataSetMappingArray(*v) + if err != nil { + return err + } + dsml.Value = &value + } + } + } + + return nil +} + +// DataSetMappingListIterator provides access to a complete listing of DataSetMapping values. +type DataSetMappingListIterator struct { + i int + page DataSetMappingListPage +} + +// 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 *DataSetMappingListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingListIterator.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 *DataSetMappingListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DataSetMappingListIterator) 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 DataSetMappingListIterator) Response() DataSetMappingList { + 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 DataSetMappingListIterator) Value() BasicDataSetMapping { + if !iter.page.NotDone() { + return DataSetMapping{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DataSetMappingListIterator type. +func NewDataSetMappingListIterator(page DataSetMappingListPage) DataSetMappingListIterator { + return DataSetMappingListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dsml DataSetMappingList) IsEmpty() bool { + return dsml.Value == nil || len(*dsml.Value) == 0 +} + +// dataSetMappingListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dsml DataSetMappingList) dataSetMappingListPreparer(ctx context.Context) (*http.Request, error) { + if dsml.NextLink == nil || len(to.String(dsml.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dsml.NextLink))) +} + +// DataSetMappingListPage contains a page of BasicDataSetMapping values. +type DataSetMappingListPage struct { + fn func(context.Context, DataSetMappingList) (DataSetMappingList, error) + dsml DataSetMappingList +} + +// 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 *DataSetMappingListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSetMappingListPage.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.dsml) + if err != nil { + return err + } + page.dsml = 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 *DataSetMappingListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DataSetMappingListPage) NotDone() bool { + return !page.dsml.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DataSetMappingListPage) Response() DataSetMappingList { + return page.dsml +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DataSetMappingListPage) Values() []BasicDataSetMapping { + if page.dsml.IsEmpty() { + return nil + } + return *page.dsml.Value +} + +// Creates a new instance of the DataSetMappingListPage type. +func NewDataSetMappingListPage(getNextPage func(context.Context, DataSetMappingList) (DataSetMappingList, error)) DataSetMappingListPage { + return DataSetMappingListPage{fn: getNextPage} +} + +// DataSetMappingModel ... +type DataSetMappingModel struct { + autorest.Response `json:"-"` + Value BasicDataSetMapping `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataSetMappingModel struct. +func (dsmm *DataSetMappingModel) UnmarshalJSON(body []byte) error { + dsm, err := unmarshalBasicDataSetMapping(body) + if err != nil { + return err + } + dsmm.Value = dsm + + return nil +} + +// DataSetModel ... +type DataSetModel struct { + autorest.Response `json:"-"` + Value BasicDataSet `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DataSetModel struct. +func (dsm *DataSetModel) UnmarshalJSON(body []byte) error { + ds, err := unmarshalBasicDataSet(body) + if err != nil { + return err + } + dsm.Value = ds + + return nil +} + +// DataSetsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DataSetsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DataSetsDeleteFuture) Result(client DataSetsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.DataSetsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.DataSetsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// DefaultDto base data transfer object implementation for default resources. +type DefaultDto struct { + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Location - Location of the azure resource. + Location *string `json:"location,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Tags - Tags on the azure resource. + Tags map[string]*string `json:"tags"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefaultDto. +func (dd DefaultDto) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dd.Location != nil { + objectMap["location"] = dd.Location + } + if dd.Tags != nil { + objectMap["tags"] = dd.Tags + } + return json.Marshal(objectMap) +} + +// DimensionProperties properties for dimension +type DimensionProperties struct { + // DisplayName - localized display name of the dimension to customer + DisplayName *string `json:"displayName,omitempty"` + // Name - dimension name + Name *string `json:"name,omitempty"` +} + +// Error the data share error model. +type Error struct { + // Error - The data share error body + Error *ErrorInfo `json:"error,omitempty"` +} + +// ErrorInfo the data share error body model. +type ErrorInfo struct { + // Code - Code of the error + Code *string `json:"code,omitempty"` + // Details - Nested details of the error model + Details *[]ErrorInfo `json:"details,omitempty"` + // Message - Message of the error + Message *string `json:"message,omitempty"` + // Target - Target of the error + Target *string `json:"target,omitempty"` +} + +// Identity identity of resource +type Identity struct { + // PrincipalID - READ-ONLY; service principal Id + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; Tenant Id + TenantID *string `json:"tenantId,omitempty"` + // Type - Identity Type. Possible values include: 'SystemAssigned' + Type Type `json:"type,omitempty"` +} + +// Invitation a Invitation data transfer object. +type Invitation struct { + autorest.Response `json:"-"` + // InvitationProperties - Properties on the Invitation + *InvitationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Invitation. +func (i Invitation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.InvitationProperties != nil { + objectMap["properties"] = i.InvitationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Invitation struct. +func (i *Invitation) 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 invitationProperties InvitationProperties + err = json.Unmarshal(*v, &invitationProperties) + if err != nil { + return err + } + i.InvitationProperties = &invitationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + i.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + i.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + i.Type = &typeVar + } + } + } + + return nil +} + +// InvitationList list response for get InvitationList +type InvitationList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]Invitation `json:"value,omitempty"` +} + +// InvitationListIterator provides access to a complete listing of Invitation values. +type InvitationListIterator struct { + i int + page InvitationListPage +} + +// 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 *InvitationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationListIterator.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 *InvitationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter InvitationListIterator) 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 InvitationListIterator) Response() InvitationList { + 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 InvitationListIterator) Value() Invitation { + if !iter.page.NotDone() { + return Invitation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the InvitationListIterator type. +func NewInvitationListIterator(page InvitationListPage) InvitationListIterator { + return InvitationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (il InvitationList) IsEmpty() bool { + return il.Value == nil || len(*il.Value) == 0 +} + +// invitationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (il InvitationList) invitationListPreparer(ctx context.Context) (*http.Request, error) { + if il.NextLink == nil || len(to.String(il.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(il.NextLink))) +} + +// InvitationListPage contains a page of Invitation values. +type InvitationListPage struct { + fn func(context.Context, InvitationList) (InvitationList, error) + il InvitationList +} + +// 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 *InvitationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvitationListPage.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.il) + if err != nil { + return err + } + page.il = 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 *InvitationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page InvitationListPage) NotDone() bool { + return !page.il.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page InvitationListPage) Response() InvitationList { + return page.il +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page InvitationListPage) Values() []Invitation { + if page.il.IsEmpty() { + return nil + } + return *page.il.Value +} + +// Creates a new instance of the InvitationListPage type. +func NewInvitationListPage(getNextPage func(context.Context, InvitationList) (InvitationList, error)) InvitationListPage { + return InvitationListPage{fn: getNextPage} +} + +// InvitationProperties invitation property bag. +type InvitationProperties struct { + // InvitationID - READ-ONLY; unique invitation id + InvitationID *string `json:"invitationId,omitempty"` + // InvitationStatus - READ-ONLY; The status of the invitation. Possible values include: 'Pending', 'Accepted', 'Rejected', 'Withdrawn' + InvitationStatus InvitationStatus `json:"invitationStatus,omitempty"` + // RespondedAt - READ-ONLY; The time the recipient responded to the invitation. + RespondedAt *date.Time `json:"respondedAt,omitempty"` + // SentAt - READ-ONLY; Gets the time at which the invitation was sent. + SentAt *date.Time `json:"sentAt,omitempty"` + // TargetActiveDirectoryID - The target Azure AD Id. Can't be combined with email. + TargetActiveDirectoryID *string `json:"targetActiveDirectoryId,omitempty"` + // TargetEmail - The email the invitation is directed to. + TargetEmail *string `json:"targetEmail,omitempty"` + // TargetObjectID - The target user or application Id that invitation is being sent to. + // Must be specified along TargetActiveDirectoryId. This enables sending + // invitations to specific users or applications in an AD tenant. + TargetObjectID *string `json:"targetObjectId,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` +} + +// KustoClusterDataSet a kusto cluster data set. +type KustoClusterDataSet struct { + // KustoClusterDataSetProperties - Kusto cluster data set properties. + *KustoClusterDataSetProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for KustoClusterDataSet. +func (kcds KustoClusterDataSet) MarshalJSON() ([]byte, error) { + kcds.Kind = KindKustoCluster + objectMap := make(map[string]interface{}) + if kcds.KustoClusterDataSetProperties != nil { + objectMap["properties"] = kcds.KustoClusterDataSetProperties + } + if kcds.Kind != "" { + objectMap["kind"] = kcds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return &kcds, true +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for KustoClusterDataSet. +func (kcds KustoClusterDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &kcds, true +} + +// UnmarshalJSON is the custom unmarshaler for KustoClusterDataSet struct. +func (kcds *KustoClusterDataSet) 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 kustoClusterDataSetProperties KustoClusterDataSetProperties + err = json.Unmarshal(*v, &kustoClusterDataSetProperties) + if err != nil { + return err + } + kcds.KustoClusterDataSetProperties = &kustoClusterDataSetProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kcds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kcds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kcds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kcds.Type = &typeVar + } + } + } + + return nil +} + +// KustoClusterDataSetMapping a Kusto cluster data set mapping +type KustoClusterDataSetMapping struct { + // KustoClusterDataSetMappingProperties - Kusto cluster data set mapping properties. + *KustoClusterDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) MarshalJSON() ([]byte, error) { + kcdsm.Kind = KindBasicDataSetMappingKindKustoCluster + objectMap := make(map[string]interface{}) + if kcdsm.KustoClusterDataSetMappingProperties != nil { + objectMap["properties"] = kcdsm.KustoClusterDataSetMappingProperties + } + if kcdsm.Kind != "" { + objectMap["kind"] = kcdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return &kcdsm, true +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for KustoClusterDataSetMapping. +func (kcdsm KustoClusterDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &kcdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for KustoClusterDataSetMapping struct. +func (kcdsm *KustoClusterDataSetMapping) 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 kustoClusterDataSetMappingProperties KustoClusterDataSetMappingProperties + err = json.Unmarshal(*v, &kustoClusterDataSetMappingProperties) + if err != nil { + return err + } + kcdsm.KustoClusterDataSetMappingProperties = &kustoClusterDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kcdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kcdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kcdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kcdsm.Type = &typeVar + } + } + } + + return nil +} + +// KustoClusterDataSetMappingProperties properties of the Kusto cluster data set mapping +type KustoClusterDataSetMappingProperties struct { + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // KustoClusterResourceID - Resource id of the sink kusto cluster. + KustoClusterResourceID *string `json:"kustoClusterResourceId,omitempty"` + // Location - READ-ONLY; Location of the sink kusto cluster. + Location *string `json:"location,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// KustoClusterDataSetProperties properties of the kusto cluster data set. +type KustoClusterDataSetProperties struct { + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // KustoClusterResourceID - Resource id of the kusto cluster. + KustoClusterResourceID *string `json:"kustoClusterResourceId,omitempty"` + // Location - READ-ONLY; Location of the kusto cluster. + Location *string `json:"location,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the kusto cluster data set. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// KustoDatabaseDataSet a kusto database data set. +type KustoDatabaseDataSet struct { + // KustoDatabaseDataSetProperties - Kusto database data set properties. + *KustoDatabaseDataSetProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) MarshalJSON() ([]byte, error) { + kdds.Kind = KindKustoDatabase + objectMap := make(map[string]interface{}) + if kdds.KustoDatabaseDataSetProperties != nil { + objectMap["properties"] = kdds.KustoDatabaseDataSetProperties + } + if kdds.Kind != "" { + objectMap["kind"] = kdds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return &kdds, true +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for KustoDatabaseDataSet. +func (kdds KustoDatabaseDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &kdds, true +} + +// UnmarshalJSON is the custom unmarshaler for KustoDatabaseDataSet struct. +func (kdds *KustoDatabaseDataSet) 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 kustoDatabaseDataSetProperties KustoDatabaseDataSetProperties + err = json.Unmarshal(*v, &kustoDatabaseDataSetProperties) + if err != nil { + return err + } + kdds.KustoDatabaseDataSetProperties = &kustoDatabaseDataSetProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kdds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kdds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kdds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kdds.Type = &typeVar + } + } + } + + return nil +} + +// KustoDatabaseDataSetMapping a Kusto database data set mapping +type KustoDatabaseDataSetMapping struct { + // KustoDatabaseDataSetMappingProperties - Kusto database data set mapping properties. + *KustoDatabaseDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) MarshalJSON() ([]byte, error) { + kddsm.Kind = KindBasicDataSetMappingKindKustoDatabase + objectMap := make(map[string]interface{}) + if kddsm.KustoDatabaseDataSetMappingProperties != nil { + objectMap["properties"] = kddsm.KustoDatabaseDataSetMappingProperties + } + if kddsm.Kind != "" { + objectMap["kind"] = kddsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return &kddsm, true +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for KustoDatabaseDataSetMapping. +func (kddsm KustoDatabaseDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &kddsm, true +} + +// UnmarshalJSON is the custom unmarshaler for KustoDatabaseDataSetMapping struct. +func (kddsm *KustoDatabaseDataSetMapping) 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 kustoDatabaseDataSetMappingProperties KustoDatabaseDataSetMappingProperties + err = json.Unmarshal(*v, &kustoDatabaseDataSetMappingProperties) + if err != nil { + return err + } + kddsm.KustoDatabaseDataSetMappingProperties = &kustoDatabaseDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kddsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kddsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kddsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kddsm.Type = &typeVar + } + } + } + + return nil +} + +// KustoDatabaseDataSetMappingProperties properties of the Kusto database data set mapping +type KustoDatabaseDataSetMappingProperties struct { + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // KustoClusterResourceID - Resource id of the sink kusto cluster. + KustoClusterResourceID *string `json:"kustoClusterResourceId,omitempty"` + // Location - READ-ONLY; Location of the sink kusto cluster. + Location *string `json:"location,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// KustoDatabaseDataSetProperties properties of the kusto database data set. +type KustoDatabaseDataSetProperties struct { + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // KustoDatabaseResourceID - Resource id of the kusto database. + KustoDatabaseResourceID *string `json:"kustoDatabaseResourceId,omitempty"` + // Location - READ-ONLY; Location of the kusto cluster. + Location *string `json:"location,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the kusto database data set. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// OperationList list response for get operations. +type OperationList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]OperationModel `json:"value,omitempty"` +} + +// OperationListIterator provides access to a complete listing of OperationModel values. +type OperationListIterator struct { + i int + page OperationListPage +} + +// 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 *OperationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListIterator.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 *OperationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListIterator) 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 OperationListIterator) Response() OperationList { + 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 OperationListIterator) Value() OperationModel { + if !iter.page.NotDone() { + return OperationModel{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListIterator type. +func NewOperationListIterator(page OperationListPage) OperationListIterator { + return OperationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ol OperationList) IsEmpty() bool { + return ol.Value == nil || len(*ol.Value) == 0 +} + +// operationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ol OperationList) operationListPreparer(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))) +} + +// OperationListPage contains a page of OperationModel values. +type OperationListPage struct { + fn func(context.Context, OperationList) (OperationList, error) + ol OperationList +} + +// 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 *OperationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListPage.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 *OperationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListPage) NotDone() bool { + return !page.ol.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListPage) Response() OperationList { + return page.ol +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListPage) Values() []OperationModel { + if page.ol.IsEmpty() { + return nil + } + return *page.ol.Value +} + +// Creates a new instance of the OperationListPage type. +func NewOperationListPage(getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage { + return OperationListPage{fn: getNextPage} +} + +// OperationMetaLogSpecification log specifications for operation api +type OperationMetaLogSpecification struct { + // BlobDuration - blob duration of the log + BlobDuration *string `json:"blobDuration,omitempty"` + // DisplayName - localized name of the log category + DisplayName *string `json:"displayName,omitempty"` + // Name - name of the log category + Name *string `json:"name,omitempty"` +} + +// OperationMetaMetricSpecification metric specifications for the operation +type OperationMetaMetricSpecification struct { + // AggregationType - aggregation type of metric + AggregationType *string `json:"aggregationType,omitempty"` + // Dimensions - properties for dimension + Dimensions *[]DimensionProperties `json:"dimensions,omitempty"` + // DisplayDescription - description of the metric + DisplayDescription *string `json:"displayDescription,omitempty"` + // DisplayName - localized name of the metric + DisplayName *string `json:"displayName,omitempty"` + // EnableRegionalMdmAccount - enable regional mdm account + EnableRegionalMdmAccount *string `json:"enableRegionalMdmAccount,omitempty"` + // InternalMetricName - internal metric name + InternalMetricName *string `json:"internalMetricName,omitempty"` + // Name - name of the metric + Name *string `json:"name,omitempty"` + // ResourceIDDimensionNameOverride - dimension name use to replace resource id if specified + ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` + // SupportedAggregationTypes - supported aggregation types + SupportedAggregationTypes *[]string `json:"supportedAggregationTypes,omitempty"` + // SupportedTimeGrainTypes - supported time grain types + SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"` + // Unit - units for the metric + Unit *string `json:"unit,omitempty"` +} + +// OperationMetaPropertyInfo properties on meta info +type OperationMetaPropertyInfo struct { + // ServiceSpecification - meta service specification + ServiceSpecification *OperationMetaServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// OperationMetaServiceSpecification the operation meta service specification +type OperationMetaServiceSpecification struct { + // LogSpecifications - log specifications for the operation + LogSpecifications *[]OperationMetaLogSpecification `json:"logSpecifications,omitempty"` + // MetricSpecifications - metric specifications for the operation + MetricSpecifications *[]OperationMetaMetricSpecification `json:"metricSpecifications,omitempty"` +} + +// OperationModel the response model for get operations +type OperationModel struct { + // Display - Properties on the operation + Display *OperationModelProperties `json:"display,omitempty"` + // Name - Operation name for display purposes + Name *string `json:"name,omitempty"` + // Origin - origin of the operation + Origin *string `json:"origin,omitempty"` + // OperationMetaPropertyInfo - properties for the operation meta info + *OperationMetaPropertyInfo `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationModel. +func (om OperationModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if om.Display != nil { + objectMap["display"] = om.Display + } + if om.Name != nil { + objectMap["name"] = om.Name + } + if om.Origin != nil { + objectMap["origin"] = om.Origin + } + if om.OperationMetaPropertyInfo != nil { + objectMap["properties"] = om.OperationMetaPropertyInfo + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationModel struct. +func (om *OperationModel) 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 "display": + if v != nil { + var display OperationModelProperties + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + om.Display = &display + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + om.Name = &name + } + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + om.Origin = &origin + } + case "properties": + if v != nil { + var operationMetaPropertyInfo OperationMetaPropertyInfo + err = json.Unmarshal(*v, &operationMetaPropertyInfo) + if err != nil { + return err + } + om.OperationMetaPropertyInfo = &operationMetaPropertyInfo + } + } + } + + return nil +} + +// OperationModelProperties properties on operations +type OperationModelProperties struct { + // Description - Description of the operation for display purposes + Description *string `json:"description,omitempty"` + // Operation - Name of the operation for display purposes + Operation *string `json:"operation,omitempty"` + // Provider - Name of the provider for display purposes + Provider *string `json:"provider,omitempty"` + // Resource - Name of the resource type for display purposes + Resource *string `json:"resource,omitempty"` +} + +// OperationResponse response for long running operation +type OperationResponse struct { + autorest.Response `json:"-"` + // EndTime - start time + EndTime *date.Time `json:"endTime,omitempty"` + // Error - The error property when status is failed. + Error *ErrorInfo `json:"error,omitempty"` + // StartTime - start time + StartTime *date.Time `json:"startTime,omitempty"` + // Status - Operation state of the long running operation. Possible values include: 'StatusAccepted', 'StatusInProgress', 'StatusTransientFailure', 'StatusSucceeded', 'StatusFailed', 'StatusCanceled' + Status Status `json:"status,omitempty"` +} + +// ProviderShareSubscription a provider side share subscription data transfer object. +type ProviderShareSubscription struct { + autorest.Response `json:"-"` + // ProviderShareSubscriptionProperties - properties of providerShareSubscription + *ProviderShareSubscriptionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProviderShareSubscription. +func (pss ProviderShareSubscription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pss.ProviderShareSubscriptionProperties != nil { + objectMap["properties"] = pss.ProviderShareSubscriptionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProviderShareSubscription struct. +func (pss *ProviderShareSubscription) 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 providerShareSubscriptionProperties ProviderShareSubscriptionProperties + err = json.Unmarshal(*v, &providerShareSubscriptionProperties) + if err != nil { + return err + } + pss.ProviderShareSubscriptionProperties = &providerShareSubscriptionProperties + } + 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 + } + } + } + + return nil +} + +// ProviderShareSubscriptionList list response for get ShareSubscription. +type ProviderShareSubscriptionList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]ProviderShareSubscription `json:"value,omitempty"` +} + +// ProviderShareSubscriptionListIterator provides access to a complete listing of ProviderShareSubscription +// values. +type ProviderShareSubscriptionListIterator struct { + i int + page ProviderShareSubscriptionListPage +} + +// 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 *ProviderShareSubscriptionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionListIterator.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 *ProviderShareSubscriptionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProviderShareSubscriptionListIterator) 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 ProviderShareSubscriptionListIterator) Response() ProviderShareSubscriptionList { + 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 ProviderShareSubscriptionListIterator) Value() ProviderShareSubscription { + if !iter.page.NotDone() { + return ProviderShareSubscription{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProviderShareSubscriptionListIterator type. +func NewProviderShareSubscriptionListIterator(page ProviderShareSubscriptionListPage) ProviderShareSubscriptionListIterator { + return ProviderShareSubscriptionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pssl ProviderShareSubscriptionList) IsEmpty() bool { + return pssl.Value == nil || len(*pssl.Value) == 0 +} + +// providerShareSubscriptionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pssl ProviderShareSubscriptionList) providerShareSubscriptionListPreparer(ctx context.Context) (*http.Request, error) { + if pssl.NextLink == nil || len(to.String(pssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pssl.NextLink))) +} + +// ProviderShareSubscriptionListPage contains a page of ProviderShareSubscription values. +type ProviderShareSubscriptionListPage struct { + fn func(context.Context, ProviderShareSubscriptionList) (ProviderShareSubscriptionList, error) + pssl ProviderShareSubscriptionList +} + +// 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 *ProviderShareSubscriptionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionListPage.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.pssl) + if err != nil { + return err + } + page.pssl = 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 *ProviderShareSubscriptionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProviderShareSubscriptionListPage) NotDone() bool { + return !page.pssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProviderShareSubscriptionListPage) Response() ProviderShareSubscriptionList { + return page.pssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProviderShareSubscriptionListPage) Values() []ProviderShareSubscription { + if page.pssl.IsEmpty() { + return nil + } + return *page.pssl.Value +} + +// Creates a new instance of the ProviderShareSubscriptionListPage type. +func NewProviderShareSubscriptionListPage(getNextPage func(context.Context, ProviderShareSubscriptionList) (ProviderShareSubscriptionList, error)) ProviderShareSubscriptionListPage { + return ProviderShareSubscriptionListPage{fn: getNextPage} +} + +// ProviderShareSubscriptionProperties provider share subscription properties +type ProviderShareSubscriptionProperties struct { + // ConsumerEmail - READ-ONLY; Email of the consumer who created the share subscription + ConsumerEmail *string `json:"consumerEmail,omitempty"` + // ConsumerName - READ-ONLY; Name of the consumer who created the share subscription + ConsumerName *string `json:"consumerName,omitempty"` + // ConsumerTenantName - READ-ONLY; Tenant name of the consumer who created the share subscription + ConsumerTenantName *string `json:"consumerTenantName,omitempty"` + // CreatedAt - READ-ONLY; created at + CreatedAt *date.Time `json:"createdAt,omitempty"` + // ProviderEmail - READ-ONLY; Email of the provider who created the share + ProviderEmail *string `json:"providerEmail,omitempty"` + // ProviderName - READ-ONLY; Name of the provider who created the share + ProviderName *string `json:"providerName,omitempty"` + // SharedAt - READ-ONLY; Shared at + SharedAt *date.Time `json:"sharedAt,omitempty"` + // ShareSubscriptionObjectID - READ-ONLY; share Subscription Object Id + ShareSubscriptionObjectID *string `json:"shareSubscriptionObjectId,omitempty"` + // ShareSubscriptionStatus - READ-ONLY; Gets the status of share subscription. Possible values include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking' + ShareSubscriptionStatus ShareSubscriptionStatus `json:"shareSubscriptionStatus,omitempty"` +} + +// ProviderShareSubscriptionsRevokeFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ProviderShareSubscriptionsRevokeFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ProviderShareSubscriptionsRevokeFuture) Result(client ProviderShareSubscriptionsClient) (pss ProviderShareSubscription, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsRevokeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.ProviderShareSubscriptionsRevokeFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pss.Response.Response, err = future.GetResult(sender); err == nil && pss.Response.Response.StatusCode != http.StatusNoContent { + pss, err = client.RevokeResponder(pss.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsRevokeFuture", "Result", pss.Response.Response, "Failure responding to request") + } + } + return +} + +// ProxyDto base data transfer object implementation for proxy resources. +type ProxyDto struct { + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// ScheduledSourceShareSynchronizationSettingProperties a Scheduled source synchronization setting data +// transfer object. +type ScheduledSourceShareSynchronizationSettingProperties struct { + // RecurrenceInterval - Recurrence Interval. Possible values include: 'Hour', 'Day' + RecurrenceInterval RecurrenceInterval `json:"recurrenceInterval,omitempty"` + // SynchronizationTime - Synchronization time + SynchronizationTime *date.Time `json:"synchronizationTime,omitempty"` +} + +// ScheduledSourceSynchronizationSetting a type of synchronization setting based on schedule +type ScheduledSourceSynchronizationSetting struct { + // ScheduledSourceShareSynchronizationSettingProperties - Properties of scheduled synchronization + *ScheduledSourceShareSynchronizationSettingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindSourceShareSynchronizationSetting', 'KindScheduleBased' + Kind KindBasicSourceShareSynchronizationSetting `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduledSourceSynchronizationSetting. +func (ssss ScheduledSourceSynchronizationSetting) MarshalJSON() ([]byte, error) { + ssss.Kind = KindScheduleBased + objectMap := make(map[string]interface{}) + if ssss.ScheduledSourceShareSynchronizationSettingProperties != nil { + objectMap["properties"] = ssss.ScheduledSourceShareSynchronizationSettingProperties + } + if ssss.Kind != "" { + objectMap["kind"] = ssss.Kind + } + return json.Marshal(objectMap) +} + +// AsScheduledSourceSynchronizationSetting is the BasicSourceShareSynchronizationSetting implementation for ScheduledSourceSynchronizationSetting. +func (ssss ScheduledSourceSynchronizationSetting) AsScheduledSourceSynchronizationSetting() (*ScheduledSourceSynchronizationSetting, bool) { + return &ssss, true +} + +// AsSourceShareSynchronizationSetting is the BasicSourceShareSynchronizationSetting implementation for ScheduledSourceSynchronizationSetting. +func (ssss ScheduledSourceSynchronizationSetting) AsSourceShareSynchronizationSetting() (*SourceShareSynchronizationSetting, bool) { + return nil, false +} + +// AsBasicSourceShareSynchronizationSetting is the BasicSourceShareSynchronizationSetting implementation for ScheduledSourceSynchronizationSetting. +func (ssss ScheduledSourceSynchronizationSetting) AsBasicSourceShareSynchronizationSetting() (BasicSourceShareSynchronizationSetting, bool) { + return &ssss, true +} + +// UnmarshalJSON is the custom unmarshaler for ScheduledSourceSynchronizationSetting struct. +func (ssss *ScheduledSourceSynchronizationSetting) 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 scheduledSourceShareSynchronizationSettingProperties ScheduledSourceShareSynchronizationSettingProperties + err = json.Unmarshal(*v, &scheduledSourceShareSynchronizationSettingProperties) + if err != nil { + return err + } + ssss.ScheduledSourceShareSynchronizationSettingProperties = &scheduledSourceShareSynchronizationSettingProperties + } + case "kind": + if v != nil { + var kind KindBasicSourceShareSynchronizationSetting + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssss.Kind = kind + } + } + } + + return nil +} + +// ScheduledSynchronizationSetting a type of synchronization setting based on schedule +type ScheduledSynchronizationSetting struct { + // ScheduledSynchronizationSettingProperties - Properties of scheduled synchronization + *ScheduledSynchronizationSettingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindBasicSynchronizationSettingKindSynchronizationSetting', 'KindBasicSynchronizationSettingKindScheduleBased' + Kind KindBasicSynchronizationSetting `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduledSynchronizationSetting. +func (sss ScheduledSynchronizationSetting) MarshalJSON() ([]byte, error) { + sss.Kind = KindBasicSynchronizationSettingKindScheduleBased + objectMap := make(map[string]interface{}) + if sss.ScheduledSynchronizationSettingProperties != nil { + objectMap["properties"] = sss.ScheduledSynchronizationSettingProperties + } + if sss.Kind != "" { + objectMap["kind"] = sss.Kind + } + return json.Marshal(objectMap) +} + +// AsScheduledSynchronizationSetting is the BasicSynchronizationSetting implementation for ScheduledSynchronizationSetting. +func (sss ScheduledSynchronizationSetting) AsScheduledSynchronizationSetting() (*ScheduledSynchronizationSetting, bool) { + return &sss, true +} + +// AsSynchronizationSetting is the BasicSynchronizationSetting implementation for ScheduledSynchronizationSetting. +func (sss ScheduledSynchronizationSetting) AsSynchronizationSetting() (*SynchronizationSetting, bool) { + return nil, false +} + +// AsBasicSynchronizationSetting is the BasicSynchronizationSetting implementation for ScheduledSynchronizationSetting. +func (sss ScheduledSynchronizationSetting) AsBasicSynchronizationSetting() (BasicSynchronizationSetting, bool) { + return &sss, true +} + +// UnmarshalJSON is the custom unmarshaler for ScheduledSynchronizationSetting struct. +func (sss *ScheduledSynchronizationSetting) 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 scheduledSynchronizationSettingProperties ScheduledSynchronizationSettingProperties + err = json.Unmarshal(*v, &scheduledSynchronizationSettingProperties) + if err != nil { + return err + } + sss.ScheduledSynchronizationSettingProperties = &scheduledSynchronizationSettingProperties + } + case "kind": + if v != nil { + var kind KindBasicSynchronizationSetting + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sss.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sss.Type = &typeVar + } + } + } + + return nil +} + +// ScheduledSynchronizationSettingProperties a Scheduled synchronization setting data transfer object. +type ScheduledSynchronizationSettingProperties struct { + // CreatedAt - READ-ONLY; Time at which the synchronization setting was created. + CreatedAt *date.Time `json:"createdAt,omitempty"` + // ProvisioningState - READ-ONLY; Gets or sets the provisioning state. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // RecurrenceInterval - Recurrence Interval. Possible values include: 'Hour', 'Day' + RecurrenceInterval RecurrenceInterval `json:"recurrenceInterval,omitempty"` + // SynchronizationTime - Synchronization time + SynchronizationTime *date.Time `json:"synchronizationTime,omitempty"` + // UserName - READ-ONLY; Name of the user who created the synchronization setting. + UserName *string `json:"userName,omitempty"` +} + +// ScheduledTrigger a type of trigger based on schedule +type ScheduledTrigger struct { + // ScheduledTriggerProperties - Properties of scheduled synchronization + *ScheduledTriggerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindBasicTriggerKindTrigger', 'KindBasicTriggerKindScheduleBased' + Kind KindBasicTrigger `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduledTrigger. +func (st ScheduledTrigger) MarshalJSON() ([]byte, error) { + st.Kind = KindBasicTriggerKindScheduleBased + objectMap := make(map[string]interface{}) + if st.ScheduledTriggerProperties != nil { + objectMap["properties"] = st.ScheduledTriggerProperties + } + if st.Kind != "" { + objectMap["kind"] = st.Kind + } + return json.Marshal(objectMap) +} + +// AsScheduledTrigger is the BasicTrigger implementation for ScheduledTrigger. +func (st ScheduledTrigger) AsScheduledTrigger() (*ScheduledTrigger, bool) { + return &st, true +} + +// AsTrigger is the BasicTrigger implementation for ScheduledTrigger. +func (st ScheduledTrigger) AsTrigger() (*Trigger, bool) { + return nil, false +} + +// AsBasicTrigger is the BasicTrigger implementation for ScheduledTrigger. +func (st ScheduledTrigger) AsBasicTrigger() (BasicTrigger, bool) { + return &st, true +} + +// UnmarshalJSON is the custom unmarshaler for ScheduledTrigger struct. +func (st *ScheduledTrigger) 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 scheduledTriggerProperties ScheduledTriggerProperties + err = json.Unmarshal(*v, &scheduledTriggerProperties) + if err != nil { + return err + } + st.ScheduledTriggerProperties = &scheduledTriggerProperties + } + case "kind": + if v != nil { + var kind KindBasicTrigger + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + st.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + st.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + st.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + st.Type = &typeVar + } + } + } + + return nil +} + +// ScheduledTriggerProperties a Scheduled trigger data transfer object. +type ScheduledTriggerProperties struct { + // CreatedAt - READ-ONLY; Time at which the trigger was created. + CreatedAt *date.Time `json:"createdAt,omitempty"` + // ProvisioningState - READ-ONLY; Gets the provisioning state. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // RecurrenceInterval - Recurrence Interval. Possible values include: 'Hour', 'Day' + RecurrenceInterval RecurrenceInterval `json:"recurrenceInterval,omitempty"` + // SynchronizationMode - Synchronization mode. Possible values include: 'Incremental', 'FullSync' + SynchronizationMode SynchronizationMode `json:"synchronizationMode,omitempty"` + // SynchronizationTime - Synchronization time + SynchronizationTime *date.Time `json:"synchronizationTime,omitempty"` + // TriggerStatus - READ-ONLY; Gets the trigger state. Possible values include: 'TriggerStatusActive', 'TriggerStatusInactive', 'TriggerStatusSourceSynchronizationSettingDeleted' + TriggerStatus TriggerStatus `json:"triggerStatus,omitempty"` + // UserName - READ-ONLY; Name of the user who created the trigger. + UserName *string `json:"userName,omitempty"` +} + +// Share a share data transfer object. +type Share struct { + autorest.Response `json:"-"` + // ShareProperties - Properties on the share + *ShareProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Share. +func (s Share) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ShareProperties != nil { + objectMap["properties"] = s.ShareProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Share struct. +func (s *Share) 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 shareProperties ShareProperties + err = json.Unmarshal(*v, &shareProperties) + if err != nil { + return err + } + s.ShareProperties = &shareProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + } + } + + return nil +} + +// ShareList list response for get Shares. +type ShareList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]Share `json:"value,omitempty"` +} + +// ShareListIterator provides access to a complete listing of Share values. +type ShareListIterator struct { + i int + page ShareListPage +} + +// 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 *ShareListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareListIterator.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 *ShareListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ShareListIterator) 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 ShareListIterator) Response() ShareList { + 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 ShareListIterator) Value() Share { + if !iter.page.NotDone() { + return Share{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ShareListIterator type. +func NewShareListIterator(page ShareListPage) ShareListIterator { + return ShareListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sl ShareList) IsEmpty() bool { + return sl.Value == nil || len(*sl.Value) == 0 +} + +// shareListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sl ShareList) shareListPreparer(ctx context.Context) (*http.Request, error) { + if sl.NextLink == nil || len(to.String(sl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sl.NextLink))) +} + +// ShareListPage contains a page of Share values. +type ShareListPage struct { + fn func(context.Context, ShareList) (ShareList, error) + sl ShareList +} + +// 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 *ShareListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareListPage.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.sl) + if err != nil { + return err + } + page.sl = 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 *ShareListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ShareListPage) NotDone() bool { + return !page.sl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ShareListPage) Response() ShareList { + return page.sl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ShareListPage) Values() []Share { + if page.sl.IsEmpty() { + return nil + } + return *page.sl.Value +} + +// Creates a new instance of the ShareListPage type. +func NewShareListPage(getNextPage func(context.Context, ShareList) (ShareList, error)) ShareListPage { + return ShareListPage{fn: getNextPage} +} + +// ShareProperties share property bag. +type ShareProperties struct { + // CreatedAt - READ-ONLY; Time at which the share was created. + CreatedAt *date.Time `json:"createdAt,omitempty"` + // Description - Share description. + Description *string `json:"description,omitempty"` + // ProvisioningState - READ-ONLY; Gets or sets the provisioning state. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ShareKind - Share kind. Possible values include: 'CopyBased', 'InPlace' + ShareKind ShareKind `json:"shareKind,omitempty"` + // Terms - Share terms. + Terms *string `json:"terms,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` +} + +// SharesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type SharesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SharesDeleteFuture) Result(client SharesClient) (or OperationResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.SharesDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent { + or, err = client.DeleteResponder(or.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesDeleteFuture", "Result", or.Response.Response, "Failure responding to request") + } + } + return +} + +// ShareSubscription a share subscription data transfer object. +type ShareSubscription struct { + autorest.Response `json:"-"` + // ShareSubscriptionProperties - Properties on the share subscription + *ShareSubscriptionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ShareSubscription. +func (ss ShareSubscription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.ShareSubscriptionProperties != nil { + objectMap["properties"] = ss.ShareSubscriptionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ShareSubscription struct. +func (ss *ShareSubscription) 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 shareSubscriptionProperties ShareSubscriptionProperties + err = json.Unmarshal(*v, &shareSubscriptionProperties) + if err != nil { + return err + } + ss.ShareSubscriptionProperties = &shareSubscriptionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ss.Type = &typeVar + } + } + } + + return nil +} + +// ShareSubscriptionList list response for get ShareSubscription. +type ShareSubscriptionList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]ShareSubscription `json:"value,omitempty"` +} + +// ShareSubscriptionListIterator provides access to a complete listing of ShareSubscription values. +type ShareSubscriptionListIterator struct { + i int + page ShareSubscriptionListPage +} + +// 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 *ShareSubscriptionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionListIterator.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 *ShareSubscriptionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ShareSubscriptionListIterator) 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 ShareSubscriptionListIterator) Response() ShareSubscriptionList { + 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 ShareSubscriptionListIterator) Value() ShareSubscription { + if !iter.page.NotDone() { + return ShareSubscription{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ShareSubscriptionListIterator type. +func NewShareSubscriptionListIterator(page ShareSubscriptionListPage) ShareSubscriptionListIterator { + return ShareSubscriptionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssl ShareSubscriptionList) IsEmpty() bool { + return ssl.Value == nil || len(*ssl.Value) == 0 +} + +// shareSubscriptionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssl ShareSubscriptionList) shareSubscriptionListPreparer(ctx context.Context) (*http.Request, error) { + if ssl.NextLink == nil || len(to.String(ssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssl.NextLink))) +} + +// ShareSubscriptionListPage contains a page of ShareSubscription values. +type ShareSubscriptionListPage struct { + fn func(context.Context, ShareSubscriptionList) (ShareSubscriptionList, error) + ssl ShareSubscriptionList +} + +// 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 *ShareSubscriptionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionListPage.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.ssl) + if err != nil { + return err + } + page.ssl = 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 *ShareSubscriptionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ShareSubscriptionListPage) NotDone() bool { + return !page.ssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ShareSubscriptionListPage) Response() ShareSubscriptionList { + return page.ssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ShareSubscriptionListPage) Values() []ShareSubscription { + if page.ssl.IsEmpty() { + return nil + } + return *page.ssl.Value +} + +// Creates a new instance of the ShareSubscriptionListPage type. +func NewShareSubscriptionListPage(getNextPage func(context.Context, ShareSubscriptionList) (ShareSubscriptionList, error)) ShareSubscriptionListPage { + return ShareSubscriptionListPage{fn: getNextPage} +} + +// ShareSubscriptionProperties share subscription property bag. +type ShareSubscriptionProperties struct { + // CreatedAt - READ-ONLY; Time at which the share subscription was created. + CreatedAt *date.Time `json:"createdAt,omitempty"` + // InvitationID - The invitation id. + InvitationID *string `json:"invitationId,omitempty"` + // ProviderEmail - READ-ONLY; Email of the provider who created the resource + ProviderEmail *string `json:"providerEmail,omitempty"` + // ProviderName - READ-ONLY; Name of the provider who created the resource + ProviderName *string `json:"providerName,omitempty"` + // ProviderTenantName - READ-ONLY; Tenant name of the provider who created the resource + ProviderTenantName *string `json:"providerTenantName,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the share subscription. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ShareDescription - READ-ONLY; Description of share + ShareDescription *string `json:"shareDescription,omitempty"` + // ShareKind - READ-ONLY; Kind of share. Possible values include: 'CopyBased', 'InPlace' + ShareKind ShareKind `json:"shareKind,omitempty"` + // ShareName - READ-ONLY; Name of the share + ShareName *string `json:"shareName,omitempty"` + // ShareSubscriptionStatus - READ-ONLY; Gets the current status of share subscription. Possible values include: 'Active', 'Revoked', 'SourceDeleted', 'Revoking' + ShareSubscriptionStatus ShareSubscriptionStatus `json:"shareSubscriptionStatus,omitempty"` + // ShareTerms - READ-ONLY; Terms of a share + ShareTerms *string `json:"shareTerms,omitempty"` + // SourceShareLocation - Source share location. + SourceShareLocation *string `json:"sourceShareLocation,omitempty"` + // UserEmail - READ-ONLY; Email of the user who created the resource + UserEmail *string `json:"userEmail,omitempty"` + // UserName - READ-ONLY; Name of the user who created the resource + UserName *string `json:"userName,omitempty"` +} + +// ShareSubscriptionsCancelSynchronizationFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ShareSubscriptionsCancelSynchronizationFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ShareSubscriptionsCancelSynchronizationFuture) Result(client ShareSubscriptionsClient) (sss ShareSubscriptionSynchronization, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsCancelSynchronizationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.ShareSubscriptionsCancelSynchronizationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sss.Response.Response, err = future.GetResult(sender); err == nil && sss.Response.Response.StatusCode != http.StatusNoContent { + sss, err = client.CancelSynchronizationResponder(sss.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsCancelSynchronizationFuture", "Result", sss.Response.Response, "Failure responding to request") + } + } + return +} + +// ShareSubscriptionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ShareSubscriptionsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ShareSubscriptionsDeleteFuture) Result(client ShareSubscriptionsClient) (or OperationResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.ShareSubscriptionsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent { + or, err = client.DeleteResponder(or.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsDeleteFuture", "Result", or.Response.Response, "Failure responding to request") + } + } + return +} + +// ShareSubscriptionsSynchronizeMethodFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ShareSubscriptionsSynchronizeMethodFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ShareSubscriptionsSynchronizeMethodFuture) Result(client ShareSubscriptionsClient) (sss ShareSubscriptionSynchronization, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsSynchronizeMethodFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.ShareSubscriptionsSynchronizeMethodFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sss.Response.Response, err = future.GetResult(sender); err == nil && sss.Response.Response.StatusCode != http.StatusNoContent { + sss, err = client.SynchronizeMethodResponder(sss.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsSynchronizeMethodFuture", "Result", sss.Response.Response, "Failure responding to request") + } + } + return +} + +// ShareSubscriptionSynchronization a ShareSubscriptionSynchronization data transfer object. +type ShareSubscriptionSynchronization struct { + autorest.Response `json:"-"` + // DurationMs - READ-ONLY; Synchronization duration + DurationMs *int32 `json:"durationMs,omitempty"` + // EndTime - READ-ONLY; End time of synchronization + EndTime *date.Time `json:"endTime,omitempty"` + // Message - READ-ONLY; message of Synchronization + Message *string `json:"message,omitempty"` + // StartTime - READ-ONLY; start time of synchronization + StartTime *date.Time `json:"startTime,omitempty"` + // Status - READ-ONLY; Raw Status + Status *string `json:"status,omitempty"` + // SynchronizationID - Synchronization id + SynchronizationID *string `json:"synchronizationId,omitempty"` + // SynchronizationMode - READ-ONLY; Synchronization Mode. Possible values include: 'Incremental', 'FullSync' + SynchronizationMode SynchronizationMode `json:"synchronizationMode,omitempty"` +} + +// ShareSubscriptionSynchronizationList a consumer side list of share subscription synchronizations +type ShareSubscriptionSynchronizationList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]ShareSubscriptionSynchronization `json:"value,omitempty"` +} + +// ShareSubscriptionSynchronizationListIterator provides access to a complete listing of +// ShareSubscriptionSynchronization values. +type ShareSubscriptionSynchronizationListIterator struct { + i int + page ShareSubscriptionSynchronizationListPage +} + +// 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 *ShareSubscriptionSynchronizationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionSynchronizationListIterator.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 *ShareSubscriptionSynchronizationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ShareSubscriptionSynchronizationListIterator) 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 ShareSubscriptionSynchronizationListIterator) Response() ShareSubscriptionSynchronizationList { + 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 ShareSubscriptionSynchronizationListIterator) Value() ShareSubscriptionSynchronization { + if !iter.page.NotDone() { + return ShareSubscriptionSynchronization{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ShareSubscriptionSynchronizationListIterator type. +func NewShareSubscriptionSynchronizationListIterator(page ShareSubscriptionSynchronizationListPage) ShareSubscriptionSynchronizationListIterator { + return ShareSubscriptionSynchronizationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sssl ShareSubscriptionSynchronizationList) IsEmpty() bool { + return sssl.Value == nil || len(*sssl.Value) == 0 +} + +// shareSubscriptionSynchronizationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sssl ShareSubscriptionSynchronizationList) shareSubscriptionSynchronizationListPreparer(ctx context.Context) (*http.Request, error) { + if sssl.NextLink == nil || len(to.String(sssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sssl.NextLink))) +} + +// ShareSubscriptionSynchronizationListPage contains a page of ShareSubscriptionSynchronization values. +type ShareSubscriptionSynchronizationListPage struct { + fn func(context.Context, ShareSubscriptionSynchronizationList) (ShareSubscriptionSynchronizationList, error) + sssl ShareSubscriptionSynchronizationList +} + +// 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 *ShareSubscriptionSynchronizationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionSynchronizationListPage.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.sssl) + if err != nil { + return err + } + page.sssl = 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 *ShareSubscriptionSynchronizationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ShareSubscriptionSynchronizationListPage) NotDone() bool { + return !page.sssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ShareSubscriptionSynchronizationListPage) Response() ShareSubscriptionSynchronizationList { + return page.sssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ShareSubscriptionSynchronizationListPage) Values() []ShareSubscriptionSynchronization { + if page.sssl.IsEmpty() { + return nil + } + return *page.sssl.Value +} + +// Creates a new instance of the ShareSubscriptionSynchronizationListPage type. +func NewShareSubscriptionSynchronizationListPage(getNextPage func(context.Context, ShareSubscriptionSynchronizationList) (ShareSubscriptionSynchronizationList, error)) ShareSubscriptionSynchronizationListPage { + return ShareSubscriptionSynchronizationListPage{fn: getNextPage} +} + +// ShareSynchronization a ShareSynchronization data transfer object. +type ShareSynchronization struct { + // ConsumerEmail - Email of the user who created the synchronization + ConsumerEmail *string `json:"consumerEmail,omitempty"` + // ConsumerName - Name of the user who created the synchronization + ConsumerName *string `json:"consumerName,omitempty"` + // ConsumerTenantName - Tenant name of the consumer who created the synchronization + ConsumerTenantName *string `json:"consumerTenantName,omitempty"` + // DurationMs - synchronization duration + DurationMs *int32 `json:"durationMs,omitempty"` + // EndTime - End time of synchronization + EndTime *date.Time `json:"endTime,omitempty"` + // Message - message of synchronization + Message *string `json:"message,omitempty"` + // StartTime - start time of synchronization + StartTime *date.Time `json:"startTime,omitempty"` + // Status - Raw Status + Status *string `json:"status,omitempty"` + // SynchronizationID - Synchronization id + SynchronizationID *string `json:"synchronizationId,omitempty"` + // SynchronizationMode - READ-ONLY; Synchronization mode. Possible values include: 'Incremental', 'FullSync' + SynchronizationMode SynchronizationMode `json:"synchronizationMode,omitempty"` +} + +// ShareSynchronizationList list response for get ShareSynchronization. +type ShareSynchronizationList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]ShareSynchronization `json:"value,omitempty"` +} + +// ShareSynchronizationListIterator provides access to a complete listing of ShareSynchronization values. +type ShareSynchronizationListIterator struct { + i int + page ShareSynchronizationListPage +} + +// 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 *ShareSynchronizationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSynchronizationListIterator.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 *ShareSynchronizationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ShareSynchronizationListIterator) 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 ShareSynchronizationListIterator) Response() ShareSynchronizationList { + 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 ShareSynchronizationListIterator) Value() ShareSynchronization { + if !iter.page.NotDone() { + return ShareSynchronization{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ShareSynchronizationListIterator type. +func NewShareSynchronizationListIterator(page ShareSynchronizationListPage) ShareSynchronizationListIterator { + return ShareSynchronizationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssl ShareSynchronizationList) IsEmpty() bool { + return ssl.Value == nil || len(*ssl.Value) == 0 +} + +// shareSynchronizationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssl ShareSynchronizationList) shareSynchronizationListPreparer(ctx context.Context) (*http.Request, error) { + if ssl.NextLink == nil || len(to.String(ssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssl.NextLink))) +} + +// ShareSynchronizationListPage contains a page of ShareSynchronization values. +type ShareSynchronizationListPage struct { + fn func(context.Context, ShareSynchronizationList) (ShareSynchronizationList, error) + ssl ShareSynchronizationList +} + +// 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 *ShareSynchronizationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSynchronizationListPage.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.ssl) + if err != nil { + return err + } + page.ssl = 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 *ShareSynchronizationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ShareSynchronizationListPage) NotDone() bool { + return !page.ssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ShareSynchronizationListPage) Response() ShareSynchronizationList { + return page.ssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ShareSynchronizationListPage) Values() []ShareSynchronization { + if page.ssl.IsEmpty() { + return nil + } + return *page.ssl.Value +} + +// Creates a new instance of the ShareSynchronizationListPage type. +func NewShareSynchronizationListPage(getNextPage func(context.Context, ShareSynchronizationList) (ShareSynchronizationList, error)) ShareSynchronizationListPage { + return ShareSynchronizationListPage{fn: getNextPage} +} + +// BasicSourceShareSynchronizationSetting a view of synchronization setting added by the provider +type BasicSourceShareSynchronizationSetting interface { + AsScheduledSourceSynchronizationSetting() (*ScheduledSourceSynchronizationSetting, bool) + AsSourceShareSynchronizationSetting() (*SourceShareSynchronizationSetting, bool) +} + +// SourceShareSynchronizationSetting a view of synchronization setting added by the provider +type SourceShareSynchronizationSetting struct { + // Kind - Possible values include: 'KindSourceShareSynchronizationSetting', 'KindScheduleBased' + Kind KindBasicSourceShareSynchronizationSetting `json:"kind,omitempty"` +} + +func unmarshalBasicSourceShareSynchronizationSetting(body []byte) (BasicSourceShareSynchronizationSetting, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindScheduleBased): + var ssss ScheduledSourceSynchronizationSetting + err := json.Unmarshal(body, &ssss) + return ssss, err + default: + var ssss SourceShareSynchronizationSetting + err := json.Unmarshal(body, &ssss) + return ssss, err + } +} +func unmarshalBasicSourceShareSynchronizationSettingArray(body []byte) ([]BasicSourceShareSynchronizationSetting, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ssssArray := make([]BasicSourceShareSynchronizationSetting, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ssss, err := unmarshalBasicSourceShareSynchronizationSetting(*rawMessage) + if err != nil { + return nil, err + } + ssssArray[index] = ssss + } + return ssssArray, nil +} + +// MarshalJSON is the custom marshaler for SourceShareSynchronizationSetting. +func (ssss SourceShareSynchronizationSetting) MarshalJSON() ([]byte, error) { + ssss.Kind = KindSourceShareSynchronizationSetting + objectMap := make(map[string]interface{}) + if ssss.Kind != "" { + objectMap["kind"] = ssss.Kind + } + return json.Marshal(objectMap) +} + +// AsScheduledSourceSynchronizationSetting is the BasicSourceShareSynchronizationSetting implementation for SourceShareSynchronizationSetting. +func (ssss SourceShareSynchronizationSetting) AsScheduledSourceSynchronizationSetting() (*ScheduledSourceSynchronizationSetting, bool) { + return nil, false +} + +// AsSourceShareSynchronizationSetting is the BasicSourceShareSynchronizationSetting implementation for SourceShareSynchronizationSetting. +func (ssss SourceShareSynchronizationSetting) AsSourceShareSynchronizationSetting() (*SourceShareSynchronizationSetting, bool) { + return &ssss, true +} + +// AsBasicSourceShareSynchronizationSetting is the BasicSourceShareSynchronizationSetting implementation for SourceShareSynchronizationSetting. +func (ssss SourceShareSynchronizationSetting) AsBasicSourceShareSynchronizationSetting() (BasicSourceShareSynchronizationSetting, bool) { + return &ssss, true +} + +// SourceShareSynchronizationSettingList list response for get source share Synchronization settings +type SourceShareSynchronizationSettingList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]BasicSourceShareSynchronizationSetting `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SourceShareSynchronizationSettingList struct. +func (ssssl *SourceShareSynchronizationSettingList) 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 + } + ssssl.NextLink = &nextLink + } + case "value": + if v != nil { + value, err := unmarshalBasicSourceShareSynchronizationSettingArray(*v) + if err != nil { + return err + } + ssssl.Value = &value + } + } + } + + return nil +} + +// SourceShareSynchronizationSettingListIterator provides access to a complete listing of +// SourceShareSynchronizationSetting values. +type SourceShareSynchronizationSettingListIterator struct { + i int + page SourceShareSynchronizationSettingListPage +} + +// 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 *SourceShareSynchronizationSettingListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceShareSynchronizationSettingListIterator.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 *SourceShareSynchronizationSettingListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SourceShareSynchronizationSettingListIterator) 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 SourceShareSynchronizationSettingListIterator) Response() SourceShareSynchronizationSettingList { + 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 SourceShareSynchronizationSettingListIterator) Value() BasicSourceShareSynchronizationSetting { + if !iter.page.NotDone() { + return SourceShareSynchronizationSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SourceShareSynchronizationSettingListIterator type. +func NewSourceShareSynchronizationSettingListIterator(page SourceShareSynchronizationSettingListPage) SourceShareSynchronizationSettingListIterator { + return SourceShareSynchronizationSettingListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssssl SourceShareSynchronizationSettingList) IsEmpty() bool { + return ssssl.Value == nil || len(*ssssl.Value) == 0 +} + +// sourceShareSynchronizationSettingListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssssl SourceShareSynchronizationSettingList) sourceShareSynchronizationSettingListPreparer(ctx context.Context) (*http.Request, error) { + if ssssl.NextLink == nil || len(to.String(ssssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssssl.NextLink))) +} + +// SourceShareSynchronizationSettingListPage contains a page of BasicSourceShareSynchronizationSetting +// values. +type SourceShareSynchronizationSettingListPage struct { + fn func(context.Context, SourceShareSynchronizationSettingList) (SourceShareSynchronizationSettingList, error) + ssssl SourceShareSynchronizationSettingList +} + +// 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 *SourceShareSynchronizationSettingListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceShareSynchronizationSettingListPage.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.ssssl) + if err != nil { + return err + } + page.ssssl = 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 *SourceShareSynchronizationSettingListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceShareSynchronizationSettingListPage) NotDone() bool { + return !page.ssssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceShareSynchronizationSettingListPage) Response() SourceShareSynchronizationSettingList { + return page.ssssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceShareSynchronizationSettingListPage) Values() []BasicSourceShareSynchronizationSetting { + if page.ssssl.IsEmpty() { + return nil + } + return *page.ssssl.Value +} + +// Creates a new instance of the SourceShareSynchronizationSettingListPage type. +func NewSourceShareSynchronizationSettingListPage(getNextPage func(context.Context, SourceShareSynchronizationSettingList) (SourceShareSynchronizationSettingList, error)) SourceShareSynchronizationSettingListPage { + return SourceShareSynchronizationSettingListPage{fn: getNextPage} +} + +// SQLDBTableDataSet a SQL DB table data set. +type SQLDBTableDataSet struct { + // SQLDBTableProperties - SQL DB table data set properties. + *SQLDBTableProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) MarshalJSON() ([]byte, error) { + sdtds.Kind = KindSQLDBTable + objectMap := make(map[string]interface{}) + if sdtds.SQLDBTableProperties != nil { + objectMap["properties"] = sdtds.SQLDBTableProperties + } + if sdtds.Kind != "" { + objectMap["kind"] = sdtds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return nil, false +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return &sdtds, true +} + +// AsDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for SQLDBTableDataSet. +func (sdtds SQLDBTableDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &sdtds, true +} + +// UnmarshalJSON is the custom unmarshaler for SQLDBTableDataSet struct. +func (sdtds *SQLDBTableDataSet) 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 sQLDBTableProperties SQLDBTableProperties + err = json.Unmarshal(*v, &sQLDBTableProperties) + if err != nil { + return err + } + sdtds.SQLDBTableProperties = &sQLDBTableProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sdtds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sdtds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sdtds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sdtds.Type = &typeVar + } + } + } + + return nil +} + +// SQLDBTableDataSetMapping a SQL DB Table data set mapping. +type SQLDBTableDataSetMapping struct { + // SQLDBTableDataSetMappingProperties - Sql DB data set mapping properties. + *SQLDBTableDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) MarshalJSON() ([]byte, error) { + sdtdsm.Kind = KindBasicDataSetMappingKindSQLDBTable + objectMap := make(map[string]interface{}) + if sdtdsm.SQLDBTableDataSetMappingProperties != nil { + objectMap["properties"] = sdtdsm.SQLDBTableDataSetMappingProperties + } + if sdtdsm.Kind != "" { + objectMap["kind"] = sdtdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return nil, false +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return &sdtdsm, true +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for SQLDBTableDataSetMapping. +func (sdtdsm SQLDBTableDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &sdtdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for SQLDBTableDataSetMapping struct. +func (sdtdsm *SQLDBTableDataSetMapping) 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 sQLDBTableDataSetMappingProperties SQLDBTableDataSetMappingProperties + err = json.Unmarshal(*v, &sQLDBTableDataSetMappingProperties) + if err != nil { + return err + } + sdtdsm.SQLDBTableDataSetMappingProperties = &sQLDBTableDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sdtdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sdtdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sdtdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sdtdsm.Type = &typeVar + } + } + } + + return nil +} + +// SQLDBTableDataSetMappingProperties properties of the SQL DB table data set mapping. +type SQLDBTableDataSetMappingProperties struct { + // DatabaseName - DatabaseName name of the sink data set + DatabaseName *string `json:"databaseName,omitempty"` + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // SchemaName - Schema of the table. Default value is dbo. + SchemaName *string `json:"schemaName,omitempty"` + // SQLServerResourceID - Resource id of SQL server + SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"` + // TableName - SQL DB table name. + TableName *string `json:"tableName,omitempty"` +} + +// SQLDBTableProperties properties of the SQL DB table data set. +type SQLDBTableProperties struct { + // DatabaseName - Database name of the source data set + DatabaseName *string `json:"databaseName,omitempty"` + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // SchemaName - Schema of the table. Default value is dbo. + SchemaName *string `json:"schemaName,omitempty"` + // SQLServerResourceID - Resource id of SQL server + SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"` + // TableName - SQL DB table name. + TableName *string `json:"tableName,omitempty"` +} + +// SQLDWTableDataSet a SQL DW table data set. +type SQLDWTableDataSet struct { + // SQLDWTableProperties - SQL DW table data set properties. + *SQLDWTableProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindDataSet', 'KindBlob', 'KindBlobFolder', 'KindContainer', 'KindAdlsGen2File', 'KindAdlsGen2Folder', 'KindAdlsGen2FileSystem', 'KindAdlsGen1Folder', 'KindAdlsGen1File', 'KindKustoCluster', 'KindKustoDatabase', 'KindSQLDWTable', 'KindSQLDBTable' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) MarshalJSON() ([]byte, error) { + sdtds.Kind = KindSQLDWTable + objectMap := make(map[string]interface{}) + if sdtds.SQLDWTableProperties != nil { + objectMap["properties"] = sdtds.SQLDWTableProperties + } + if sdtds.Kind != "" { + objectMap["kind"] = sdtds.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsBlobDataSet() (*BlobDataSet, bool) { + return nil, false +} + +// AsBlobFolderDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsBlobFolderDataSet() (*BlobFolderDataSet, bool) { + return nil, false +} + +// AsBlobContainerDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsBlobContainerDataSet() (*BlobContainerDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsADLSGen2FileDataSet() (*ADLSGen2FileDataSet, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsADLSGen2FolderDataSet() (*ADLSGen2FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsADLSGen2FileSystemDataSet() (*ADLSGen2FileSystemDataSet, bool) { + return nil, false +} + +// AsADLSGen1FolderDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsADLSGen1FolderDataSet() (*ADLSGen1FolderDataSet, bool) { + return nil, false +} + +// AsADLSGen1FileDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsADLSGen1FileDataSet() (*ADLSGen1FileDataSet, bool) { + return nil, false +} + +// AsKustoClusterDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsKustoClusterDataSet() (*KustoClusterDataSet, bool) { + return nil, false +} + +// AsKustoDatabaseDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsKustoDatabaseDataSet() (*KustoDatabaseDataSet, bool) { + return nil, false +} + +// AsSQLDWTableDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsSQLDWTableDataSet() (*SQLDWTableDataSet, bool) { + return &sdtds, true +} + +// AsSQLDBTableDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsSQLDBTableDataSet() (*SQLDBTableDataSet, bool) { + return nil, false +} + +// AsDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsDataSet() (*DataSet, bool) { + return nil, false +} + +// AsBasicDataSet is the BasicDataSet implementation for SQLDWTableDataSet. +func (sdtds SQLDWTableDataSet) AsBasicDataSet() (BasicDataSet, bool) { + return &sdtds, true +} + +// UnmarshalJSON is the custom unmarshaler for SQLDWTableDataSet struct. +func (sdtds *SQLDWTableDataSet) 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 sQLDWTableProperties SQLDWTableProperties + err = json.Unmarshal(*v, &sQLDWTableProperties) + if err != nil { + return err + } + sdtds.SQLDWTableProperties = &sQLDWTableProperties + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sdtds.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sdtds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sdtds.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sdtds.Type = &typeVar + } + } + } + + return nil +} + +// SQLDWTableDataSetMapping a SQL DW Table data set mapping. +type SQLDWTableDataSetMapping struct { + // SQLDWTableDataSetMappingProperties - Sql DW data set mapping properties. + *SQLDWTableDataSetMappingProperties `json:"properties,omitempty"` + // Kind - Possible values include: 'KindBasicDataSetMappingKindDataSetMapping', 'KindBasicDataSetMappingKindBlob', 'KindBasicDataSetMappingKindBlobFolder', 'KindBasicDataSetMappingKindContainer', 'KindBasicDataSetMappingKindAdlsGen2File', 'KindBasicDataSetMappingKindAdlsGen2Folder', 'KindBasicDataSetMappingKindAdlsGen2FileSystem', 'KindBasicDataSetMappingKindKustoCluster', 'KindBasicDataSetMappingKindKustoDatabase', 'KindBasicDataSetMappingKindSQLDWTable', 'KindBasicDataSetMappingKindSQLDBTable' + Kind KindBasicDataSetMapping `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) MarshalJSON() ([]byte, error) { + sdtdsm.Kind = KindBasicDataSetMappingKindSQLDWTable + objectMap := make(map[string]interface{}) + if sdtdsm.SQLDWTableDataSetMappingProperties != nil { + objectMap["properties"] = sdtdsm.SQLDWTableDataSetMappingProperties + } + if sdtdsm.Kind != "" { + objectMap["kind"] = sdtdsm.Kind + } + return json.Marshal(objectMap) +} + +// AsBlobDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsBlobDataSetMapping() (*BlobDataSetMapping, bool) { + return nil, false +} + +// AsBlobFolderDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsBlobFolderDataSetMapping() (*BlobFolderDataSetMapping, bool) { + return nil, false +} + +// AsBlobContainerDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsBlobContainerDataSetMapping() (*BlobContainerDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsADLSGen2FileDataSetMapping() (*ADLSGen2FileDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FolderDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsADLSGen2FolderDataSetMapping() (*ADLSGen2FolderDataSetMapping, bool) { + return nil, false +} + +// AsADLSGen2FileSystemDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsADLSGen2FileSystemDataSetMapping() (*ADLSGen2FileSystemDataSetMapping, bool) { + return nil, false +} + +// AsKustoClusterDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsKustoClusterDataSetMapping() (*KustoClusterDataSetMapping, bool) { + return nil, false +} + +// AsKustoDatabaseDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsKustoDatabaseDataSetMapping() (*KustoDatabaseDataSetMapping, bool) { + return nil, false +} + +// AsSQLDWTableDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsSQLDWTableDataSetMapping() (*SQLDWTableDataSetMapping, bool) { + return &sdtdsm, true +} + +// AsSQLDBTableDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsSQLDBTableDataSetMapping() (*SQLDBTableDataSetMapping, bool) { + return nil, false +} + +// AsDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsDataSetMapping() (*DataSetMapping, bool) { + return nil, false +} + +// AsBasicDataSetMapping is the BasicDataSetMapping implementation for SQLDWTableDataSetMapping. +func (sdtdsm SQLDWTableDataSetMapping) AsBasicDataSetMapping() (BasicDataSetMapping, bool) { + return &sdtdsm, true +} + +// UnmarshalJSON is the custom unmarshaler for SQLDWTableDataSetMapping struct. +func (sdtdsm *SQLDWTableDataSetMapping) 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 sQLDWTableDataSetMappingProperties SQLDWTableDataSetMappingProperties + err = json.Unmarshal(*v, &sQLDWTableDataSetMappingProperties) + if err != nil { + return err + } + sdtdsm.SQLDWTableDataSetMappingProperties = &sQLDWTableDataSetMappingProperties + } + case "kind": + if v != nil { + var kind KindBasicDataSetMapping + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sdtdsm.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sdtdsm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sdtdsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sdtdsm.Type = &typeVar + } + } + } + + return nil +} + +// SQLDWTableDataSetMappingProperties properties of the SQL DW table data set mapping. +type SQLDWTableDataSetMappingProperties struct { + // DataSetID - The id of the source data set. + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetMappingStatus - READ-ONLY; Gets the status of the data set mapping. Possible values include: 'Ok', 'Broken' + DataSetMappingStatus DataSetMappingStatus `json:"dataSetMappingStatus,omitempty"` + // DataWarehouseName - DataWarehouse name of the source data set + DataWarehouseName *string `json:"dataWarehouseName,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the data set mapping. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Moving', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // SchemaName - Schema of the table. Default value is dbo. + SchemaName *string `json:"schemaName,omitempty"` + // SQLServerResourceID - Resource id of SQL server + SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"` + // TableName - SQL DW table name. + TableName *string `json:"tableName,omitempty"` +} + +// SQLDWTableProperties properties of the SQL DW table data set. +type SQLDWTableProperties struct { + // DataSetID - READ-ONLY; Unique id for identifying a data set resource + DataSetID *string `json:"dataSetId,omitempty"` + // DataWarehouseName - DataWarehouse name of the source data set + DataWarehouseName *string `json:"dataWarehouseName,omitempty"` + // SchemaName - Schema of the table. Default value is dbo. + SchemaName *string `json:"schemaName,omitempty"` + // SQLServerResourceID - Resource id of SQL server + SQLServerResourceID *string `json:"sqlServerResourceId,omitempty"` + // TableName - SQL DW table name. + TableName *string `json:"tableName,omitempty"` +} + +// SynchronizationDetails synchronization details at data set level +type SynchronizationDetails struct { + // DataSetID - READ-ONLY; Id of data set + DataSetID *string `json:"dataSetId,omitempty"` + // DataSetType - READ-ONLY; Type of the data set. Possible values include: 'Blob', 'Container', 'BlobFolder', 'AdlsGen2FileSystem', 'AdlsGen2Folder', 'AdlsGen2File', 'AdlsGen1Folder', 'AdlsGen1File', 'KustoCluster', 'KustoDatabase', 'SQLDBTable', 'SQLDWTable' + DataSetType DataSetType `json:"dataSetType,omitempty"` + // DurationMs - READ-ONLY; Duration of data set level copy + DurationMs *int32 `json:"durationMs,omitempty"` + // EndTime - READ-ONLY; End time of data set level copy + EndTime *date.Time `json:"endTime,omitempty"` + // FilesRead - READ-ONLY; The number of files read from the source data set + FilesRead *int64 `json:"filesRead,omitempty"` + // FilesWritten - READ-ONLY; The number of files written into the sink data set + FilesWritten *int64 `json:"filesWritten,omitempty"` + // Message - READ-ONLY; Error message if any + Message *string `json:"message,omitempty"` + // Name - READ-ONLY; Name of the data set + Name *string `json:"name,omitempty"` + // RowsCopied - READ-ONLY; The number of files copied into the sink data set + RowsCopied *int64 `json:"rowsCopied,omitempty"` + // RowsRead - READ-ONLY; The number of rows read from the source data set. + RowsRead *int64 `json:"rowsRead,omitempty"` + // SizeRead - READ-ONLY; The size of the data read from the source data set in bytes + SizeRead *int64 `json:"sizeRead,omitempty"` + // SizeWritten - READ-ONLY; The size of the data written into the sink data set in bytes + SizeWritten *int64 `json:"sizeWritten,omitempty"` + // StartTime - READ-ONLY; Start time of data set level copy + StartTime *date.Time `json:"startTime,omitempty"` + // Status - READ-ONLY; Raw Status + Status *string `json:"status,omitempty"` + // VCore - READ-ONLY; The vCore units consumed for the data set synchronization + VCore *int64 `json:"vCore,omitempty"` +} + +// SynchronizationDetailsList details of synchronization +type SynchronizationDetailsList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]SynchronizationDetails `json:"value,omitempty"` +} + +// SynchronizationDetailsListIterator provides access to a complete listing of SynchronizationDetails +// values. +type SynchronizationDetailsListIterator struct { + i int + page SynchronizationDetailsListPage +} + +// 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 *SynchronizationDetailsListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationDetailsListIterator.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 *SynchronizationDetailsListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SynchronizationDetailsListIterator) 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 SynchronizationDetailsListIterator) Response() SynchronizationDetailsList { + 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 SynchronizationDetailsListIterator) Value() SynchronizationDetails { + if !iter.page.NotDone() { + return SynchronizationDetails{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SynchronizationDetailsListIterator type. +func NewSynchronizationDetailsListIterator(page SynchronizationDetailsListPage) SynchronizationDetailsListIterator { + return SynchronizationDetailsListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sdl SynchronizationDetailsList) IsEmpty() bool { + return sdl.Value == nil || len(*sdl.Value) == 0 +} + +// synchronizationDetailsListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sdl SynchronizationDetailsList) synchronizationDetailsListPreparer(ctx context.Context) (*http.Request, error) { + if sdl.NextLink == nil || len(to.String(sdl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sdl.NextLink))) +} + +// SynchronizationDetailsListPage contains a page of SynchronizationDetails values. +type SynchronizationDetailsListPage struct { + fn func(context.Context, SynchronizationDetailsList) (SynchronizationDetailsList, error) + sdl SynchronizationDetailsList +} + +// 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 *SynchronizationDetailsListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationDetailsListPage.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.sdl) + if err != nil { + return err + } + page.sdl = 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 *SynchronizationDetailsListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SynchronizationDetailsListPage) NotDone() bool { + return !page.sdl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SynchronizationDetailsListPage) Response() SynchronizationDetailsList { + return page.sdl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SynchronizationDetailsListPage) Values() []SynchronizationDetails { + if page.sdl.IsEmpty() { + return nil + } + return *page.sdl.Value +} + +// Creates a new instance of the SynchronizationDetailsListPage type. +func NewSynchronizationDetailsListPage(getNextPage func(context.Context, SynchronizationDetailsList) (SynchronizationDetailsList, error)) SynchronizationDetailsListPage { + return SynchronizationDetailsListPage{fn: getNextPage} +} + +// BasicSynchronizationSetting a Synchronization Setting data transfer object. +type BasicSynchronizationSetting interface { + AsScheduledSynchronizationSetting() (*ScheduledSynchronizationSetting, bool) + AsSynchronizationSetting() (*SynchronizationSetting, bool) +} + +// SynchronizationSetting a Synchronization Setting data transfer object. +type SynchronizationSetting struct { + autorest.Response `json:"-"` + // Kind - Possible values include: 'KindBasicSynchronizationSettingKindSynchronizationSetting', 'KindBasicSynchronizationSettingKindScheduleBased' + Kind KindBasicSynchronizationSetting `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +func unmarshalBasicSynchronizationSetting(body []byte) (BasicSynchronizationSetting, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindBasicSynchronizationSettingKindScheduleBased): + var sss ScheduledSynchronizationSetting + err := json.Unmarshal(body, &sss) + return sss, err + default: + var ss SynchronizationSetting + err := json.Unmarshal(body, &ss) + return ss, err + } +} +func unmarshalBasicSynchronizationSettingArray(body []byte) ([]BasicSynchronizationSetting, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + ssArray := make([]BasicSynchronizationSetting, len(rawMessages)) + + for index, rawMessage := range rawMessages { + ss, err := unmarshalBasicSynchronizationSetting(*rawMessage) + if err != nil { + return nil, err + } + ssArray[index] = ss + } + return ssArray, nil +} + +// MarshalJSON is the custom marshaler for SynchronizationSetting. +func (ss SynchronizationSetting) MarshalJSON() ([]byte, error) { + ss.Kind = KindBasicSynchronizationSettingKindSynchronizationSetting + objectMap := make(map[string]interface{}) + if ss.Kind != "" { + objectMap["kind"] = ss.Kind + } + return json.Marshal(objectMap) +} + +// AsScheduledSynchronizationSetting is the BasicSynchronizationSetting implementation for SynchronizationSetting. +func (ss SynchronizationSetting) AsScheduledSynchronizationSetting() (*ScheduledSynchronizationSetting, bool) { + return nil, false +} + +// AsSynchronizationSetting is the BasicSynchronizationSetting implementation for SynchronizationSetting. +func (ss SynchronizationSetting) AsSynchronizationSetting() (*SynchronizationSetting, bool) { + return &ss, true +} + +// AsBasicSynchronizationSetting is the BasicSynchronizationSetting implementation for SynchronizationSetting. +func (ss SynchronizationSetting) AsBasicSynchronizationSetting() (BasicSynchronizationSetting, bool) { + return &ss, true +} + +// SynchronizationSettingList list response for get Synchronization settings +type SynchronizationSettingList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]BasicSynchronizationSetting `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SynchronizationSettingList struct. +func (ssl *SynchronizationSettingList) 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 + } + ssl.NextLink = &nextLink + } + case "value": + if v != nil { + value, err := unmarshalBasicSynchronizationSettingArray(*v) + if err != nil { + return err + } + ssl.Value = &value + } + } + } + + return nil +} + +// SynchronizationSettingListIterator provides access to a complete listing of SynchronizationSetting +// values. +type SynchronizationSettingListIterator struct { + i int + page SynchronizationSettingListPage +} + +// 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 *SynchronizationSettingListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingListIterator.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 *SynchronizationSettingListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SynchronizationSettingListIterator) 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 SynchronizationSettingListIterator) Response() SynchronizationSettingList { + 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 SynchronizationSettingListIterator) Value() BasicSynchronizationSetting { + if !iter.page.NotDone() { + return SynchronizationSetting{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SynchronizationSettingListIterator type. +func NewSynchronizationSettingListIterator(page SynchronizationSettingListPage) SynchronizationSettingListIterator { + return SynchronizationSettingListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssl SynchronizationSettingList) IsEmpty() bool { + return ssl.Value == nil || len(*ssl.Value) == 0 +} + +// synchronizationSettingListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssl SynchronizationSettingList) synchronizationSettingListPreparer(ctx context.Context) (*http.Request, error) { + if ssl.NextLink == nil || len(to.String(ssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssl.NextLink))) +} + +// SynchronizationSettingListPage contains a page of BasicSynchronizationSetting values. +type SynchronizationSettingListPage struct { + fn func(context.Context, SynchronizationSettingList) (SynchronizationSettingList, error) + ssl SynchronizationSettingList +} + +// 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 *SynchronizationSettingListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingListPage.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.ssl) + if err != nil { + return err + } + page.ssl = 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 *SynchronizationSettingListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SynchronizationSettingListPage) NotDone() bool { + return !page.ssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SynchronizationSettingListPage) Response() SynchronizationSettingList { + return page.ssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SynchronizationSettingListPage) Values() []BasicSynchronizationSetting { + if page.ssl.IsEmpty() { + return nil + } + return *page.ssl.Value +} + +// Creates a new instance of the SynchronizationSettingListPage type. +func NewSynchronizationSettingListPage(getNextPage func(context.Context, SynchronizationSettingList) (SynchronizationSettingList, error)) SynchronizationSettingListPage { + return SynchronizationSettingListPage{fn: getNextPage} +} + +// SynchronizationSettingModel ... +type SynchronizationSettingModel struct { + autorest.Response `json:"-"` + Value BasicSynchronizationSetting `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SynchronizationSettingModel struct. +func (ssm *SynchronizationSettingModel) UnmarshalJSON(body []byte) error { + ss, err := unmarshalBasicSynchronizationSetting(body) + if err != nil { + return err + } + ssm.Value = ss + + return nil +} + +// SynchronizationSettingsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SynchronizationSettingsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SynchronizationSettingsDeleteFuture) Result(client SynchronizationSettingsClient) (or OperationResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.SynchronizationSettingsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent { + or, err = client.DeleteResponder(or.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsDeleteFuture", "Result", or.Response.Response, "Failure responding to request") + } + } + return +} + +// Synchronize payload for the synchronizing the data. +type Synchronize struct { + // SynchronizationMode - Mode of synchronization used in triggers and snapshot sync. Incremental by default. Possible values include: 'Incremental', 'FullSync' + SynchronizationMode SynchronizationMode `json:"synchronizationMode,omitempty"` +} + +// BasicTrigger a Trigger data transfer object. +type BasicTrigger interface { + AsScheduledTrigger() (*ScheduledTrigger, bool) + AsTrigger() (*Trigger, bool) +} + +// Trigger a Trigger data transfer object. +type Trigger struct { + autorest.Response `json:"-"` + // Kind - Possible values include: 'KindBasicTriggerKindTrigger', 'KindBasicTriggerKindScheduleBased' + Kind KindBasicTrigger `json:"kind,omitempty"` + // ID - READ-ONLY; The resource id of the azure resource + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the azure resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the azure resource + Type *string `json:"type,omitempty"` +} + +func unmarshalBasicTrigger(body []byte) (BasicTrigger, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindBasicTriggerKindScheduleBased): + var st ScheduledTrigger + err := json.Unmarshal(body, &st) + return st, err + default: + var t Trigger + err := json.Unmarshal(body, &t) + return t, err + } +} +func unmarshalBasicTriggerArray(body []byte) ([]BasicTrigger, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tArray := make([]BasicTrigger, len(rawMessages)) + + for index, rawMessage := range rawMessages { + t, err := unmarshalBasicTrigger(*rawMessage) + if err != nil { + return nil, err + } + tArray[index] = t + } + return tArray, nil +} + +// MarshalJSON is the custom marshaler for Trigger. +func (t Trigger) MarshalJSON() ([]byte, error) { + t.Kind = KindBasicTriggerKindTrigger + objectMap := make(map[string]interface{}) + if t.Kind != "" { + objectMap["kind"] = t.Kind + } + return json.Marshal(objectMap) +} + +// AsScheduledTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsScheduledTrigger() (*ScheduledTrigger, bool) { + return nil, false +} + +// AsTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsTrigger() (*Trigger, bool) { + return &t, true +} + +// AsBasicTrigger is the BasicTrigger implementation for Trigger. +func (t Trigger) AsBasicTrigger() (BasicTrigger, bool) { + return &t, true +} + +// TriggerList list response for get triggers +type TriggerList struct { + autorest.Response `json:"-"` + // NextLink - The Url of next result page. + NextLink *string `json:"nextLink,omitempty"` + // Value - Collection of items of type DataTransferObjects. + Value *[]BasicTrigger `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TriggerList struct. +func (tl *TriggerList) 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 + } + tl.NextLink = &nextLink + } + case "value": + if v != nil { + value, err := unmarshalBasicTriggerArray(*v) + if err != nil { + return err + } + tl.Value = &value + } + } + } + + return nil +} + +// TriggerListIterator provides access to a complete listing of Trigger values. +type TriggerListIterator struct { + i int + page TriggerListPage +} + +// 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 *TriggerListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggerListIterator.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 *TriggerListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TriggerListIterator) 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 TriggerListIterator) Response() TriggerList { + 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 TriggerListIterator) Value() BasicTrigger { + if !iter.page.NotDone() { + return Trigger{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TriggerListIterator type. +func NewTriggerListIterator(page TriggerListPage) TriggerListIterator { + return TriggerListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tl TriggerList) IsEmpty() bool { + return tl.Value == nil || len(*tl.Value) == 0 +} + +// triggerListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tl TriggerList) triggerListPreparer(ctx context.Context) (*http.Request, error) { + if tl.NextLink == nil || len(to.String(tl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tl.NextLink))) +} + +// TriggerListPage contains a page of BasicTrigger values. +type TriggerListPage struct { + fn func(context.Context, TriggerList) (TriggerList, error) + tl TriggerList +} + +// 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 *TriggerListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggerListPage.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.tl) + if err != nil { + return err + } + page.tl = 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 *TriggerListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TriggerListPage) NotDone() bool { + return !page.tl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TriggerListPage) Response() TriggerList { + return page.tl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TriggerListPage) Values() []BasicTrigger { + if page.tl.IsEmpty() { + return nil + } + return *page.tl.Value +} + +// Creates a new instance of the TriggerListPage type. +func NewTriggerListPage(getNextPage func(context.Context, TriggerList) (TriggerList, error)) TriggerListPage { + return TriggerListPage{fn: getNextPage} +} + +// TriggerModel ... +type TriggerModel struct { + autorest.Response `json:"-"` + Value BasicTrigger `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TriggerModel struct. +func (tm *TriggerModel) UnmarshalJSON(body []byte) error { + t, err := unmarshalBasicTrigger(body) + if err != nil { + return err + } + tm.Value = t + + return nil +} + +// TriggersCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TriggersCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TriggersCreateFuture) Result(client TriggersClient) (tm TriggerModel, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.TriggersCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tm.Response.Response, err = future.GetResult(sender); err == nil && tm.Response.Response.StatusCode != http.StatusNoContent { + tm, err = client.CreateResponder(tm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersCreateFuture", "Result", tm.Response.Response, "Failure responding to request") + } + } + return +} + +// TriggersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TriggersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *TriggersDeleteFuture) Result(client TriggersClient) (or OperationResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("datashare.TriggersDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if or.Response.Response, err = future.GetResult(sender); err == nil && or.Response.Response.StatusCode != http.StatusNoContent { + or, err = client.DeleteResponder(or.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersDeleteFuture", "Result", or.Response.Response, "Failure responding to request") + } + } + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/operations.go new file mode 100644 index 0000000000000..5c6f040f8b770 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/operations.go @@ -0,0 +1,147 @@ +package datashare + +// 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 creates a Microsoft.DataShare management client. +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 list of available operations +func (client OperationsClient) List(ctx context.Context) (result OperationListPage, 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, "datashare.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, "datashare.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.ol, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.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 = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.DataShare/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 OperationList, 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 OperationList) (result OperationList, err error) { + req, err := lastResults.operationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.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, "datashare.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.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 OperationListIterator, 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/datashare/mgmt/2019-11-01/datashare/providersharesubscriptions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/providersharesubscriptions.go new file mode 100644 index 0000000000000..49babfc08edf7 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/providersharesubscriptions.go @@ -0,0 +1,403 @@ +package datashare + +// 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" +) + +// ProviderShareSubscriptionsClient is the creates a Microsoft.DataShare management client. +type ProviderShareSubscriptionsClient struct { + BaseClient +} + +// NewProviderShareSubscriptionsClient creates an instance of the ProviderShareSubscriptionsClient client. +func NewProviderShareSubscriptionsClient(subscriptionID string) ProviderShareSubscriptionsClient { + return NewProviderShareSubscriptionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProviderShareSubscriptionsClientWithBaseURI creates an instance of the ProviderShareSubscriptionsClient 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 NewProviderShareSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) ProviderShareSubscriptionsClient { + return ProviderShareSubscriptionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetByShare get share subscription in a provider share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// providerShareSubscriptionID - to locate shareSubscription +func (client ProviderShareSubscriptionsClient) GetByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (result ProviderShareSubscription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionsClient.GetByShare") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetBySharePreparer(ctx, resourceGroupName, accountName, shareName, providerShareSubscriptionID) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "GetByShare", nil, "Failure preparing request") + return + } + + resp, err := client.GetByShareSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "GetByShare", resp, "Failure sending request") + return + } + + result, err = client.GetByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "GetByShare", resp, "Failure responding to request") + } + + return +} + +// GetBySharePreparer prepares the GetByShare request. +func (client ProviderShareSubscriptionsClient) GetBySharePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "providerShareSubscriptionId": autorest.Encode("path", providerShareSubscriptionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByShareSender sends the GetByShare request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderShareSubscriptionsClient) GetByShareSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetByShareResponder handles the response to the GetByShare request. The method always +// closes the http.Response Body. +func (client ProviderShareSubscriptionsClient) GetByShareResponder(resp *http.Response) (result ProviderShareSubscription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByShare list share subscriptions in a provider share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// skipToken - continuation Token +func (client ProviderShareSubscriptionsClient) ListByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result ProviderShareSubscriptionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionsClient.ListByShare") + defer func() { + sc := -1 + if result.pssl.Response.Response != nil { + sc = result.pssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareNextResults + req, err := client.ListBySharePreparer(ctx, resourceGroupName, accountName, shareName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "ListByShare", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSender(req) + if err != nil { + result.pssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "ListByShare", resp, "Failure sending request") + return + } + + result.pssl, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "ListByShare", resp, "Failure responding to request") + } + + return +} + +// ListBySharePreparer prepares the ListByShare request. +func (client ProviderShareSubscriptionsClient) ListBySharePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSender sends the ListByShare request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderShareSubscriptionsClient) ListByShareSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByShareResponder handles the response to the ListByShare request. The method always +// closes the http.Response Body. +func (client ProviderShareSubscriptionsClient) ListByShareResponder(resp *http.Response) (result ProviderShareSubscriptionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByShareNextResults retrieves the next set of results, if any. +func (client ProviderShareSubscriptionsClient) listByShareNextResults(ctx context.Context, lastResults ProviderShareSubscriptionList) (result ProviderShareSubscriptionList, err error) { + req, err := lastResults.providerShareSubscriptionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "listByShareNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "listByShareNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "listByShareNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProviderShareSubscriptionsClient) ListByShareComplete(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result ProviderShareSubscriptionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionsClient.ListByShare") + 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.ListByShare(ctx, resourceGroupName, accountName, shareName, skipToken) + return +} + +// Reinstate reinstate share subscription in a provider share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// providerShareSubscriptionID - to locate shareSubscription +func (client ProviderShareSubscriptionsClient) Reinstate(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (result ProviderShareSubscription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionsClient.Reinstate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReinstatePreparer(ctx, resourceGroupName, accountName, shareName, providerShareSubscriptionID) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "Reinstate", nil, "Failure preparing request") + return + } + + resp, err := client.ReinstateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "Reinstate", resp, "Failure sending request") + return + } + + result, err = client.ReinstateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "Reinstate", resp, "Failure responding to request") + } + + return +} + +// ReinstatePreparer prepares the Reinstate request. +func (client ProviderShareSubscriptionsClient) ReinstatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "providerShareSubscriptionId": autorest.Encode("path", providerShareSubscriptionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/reinstate", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReinstateSender sends the Reinstate request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderShareSubscriptionsClient) ReinstateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ReinstateResponder handles the response to the Reinstate request. The method always +// closes the http.Response Body. +func (client ProviderShareSubscriptionsClient) ReinstateResponder(resp *http.Response) (result ProviderShareSubscription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Revoke revoke share subscription in a provider share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// providerShareSubscriptionID - to locate shareSubscription +func (client ProviderShareSubscriptionsClient) Revoke(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (result ProviderShareSubscriptionsRevokeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderShareSubscriptionsClient.Revoke") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RevokePreparer(ctx, resourceGroupName, accountName, shareName, providerShareSubscriptionID) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "Revoke", nil, "Failure preparing request") + return + } + + result, err = client.RevokeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ProviderShareSubscriptionsClient", "Revoke", result.Response(), "Failure sending request") + return + } + + return +} + +// RevokePreparer prepares the Revoke request. +func (client ProviderShareSubscriptionsClient) RevokePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, providerShareSubscriptionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "providerShareSubscriptionId": autorest.Encode("path", providerShareSubscriptionID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/providerShareSubscriptions/{providerShareSubscriptionId}/revoke", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RevokeSender sends the Revoke request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderShareSubscriptionsClient) RevokeSender(req *http.Request) (future ProviderShareSubscriptionsRevokeFuture, 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 +} + +// RevokeResponder handles the response to the Revoke request. The method always +// closes the http.Response Body. +func (client ProviderShareSubscriptionsClient) RevokeResponder(resp *http.Response) (result ProviderShareSubscription, 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 +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/shares.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/shares.go new file mode 100644 index 0000000000000..cba977a749134 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/shares.go @@ -0,0 +1,641 @@ +package datashare + +// 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" +) + +// SharesClient is the creates a Microsoft.DataShare management client. +type SharesClient struct { + BaseClient +} + +// NewSharesClient creates an instance of the SharesClient client. +func NewSharesClient(subscriptionID string) SharesClient { + return NewSharesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSharesClientWithBaseURI creates an instance of the SharesClient 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 NewSharesClientWithBaseURI(baseURI string, subscriptionID string) SharesClient { + return SharesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// share - the share payload +func (client SharesClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, share Share) (result Share, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, shareName, share) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SharesClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, share Share) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}", pathParameters), + autorest.WithJSON(share), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SharesClient) CreateSender(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 +// closes the http.Response Body. +func (client SharesClient) CreateResponder(resp *http.Response) (result Share, 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 a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +func (client SharesClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string) (result SharesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SharesClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}", 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 SharesClient) DeleteSender(req *http.Request) (future SharesDeleteFuture, 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 SharesClient) DeleteResponder(resp *http.Response) (result OperationResponse, 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 +} + +// Get get a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share to retrieve. +func (client SharesClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string) (result Share, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, shareName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SharesClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}", 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 SharesClient) 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 SharesClient) GetResponder(resp *http.Response) (result Share, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAccount list shares in an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// skipToken - continuation Token +func (client SharesClient) ListByAccount(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (result ShareListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListByAccount") + defer func() { + sc := -1 + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByAccountNextResults + req, err := client.ListByAccountPreparer(ctx, resourceGroupName, accountName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListByAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAccountSender(req) + if err != nil { + result.sl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListByAccount", resp, "Failure sending request") + return + } + + result.sl, err = client.ListByAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListByAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAccountPreparer prepares the ListByAccount request. +func (client SharesClient) ListByAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAccountSender sends the ListByAccount request. The method will close the +// http.Response Body if it receives an error. +func (client SharesClient) ListByAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAccountResponder handles the response to the ListByAccount request. The method always +// closes the http.Response Body. +func (client SharesClient) ListByAccountResponder(resp *http.Response) (result ShareList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAccountNextResults retrieves the next set of results, if any. +func (client SharesClient) listByAccountNextResults(ctx context.Context, lastResults ShareList) (result ShareList, err error) { + req, err := lastResults.shareListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.SharesClient", "listByAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.SharesClient", "listByAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "listByAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client SharesClient) ListByAccountComplete(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (result ShareListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListByAccount") + 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.ListByAccount(ctx, resourceGroupName, accountName, skipToken) + return +} + +// ListSynchronizationDetails list synchronization details +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// shareSynchronization - share Synchronization payload. +// skipToken - continuation token +func (client SharesClient) ListSynchronizationDetails(ctx context.Context, resourceGroupName string, accountName string, shareName string, shareSynchronization ShareSynchronization, skipToken string) (result SynchronizationDetailsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListSynchronizationDetails") + defer func() { + sc := -1 + if result.sdl.Response.Response != nil { + sc = result.sdl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listSynchronizationDetailsNextResults + req, err := client.ListSynchronizationDetailsPreparer(ctx, resourceGroupName, accountName, shareName, shareSynchronization, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListSynchronizationDetails", nil, "Failure preparing request") + return + } + + resp, err := client.ListSynchronizationDetailsSender(req) + if err != nil { + result.sdl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListSynchronizationDetails", resp, "Failure sending request") + return + } + + result.sdl, err = client.ListSynchronizationDetailsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListSynchronizationDetails", resp, "Failure responding to request") + } + + return +} + +// ListSynchronizationDetailsPreparer prepares the ListSynchronizationDetails request. +func (client SharesClient) ListSynchronizationDetailsPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, shareSynchronization ShareSynchronization, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + shareSynchronization.SynchronizationMode = "" + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizationDetails", pathParameters), + autorest.WithJSON(shareSynchronization), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSynchronizationDetailsSender sends the ListSynchronizationDetails request. The method will close the +// http.Response Body if it receives an error. +func (client SharesClient) ListSynchronizationDetailsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSynchronizationDetailsResponder handles the response to the ListSynchronizationDetails request. The method always +// closes the http.Response Body. +func (client SharesClient) ListSynchronizationDetailsResponder(resp *http.Response) (result SynchronizationDetailsList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSynchronizationDetailsNextResults retrieves the next set of results, if any. +func (client SharesClient) listSynchronizationDetailsNextResults(ctx context.Context, lastResults SynchronizationDetailsList) (result SynchronizationDetailsList, err error) { + req, err := lastResults.synchronizationDetailsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.SharesClient", "listSynchronizationDetailsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSynchronizationDetailsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.SharesClient", "listSynchronizationDetailsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSynchronizationDetailsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "listSynchronizationDetailsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSynchronizationDetailsComplete enumerates all values, automatically crossing page boundaries as required. +func (client SharesClient) ListSynchronizationDetailsComplete(ctx context.Context, resourceGroupName string, accountName string, shareName string, shareSynchronization ShareSynchronization, skipToken string) (result SynchronizationDetailsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListSynchronizationDetails") + 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.ListSynchronizationDetails(ctx, resourceGroupName, accountName, shareName, shareSynchronization, skipToken) + return +} + +// ListSynchronizations list synchronizations of a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// skipToken - continuation token +func (client SharesClient) ListSynchronizations(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result ShareSynchronizationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListSynchronizations") + defer func() { + sc := -1 + if result.ssl.Response.Response != nil { + sc = result.ssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listSynchronizationsNextResults + req, err := client.ListSynchronizationsPreparer(ctx, resourceGroupName, accountName, shareName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListSynchronizations", nil, "Failure preparing request") + return + } + + resp, err := client.ListSynchronizationsSender(req) + if err != nil { + result.ssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListSynchronizations", resp, "Failure sending request") + return + } + + result.ssl, err = client.ListSynchronizationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "ListSynchronizations", resp, "Failure responding to request") + } + + return +} + +// ListSynchronizationsPreparer prepares the ListSynchronizations request. +func (client SharesClient) ListSynchronizationsPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/listSynchronizations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSynchronizationsSender sends the ListSynchronizations request. The method will close the +// http.Response Body if it receives an error. +func (client SharesClient) ListSynchronizationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSynchronizationsResponder handles the response to the ListSynchronizations request. The method always +// closes the http.Response Body. +func (client SharesClient) ListSynchronizationsResponder(resp *http.Response) (result ShareSynchronizationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSynchronizationsNextResults retrieves the next set of results, if any. +func (client SharesClient) listSynchronizationsNextResults(ctx context.Context, lastResults ShareSynchronizationList) (result ShareSynchronizationList, err error) { + req, err := lastResults.shareSynchronizationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.SharesClient", "listSynchronizationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSynchronizationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.SharesClient", "listSynchronizationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSynchronizationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SharesClient", "listSynchronizationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSynchronizationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client SharesClient) ListSynchronizationsComplete(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result ShareSynchronizationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharesClient.ListSynchronizations") + 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.ListSynchronizations(ctx, resourceGroupName, accountName, shareName, skipToken) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/sharesubscriptions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/sharesubscriptions.go new file mode 100644 index 0000000000000..9ad7e7b42e63c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/sharesubscriptions.go @@ -0,0 +1,957 @@ +package datashare + +// 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" +) + +// ShareSubscriptionsClient is the creates a Microsoft.DataShare management client. +type ShareSubscriptionsClient struct { + BaseClient +} + +// NewShareSubscriptionsClient creates an instance of the ShareSubscriptionsClient client. +func NewShareSubscriptionsClient(subscriptionID string) ShareSubscriptionsClient { + return NewShareSubscriptionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewShareSubscriptionsClientWithBaseURI creates an instance of the ShareSubscriptionsClient 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 NewShareSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) ShareSubscriptionsClient { + return ShareSubscriptionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CancelSynchronization request to cancel a synchronization. +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// shareSubscriptionSynchronization - share Subscription Synchronization payload. +func (client ShareSubscriptionsClient) CancelSynchronization(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscriptionSynchronization ShareSubscriptionSynchronization) (result ShareSubscriptionsCancelSynchronizationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.CancelSynchronization") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: shareSubscriptionSynchronization, + Constraints: []validation.Constraint{{Target: "shareSubscriptionSynchronization.SynchronizationID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("datashare.ShareSubscriptionsClient", "CancelSynchronization", err.Error()) + } + + req, err := client.CancelSynchronizationPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "CancelSynchronization", nil, "Failure preparing request") + return + } + + result, err = client.CancelSynchronizationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "CancelSynchronization", result.Response(), "Failure sending request") + return + } + + return +} + +// CancelSynchronizationPreparer prepares the CancelSynchronization request. +func (client ShareSubscriptionsClient) CancelSynchronizationPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscriptionSynchronization ShareSubscriptionSynchronization) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + shareSubscriptionSynchronization.DurationMs = nil + shareSubscriptionSynchronization.EndTime = nil + shareSubscriptionSynchronization.Message = nil + shareSubscriptionSynchronization.StartTime = nil + shareSubscriptionSynchronization.Status = nil + shareSubscriptionSynchronization.SynchronizationMode = "" + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/cancelSynchronization", pathParameters), + autorest.WithJSON(shareSubscriptionSynchronization), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSynchronizationSender sends the CancelSynchronization request. The method will close the +// http.Response Body if it receives an error. +func (client ShareSubscriptionsClient) CancelSynchronizationSender(req *http.Request) (future ShareSubscriptionsCancelSynchronizationFuture, 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 +} + +// CancelSynchronizationResponder handles the response to the CancelSynchronization request. The method always +// closes the http.Response Body. +func (client ShareSubscriptionsClient) CancelSynchronizationResponder(resp *http.Response) (result ShareSubscriptionSynchronization, 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 +} + +// Create create a shareSubscription in an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// shareSubscription - create parameters for shareSubscription +func (client ShareSubscriptionsClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscription ShareSubscription) (result ShareSubscription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.Create") + 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: shareSubscription, + Constraints: []validation.Constraint{{Target: "shareSubscription.ShareSubscriptionProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "shareSubscription.ShareSubscriptionProperties.InvitationID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "shareSubscription.ShareSubscriptionProperties.SourceShareLocation", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("datashare.ShareSubscriptionsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, shareSubscription) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ShareSubscriptionsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscription ShareSubscription) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}", pathParameters), + autorest.WithJSON(shareSubscription), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ShareSubscriptionsClient) CreateSender(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 +// closes the http.Response Body. +func (client ShareSubscriptionsClient) CreateResponder(resp *http.Response) (result ShareSubscription, 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 a shareSubscription in an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +func (client ShareSubscriptionsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string) (result ShareSubscriptionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareSubscriptionName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ShareSubscriptionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}", 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 ShareSubscriptionsClient) DeleteSender(req *http.Request) (future ShareSubscriptionsDeleteFuture, 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 ShareSubscriptionsClient) DeleteResponder(resp *http.Response) (result OperationResponse, 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 +} + +// Get get a shareSubscription in an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +func (client ShareSubscriptionsClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string) (result ShareSubscription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ShareSubscriptionsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}", 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 ShareSubscriptionsClient) 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 ShareSubscriptionsClient) GetResponder(resp *http.Response) (result ShareSubscription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByAccount list share subscriptions in an account +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// skipToken - continuation Token +func (client ShareSubscriptionsClient) ListByAccount(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (result ShareSubscriptionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListByAccount") + defer func() { + sc := -1 + if result.ssl.Response.Response != nil { + sc = result.ssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByAccountNextResults + req, err := client.ListByAccountPreparer(ctx, resourceGroupName, accountName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListByAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByAccountSender(req) + if err != nil { + result.ssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListByAccount", resp, "Failure sending request") + return + } + + result.ssl, err = client.ListByAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListByAccount", resp, "Failure responding to request") + } + + return +} + +// ListByAccountPreparer prepares the ListByAccount request. +func (client ShareSubscriptionsClient) ListByAccountPreparer(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByAccountSender sends the ListByAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ShareSubscriptionsClient) ListByAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByAccountResponder handles the response to the ListByAccount request. The method always +// closes the http.Response Body. +func (client ShareSubscriptionsClient) ListByAccountResponder(resp *http.Response) (result ShareSubscriptionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByAccountNextResults retrieves the next set of results, if any. +func (client ShareSubscriptionsClient) listByAccountNextResults(ctx context.Context, lastResults ShareSubscriptionList) (result ShareSubscriptionList, err error) { + req, err := lastResults.shareSubscriptionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listByAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listByAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listByAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ShareSubscriptionsClient) ListByAccountComplete(ctx context.Context, resourceGroupName string, accountName string, skipToken string) (result ShareSubscriptionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListByAccount") + 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.ListByAccount(ctx, resourceGroupName, accountName, skipToken) + return +} + +// ListSourceShareSynchronizationSettings get synchronization settings set on a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// skipToken - continuation token +func (client ShareSubscriptionsClient) ListSourceShareSynchronizationSettings(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result SourceShareSynchronizationSettingListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListSourceShareSynchronizationSettings") + defer func() { + sc := -1 + if result.ssssl.Response.Response != nil { + sc = result.ssssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listSourceShareSynchronizationSettingsNextResults + req, err := client.ListSourceShareSynchronizationSettingsPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSourceShareSynchronizationSettings", nil, "Failure preparing request") + return + } + + resp, err := client.ListSourceShareSynchronizationSettingsSender(req) + if err != nil { + result.ssssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSourceShareSynchronizationSettings", resp, "Failure sending request") + return + } + + result.ssssl, err = client.ListSourceShareSynchronizationSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSourceShareSynchronizationSettings", resp, "Failure responding to request") + } + + return +} + +// ListSourceShareSynchronizationSettingsPreparer prepares the ListSourceShareSynchronizationSettings request. +func (client ShareSubscriptionsClient) ListSourceShareSynchronizationSettingsPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSourceShareSynchronizationSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSourceShareSynchronizationSettingsSender sends the ListSourceShareSynchronizationSettings request. The method will close the +// http.Response Body if it receives an error. +func (client ShareSubscriptionsClient) ListSourceShareSynchronizationSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSourceShareSynchronizationSettingsResponder handles the response to the ListSourceShareSynchronizationSettings request. The method always +// closes the http.Response Body. +func (client ShareSubscriptionsClient) ListSourceShareSynchronizationSettingsResponder(resp *http.Response) (result SourceShareSynchronizationSettingList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSourceShareSynchronizationSettingsNextResults retrieves the next set of results, if any. +func (client ShareSubscriptionsClient) listSourceShareSynchronizationSettingsNextResults(ctx context.Context, lastResults SourceShareSynchronizationSettingList) (result SourceShareSynchronizationSettingList, err error) { + req, err := lastResults.sourceShareSynchronizationSettingListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSourceShareSynchronizationSettingsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSourceShareSynchronizationSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSourceShareSynchronizationSettingsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSourceShareSynchronizationSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSourceShareSynchronizationSettingsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSourceShareSynchronizationSettingsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ShareSubscriptionsClient) ListSourceShareSynchronizationSettingsComplete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result SourceShareSynchronizationSettingListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListSourceShareSynchronizationSettings") + 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.ListSourceShareSynchronizationSettings(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + return +} + +// ListSynchronizationDetails list synchronization details +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the share subscription. +// shareSubscriptionSynchronization - share Subscription Synchronization payload. +// skipToken - continuation token +func (client ShareSubscriptionsClient) ListSynchronizationDetails(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscriptionSynchronization ShareSubscriptionSynchronization, skipToken string) (result SynchronizationDetailsListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListSynchronizationDetails") + defer func() { + sc := -1 + if result.sdl.Response.Response != nil { + sc = result.sdl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: shareSubscriptionSynchronization, + Constraints: []validation.Constraint{{Target: "shareSubscriptionSynchronization.SynchronizationID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("datashare.ShareSubscriptionsClient", "ListSynchronizationDetails", err.Error()) + } + + result.fn = client.listSynchronizationDetailsNextResults + req, err := client.ListSynchronizationDetailsPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSynchronizationDetails", nil, "Failure preparing request") + return + } + + resp, err := client.ListSynchronizationDetailsSender(req) + if err != nil { + result.sdl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSynchronizationDetails", resp, "Failure sending request") + return + } + + result.sdl, err = client.ListSynchronizationDetailsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSynchronizationDetails", resp, "Failure responding to request") + } + + return +} + +// ListSynchronizationDetailsPreparer prepares the ListSynchronizationDetails request. +func (client ShareSubscriptionsClient) ListSynchronizationDetailsPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscriptionSynchronization ShareSubscriptionSynchronization, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + shareSubscriptionSynchronization.DurationMs = nil + shareSubscriptionSynchronization.EndTime = nil + shareSubscriptionSynchronization.Message = nil + shareSubscriptionSynchronization.StartTime = nil + shareSubscriptionSynchronization.Status = nil + shareSubscriptionSynchronization.SynchronizationMode = "" + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizationDetails", pathParameters), + autorest.WithJSON(shareSubscriptionSynchronization), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSynchronizationDetailsSender sends the ListSynchronizationDetails request. The method will close the +// http.Response Body if it receives an error. +func (client ShareSubscriptionsClient) ListSynchronizationDetailsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSynchronizationDetailsResponder handles the response to the ListSynchronizationDetails request. The method always +// closes the http.Response Body. +func (client ShareSubscriptionsClient) ListSynchronizationDetailsResponder(resp *http.Response) (result SynchronizationDetailsList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSynchronizationDetailsNextResults retrieves the next set of results, if any. +func (client ShareSubscriptionsClient) listSynchronizationDetailsNextResults(ctx context.Context, lastResults SynchronizationDetailsList) (result SynchronizationDetailsList, err error) { + req, err := lastResults.synchronizationDetailsListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSynchronizationDetailsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSynchronizationDetailsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSynchronizationDetailsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSynchronizationDetailsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSynchronizationDetailsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSynchronizationDetailsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ShareSubscriptionsClient) ListSynchronizationDetailsComplete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, shareSubscriptionSynchronization ShareSubscriptionSynchronization, skipToken string) (result SynchronizationDetailsListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListSynchronizationDetails") + 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.ListSynchronizationDetails(ctx, resourceGroupName, accountName, shareSubscriptionName, shareSubscriptionSynchronization, skipToken) + return +} + +// ListSynchronizations list synchronizations of a share subscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the share subscription. +// skipToken - continuation token +func (client ShareSubscriptionsClient) ListSynchronizations(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result ShareSubscriptionSynchronizationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListSynchronizations") + defer func() { + sc := -1 + if result.sssl.Response.Response != nil { + sc = result.sssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listSynchronizationsNextResults + req, err := client.ListSynchronizationsPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSynchronizations", nil, "Failure preparing request") + return + } + + resp, err := client.ListSynchronizationsSender(req) + if err != nil { + result.sssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSynchronizations", resp, "Failure sending request") + return + } + + result.sssl, err = client.ListSynchronizationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "ListSynchronizations", resp, "Failure responding to request") + } + + return +} + +// ListSynchronizationsPreparer prepares the ListSynchronizations request. +func (client ShareSubscriptionsClient) ListSynchronizationsPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/listSynchronizations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSynchronizationsSender sends the ListSynchronizations request. The method will close the +// http.Response Body if it receives an error. +func (client ShareSubscriptionsClient) ListSynchronizationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSynchronizationsResponder handles the response to the ListSynchronizations request. The method always +// closes the http.Response Body. +func (client ShareSubscriptionsClient) ListSynchronizationsResponder(resp *http.Response) (result ShareSubscriptionSynchronizationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSynchronizationsNextResults retrieves the next set of results, if any. +func (client ShareSubscriptionsClient) listSynchronizationsNextResults(ctx context.Context, lastResults ShareSubscriptionSynchronizationList) (result ShareSubscriptionSynchronizationList, err error) { + req, err := lastResults.shareSubscriptionSynchronizationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSynchronizationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSynchronizationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSynchronizationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSynchronizationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "listSynchronizationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSynchronizationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ShareSubscriptionsClient) ListSynchronizationsComplete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result ShareSubscriptionSynchronizationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.ListSynchronizations") + 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.ListSynchronizations(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + return +} + +// SynchronizeMethod initiate a copy +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of share subscription +// synchronize - synchronize payload +func (client ShareSubscriptionsClient) SynchronizeMethod(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, synchronize Synchronize) (result ShareSubscriptionsSynchronizeMethodFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ShareSubscriptionsClient.SynchronizeMethod") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.SynchronizeMethodPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, synchronize) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "SynchronizeMethod", nil, "Failure preparing request") + return + } + + result, err = client.SynchronizeMethodSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.ShareSubscriptionsClient", "SynchronizeMethod", result.Response(), "Failure sending request") + return + } + + return +} + +// SynchronizeMethodPreparer prepares the SynchronizeMethod request. +func (client ShareSubscriptionsClient) SynchronizeMethodPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, synchronize Synchronize) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/Synchronize", pathParameters), + autorest.WithJSON(synchronize), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SynchronizeMethodSender sends the SynchronizeMethod request. The method will close the +// http.Response Body if it receives an error. +func (client ShareSubscriptionsClient) SynchronizeMethodSender(req *http.Request) (future ShareSubscriptionsSynchronizeMethodFuture, 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 +} + +// SynchronizeMethodResponder handles the response to the SynchronizeMethod request. The method always +// closes the http.Response Body. +func (client ShareSubscriptionsClient) SynchronizeMethodResponder(resp *http.Response) (result ShareSubscriptionSynchronization, 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 +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/synchronizationsettings.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/synchronizationsettings.go new file mode 100644 index 0000000000000..0223d3e28ef3c --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/synchronizationsettings.go @@ -0,0 +1,406 @@ +package datashare + +// 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" +) + +// SynchronizationSettingsClient is the creates a Microsoft.DataShare management client. +type SynchronizationSettingsClient struct { + BaseClient +} + +// NewSynchronizationSettingsClient creates an instance of the SynchronizationSettingsClient client. +func NewSynchronizationSettingsClient(subscriptionID string) SynchronizationSettingsClient { + return NewSynchronizationSettingsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSynchronizationSettingsClientWithBaseURI creates an instance of the SynchronizationSettingsClient 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 NewSynchronizationSettingsClientWithBaseURI(baseURI string, subscriptionID string) SynchronizationSettingsClient { + return SynchronizationSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create or update a synchronizationSetting +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share to add the synchronization setting to. +// synchronizationSettingName - the name of the synchronizationSetting. +// synchronizationSetting - the new synchronization setting information. +func (client SynchronizationSettingsClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string, synchronizationSetting BasicSynchronizationSetting) (result SynchronizationSettingModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, shareName, synchronizationSettingName, synchronizationSetting) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SynchronizationSettingsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string, synchronizationSetting BasicSynchronizationSetting) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "synchronizationSettingName": autorest.Encode("path", synchronizationSettingName), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}", pathParameters), + autorest.WithJSON(synchronizationSetting), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client SynchronizationSettingsClient) CreateSender(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 +// closes the http.Response Body. +func (client SynchronizationSettingsClient) CreateResponder(resp *http.Response) (result SynchronizationSettingModel, 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 a synchronizationSetting in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// synchronizationSettingName - the name of the synchronizationSetting . +func (client SynchronizationSettingsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string) (result SynchronizationSettingsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareName, synchronizationSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SynchronizationSettingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "synchronizationSettingName": autorest.Encode("path", synchronizationSettingName), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}", 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 SynchronizationSettingsClient) DeleteSender(req *http.Request) (future SynchronizationSettingsDeleteFuture, 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 SynchronizationSettingsClient) DeleteResponder(resp *http.Response) (result OperationResponse, 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 +} + +// Get get a synchronizationSetting in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// synchronizationSettingName - the name of the synchronizationSetting. +func (client SynchronizationSettingsClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string) (result SynchronizationSettingModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, shareName, synchronizationSettingName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SynchronizationSettingsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, synchronizationSettingName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "synchronizationSettingName": autorest.Encode("path", synchronizationSettingName), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings/{synchronizationSettingName}", 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 SynchronizationSettingsClient) 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 SynchronizationSettingsClient) GetResponder(resp *http.Response) (result SynchronizationSettingModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByShare list synchronizationSettings in a share +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareName - the name of the share. +// skipToken - continuation token +func (client SynchronizationSettingsClient) ListByShare(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result SynchronizationSettingListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingsClient.ListByShare") + defer func() { + sc := -1 + if result.ssl.Response.Response != nil { + sc = result.ssl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareNextResults + req, err := client.ListBySharePreparer(ctx, resourceGroupName, accountName, shareName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "ListByShare", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSender(req) + if err != nil { + result.ssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "ListByShare", resp, "Failure sending request") + return + } + + result.ssl, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "ListByShare", resp, "Failure responding to request") + } + + return +} + +// ListBySharePreparer prepares the ListByShare request. +func (client SynchronizationSettingsClient) ListBySharePreparer(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareName": autorest.Encode("path", shareName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/synchronizationSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSender sends the ListByShare request. The method will close the +// http.Response Body if it receives an error. +func (client SynchronizationSettingsClient) ListByShareSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByShareResponder handles the response to the ListByShare request. The method always +// closes the http.Response Body. +func (client SynchronizationSettingsClient) ListByShareResponder(resp *http.Response) (result SynchronizationSettingList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByShareNextResults retrieves the next set of results, if any. +func (client SynchronizationSettingsClient) listByShareNextResults(ctx context.Context, lastResults SynchronizationSettingList) (result SynchronizationSettingList, err error) { + req, err := lastResults.synchronizationSettingListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "listByShareNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "listByShareNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.SynchronizationSettingsClient", "listByShareNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareComplete enumerates all values, automatically crossing page boundaries as required. +func (client SynchronizationSettingsClient) ListByShareComplete(ctx context.Context, resourceGroupName string, accountName string, shareName string, skipToken string) (result SynchronizationSettingListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SynchronizationSettingsClient.ListByShare") + 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.ListByShare(ctx, resourceGroupName, accountName, shareName, skipToken) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/triggers.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/triggers.go new file mode 100644 index 0000000000000..49324c58b8b03 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/triggers.go @@ -0,0 +1,405 @@ +package datashare + +// 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" +) + +// TriggersClient is the creates a Microsoft.DataShare management client. +type TriggersClient struct { + BaseClient +} + +// NewTriggersClient creates an instance of the TriggersClient client. +func NewTriggersClient(subscriptionID string) TriggersClient { + return NewTriggersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTriggersClientWithBaseURI creates an instance of the TriggersClient 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 NewTriggersClientWithBaseURI(baseURI string, subscriptionID string) TriggersClient { + return TriggersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create create a Trigger +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the share subscription which will hold the data set sink. +// triggerName - the name of the trigger. +// trigger - trigger details. +func (client TriggersClient) Create(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName string, trigger BasicTrigger) (result TriggersCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.Create") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, triggerName, trigger) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client TriggersClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName string, trigger BasicTrigger) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}", pathParameters), + autorest.WithJSON(trigger), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client TriggersClient) CreateSender(req *http.Request) (future TriggersCreateFuture, 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 +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client TriggersClient) CreateResponder(resp *http.Response) (result TriggerModel, 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 a Trigger in a shareSubscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// triggerName - the name of the trigger. +func (client TriggersClient) Delete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName string) (result TriggersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client TriggersClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}", 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 TriggersClient) DeleteSender(req *http.Request) (future TriggersDeleteFuture, 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 TriggersClient) DeleteResponder(resp *http.Response) (result OperationResponse, 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 +} + +// Get get a Trigger in a shareSubscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the shareSubscription. +// triggerName - the name of the trigger. +func (client TriggersClient) Get(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName string) (result TriggerModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, triggerName) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TriggersClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, triggerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "triggerName": autorest.Encode("path", triggerName), + } + + const APIVersion = "2019-11-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.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers/{triggerName}", 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 TriggersClient) 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 TriggersClient) GetResponder(resp *http.Response) (result TriggerModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByShareSubscription list Triggers in a share subscription +// Parameters: +// resourceGroupName - the resource group name. +// accountName - the name of the share account. +// shareSubscriptionName - the name of the share subscription. +// skipToken - continuation token +func (client TriggersClient) ListByShareSubscription(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result TriggerListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.ListByShareSubscription") + defer func() { + sc := -1 + if result.tl.Response.Response != nil { + sc = result.tl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByShareSubscriptionNextResults + req, err := client.ListByShareSubscriptionPreparer(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "ListByShareSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListByShareSubscriptionSender(req) + if err != nil { + result.tl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "ListByShareSubscription", resp, "Failure sending request") + return + } + + result.tl, err = client.ListByShareSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "ListByShareSubscription", resp, "Failure responding to request") + } + + return +} + +// ListByShareSubscriptionPreparer prepares the ListByShareSubscription request. +func (client TriggersClient) ListByShareSubscriptionPreparer(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "shareSubscriptionName": autorest.Encode("path", shareSubscriptionName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/triggers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByShareSubscriptionSender sends the ListByShareSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client TriggersClient) ListByShareSubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByShareSubscriptionResponder handles the response to the ListByShareSubscription request. The method always +// closes the http.Response Body. +func (client TriggersClient) ListByShareSubscriptionResponder(resp *http.Response) (result TriggerList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByShareSubscriptionNextResults retrieves the next set of results, if any. +func (client TriggersClient) listByShareSubscriptionNextResults(ctx context.Context, lastResults TriggerList) (result TriggerList, err error) { + req, err := lastResults.triggerListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "datashare.TriggersClient", "listByShareSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByShareSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "datashare.TriggersClient", "listByShareSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByShareSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "datashare.TriggersClient", "listByShareSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByShareSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client TriggersClient) ListByShareSubscriptionComplete(ctx context.Context, resourceGroupName string, accountName string, shareSubscriptionName string, skipToken string) (result TriggerListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggersClient.ListByShareSubscription") + 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.ListByShareSubscription(ctx, resourceGroupName, accountName, shareSubscriptionName, skipToken) + return +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/version.go new file mode 100644 index 0000000000000..5a612e2b62094 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare/version.go @@ -0,0 +1,30 @@ +package datashare + +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 + " datashare/2019-11-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 06ff64d2f3edb..779961db7630e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -28,6 +28,7 @@ github.com/Azure/azure-sdk-for-go/services/datalake/analytics/mgmt/2016-11-01/ac github.com/Azure/azure-sdk-for-go/services/datalake/store/2016-11-01/filesystem github.com/Azure/azure-sdk-for-go/services/datalake/store/mgmt/2016-11-01/account github.com/Azure/azure-sdk-for-go/services/datamigration/mgmt/2018-04-19/datamigration +github.com/Azure/azure-sdk-for-go/services/datashare/mgmt/2019-11-01/datashare github.com/Azure/azure-sdk-for-go/services/devspaces/mgmt/2019-04-01/devspaces github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns diff --git a/website/allowed-subcategories b/website/allowed-subcategories index 2b5cf6a9b9e44..ab3278a2fa42b 100644 --- a/website/allowed-subcategories +++ b/website/allowed-subcategories @@ -19,6 +19,7 @@ DNS Data Explorer Data Factory Data Lake +Data Share Database Database Migration Databricks diff --git a/website/azurerm.erb b/website/azurerm.erb index 4e6139df56bef..6c5a4240f2f0b 100644 --- a/website/azurerm.erb +++ b/website/azurerm.erb @@ -186,6 +186,10 @@ azurerm_data_lake_store +
  • + azurerm_data_share_account +
  • +
  • azurerm_dedicated_host
  • @@ -1411,6 +1415,16 @@ +
  • + 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 046/142] 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 047/142] 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 048/142] 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 049/142] 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 050/142] 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 051/142] 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 052/142] 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 053/142] 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 054/142] 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 055/142] 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 056/142] 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 057/142] 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 058/142] 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 059/142] 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 060/142] 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 061/142] 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 062/142] 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 063/142] 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 064/142] 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 065/142] 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 066/142] 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 067/142] 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 068/142] 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 069/142] 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 070/142] 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 071/142] 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 072/142] 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 073/142] 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 074/142] 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 075/142] 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 076/142] 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 077/142] 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 078/142] 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 079/142] 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 080/142] 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 081/142] 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 082/142] 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 083/142] 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 084/142] 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 085/142] 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 086/142] 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 087/142] `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 088/142] 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 089/142] 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 090/142] 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 091/142] 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 092/142] 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 093/142] 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 094/142] 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 095/142] 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 096/142] 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 097/142] 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 098/142] 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 099/142] 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 100/142] 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 101/142] 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 102/142] 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 103/142] 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 104/142] 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 105/142] 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 106/142] 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 107/142] 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 108/142] 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 109/142] 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 110/142] 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 111/142] 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 112/142] 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 113/142] 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 114/142] 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 115/142] 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 116/142] 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 117/142] 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 118/142] 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 119/142] 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 120/142] 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 121/142] 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 122/142] 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 123/142] 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 124/142] 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 125/142] 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 126/142] 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 127/142] 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 128/142] 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 129/142] 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 130/142] 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 131/142] 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 132/142] 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 133/142] 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 134/142] 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 135/142] 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 136/142] 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 137/142] 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 138/142] 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: From 3ac50cc56d4e565fcfd90dcb2c43c54d6e44f734 Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Thu, 7 May 2020 18:52:21 +0200 Subject: [PATCH 139/142] builder: raising an error if environment is unintentionally set to "AZURESTACKCLOUD" Users should instead use the separate "azurestack" provider which offers integration with Azure Stack via the Azure Stack Profiles --- azurerm/internal/clients/builder.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/azurerm/internal/clients/builder.go b/azurerm/internal/clients/builder.go index d501e1333e34b..fd4512961b3d2 100644 --- a/azurerm/internal/clients/builder.go +++ b/azurerm/internal/clients/builder.go @@ -3,6 +3,7 @@ package clients import ( "context" "fmt" + "strings" "github.com/hashicorp/go-azure-helpers/authentication" "github.com/hashicorp/go-azure-helpers/sender" @@ -21,7 +22,21 @@ type ClientBuilder struct { Features features.UserFeatures } +const azureStackEnvironmentError = ` +The AzureRM Provider supports the different Azure Public Clouds - including China, Germany, +Public and US Government - however it does not support Azure Stack due to differences in +API and feature availability. + +Terraform instead offers a separate "azurestack" provider which supports the functionality +and API's available in Azure Stack via Azure Stack Profiles. +` + func Build(ctx context.Context, builder ClientBuilder) (*Client, error) { + // point folks towards the separate Azure Stack Provider when using Azure Stack + if strings.EqualFold(builder.AuthConfig.Environment, "AZURESTACKCLOUD") { + return nil, fmt.Errorf(azureStackEnvironmentError) + } + env, err := authentication.DetermineEnvironment(builder.AuthConfig.Environment) if err != nil { return nil, err From 776a23d4998b79e04d56956ddc287f9ae1073989 Mon Sep 17 00:00:00 2001 From: Neil Ye Date: Fri, 8 May 2020 01:24:07 +0800 Subject: [PATCH 140/142] support alias connection strings for eventhub resources (#6708) --- azurerm/helpers/azure/eventhub.go | 28 +++++-- ...eventhub_authorization_rule_data_source.go | 2 + .../eventhub_authorization_rule_resource.go | 2 + ...amespace_authorization_rule_data_source.go | 28 +++++-- ...b_namespace_authorization_rule_resource.go | 2 + .../eventhub_namespace_data_source.go | 30 +++++-- .../eventhub/eventhub_namespace_resource.go | 18 +++- ...hub_authorization_rule_data_source_test.go | 34 ++++++++ ...enthub_authorization_rule_resource_test.go | 84 +++++++++++++++++++ ...ace_authorization_rule_data_source_test.go | 40 ++++++++- ...espace_authorization_rule_resource_test.go | 79 +++++++++++++++++ .../eventhub_namespace_data_source_test.go | 35 ++++++++ .../tests/eventhub_namespace_resource_test.go | 69 +++++++++++++++ .../eventhub_authorization_rule.html.markdown | 8 +- .../docs/d/eventhub_namespace.html.markdown | 8 +- ...namespace_authorization_rule.html.markdown | 13 +-- .../eventhub_authorization_rule.html.markdown | 8 +- .../docs/r/eventhub_namespace.html.markdown | 8 +- ...namespace_authorization_rule.html.markdown | 8 +- 19 files changed, 465 insertions(+), 39 deletions(-) diff --git a/azurerm/helpers/azure/eventhub.go b/azurerm/helpers/azure/eventhub.go index 68bb1bf806ce2..45fc49377e6d2 100644 --- a/azurerm/helpers/azure/eventhub.go +++ b/azurerm/helpers/azure/eventhub.go @@ -88,16 +88,22 @@ func EventHubAuthorizationRuleSchemaFrom(s map[string]*schema.Schema) map[string Default: false, }, - "send": { + "manage": { Type: schema.TypeBool, Optional: true, Default: false, }, - "manage": { - Type: schema.TypeBool, - Optional: true, - Default: false, + "primary_connection_string": { + Type: schema.TypeString, + Computed: true, + Sensitive: true, + }, + + "primary_connection_string_alias": { + Type: schema.TypeString, + Computed: true, + Sensitive: true, }, "primary_key": { @@ -106,23 +112,29 @@ func EventHubAuthorizationRuleSchemaFrom(s map[string]*schema.Schema) map[string Sensitive: true, }, - "primary_connection_string": { + "secondary_connection_string": { Type: schema.TypeString, Computed: true, Sensitive: true, }, - "secondary_key": { + "secondary_connection_string_alias": { Type: schema.TypeString, Computed: true, Sensitive: true, }, - "secondary_connection_string": { + "secondary_key": { Type: schema.TypeString, Computed: true, Sensitive: true, }, + + "send": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, } return MergeSchema(s, authSchema) } diff --git a/azurerm/internal/services/eventhub/eventhub_authorization_rule_data_source.go b/azurerm/internal/services/eventhub/eventhub_authorization_rule_data_source.go index 79e64fe3b6f65..180c4184bbbc6 100644 --- a/azurerm/internal/services/eventhub/eventhub_authorization_rule_data_source.go +++ b/azurerm/internal/services/eventhub/eventhub_authorization_rule_data_source.go @@ -103,6 +103,8 @@ func dataSourceEventHubAuthorizationRuleRead(d *schema.ResourceData, meta interf d.Set("secondary_key", keysResp.SecondaryKey) d.Set("primary_connection_string", keysResp.PrimaryConnectionString) d.Set("secondary_connection_string", keysResp.SecondaryConnectionString) + d.Set("primary_connection_string_alias", keysResp.AliasPrimaryConnectionString) + d.Set("secondary_connection_string_alias", keysResp.AliasSecondaryConnectionString) return nil } diff --git a/azurerm/internal/services/eventhub/eventhub_authorization_rule_resource.go b/azurerm/internal/services/eventhub/eventhub_authorization_rule_resource.go index b9e8228c908f4..1c86a888582d7 100644 --- a/azurerm/internal/services/eventhub/eventhub_authorization_rule_resource.go +++ b/azurerm/internal/services/eventhub/eventhub_authorization_rule_resource.go @@ -165,6 +165,8 @@ func resourceArmEventHubAuthorizationRuleRead(d *schema.ResourceData, meta inter d.Set("secondary_key", keysResp.SecondaryKey) d.Set("primary_connection_string", keysResp.PrimaryConnectionString) d.Set("secondary_connection_string", keysResp.SecondaryConnectionString) + d.Set("primary_connection_string_alias", keysResp.AliasPrimaryConnectionString) + d.Set("secondary_connection_string_alias", keysResp.AliasSecondaryConnectionString) return nil } diff --git a/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_data_source.go b/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_data_source.go index f59ff99958a27..38990f1ae47b5 100644 --- a/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_data_source.go +++ b/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_data_source.go @@ -39,14 +39,21 @@ func dataSourceEventHubNamespaceAuthorizationRule() *schema.Resource { Computed: true, }, - "send": { + "manage": { Type: schema.TypeBool, Computed: true, }, - "manage": { - Type: schema.TypeBool, - Computed: true, + "primary_connection_string": { + Type: schema.TypeString, + Computed: true, + Sensitive: true, + }, + + "primary_connection_string_alias": { + Type: schema.TypeString, + Computed: true, + Sensitive: true, }, "primary_key": { @@ -55,23 +62,28 @@ func dataSourceEventHubNamespaceAuthorizationRule() *schema.Resource { Sensitive: true, }, - "primary_connection_string": { + "secondary_connection_string": { Type: schema.TypeString, Computed: true, Sensitive: true, }, - "secondary_key": { + "secondary_connection_string_alias": { Type: schema.TypeString, Computed: true, Sensitive: true, }, - "secondary_connection_string": { + "secondary_key": { Type: schema.TypeString, Computed: true, Sensitive: true, }, + + "send": { + Type: schema.TypeBool, + Computed: true, + }, }, } } @@ -118,6 +130,8 @@ func dataSourceEventHubNamespaceAuthorizationRuleRead(d *schema.ResourceData, me d.Set("secondary_key", keysResp.SecondaryKey) d.Set("primary_connection_string", keysResp.PrimaryConnectionString) d.Set("secondary_connection_string", keysResp.SecondaryConnectionString) + d.Set("primary_connection_string_alias", keysResp.AliasPrimaryConnectionString) + d.Set("secondary_connection_string_alias", keysResp.AliasSecondaryConnectionString) return nil } diff --git a/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_resource.go b/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_resource.go index 0bde5790fb4fa..7af663e7ad24d 100644 --- a/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_resource.go +++ b/azurerm/internal/services/eventhub/eventhub_namespace_authorization_rule_resource.go @@ -152,6 +152,8 @@ func resourceArmEventHubNamespaceAuthorizationRuleRead(d *schema.ResourceData, m d.Set("secondary_key", keysResp.SecondaryKey) d.Set("primary_connection_string", keysResp.PrimaryConnectionString) d.Set("secondary_connection_string", keysResp.SecondaryConnectionString) + d.Set("primary_connection_string_alias", keysResp.AliasPrimaryConnectionString) + d.Set("secondary_connection_string_alias", keysResp.AliasSecondaryConnectionString) return nil } diff --git a/azurerm/internal/services/eventhub/eventhub_namespace_data_source.go b/azurerm/internal/services/eventhub/eventhub_namespace_data_source.go index 10577064105a5..25b198bc1cb37 100644 --- a/azurerm/internal/services/eventhub/eventhub_namespace_data_source.go +++ b/azurerm/internal/services/eventhub/eventhub_namespace_data_source.go @@ -31,14 +31,16 @@ func dataSourceEventHubNamespace() *schema.Resource { "location": azure.SchemaLocationForDataSource(), - "sku": { - Type: schema.TypeString, - Computed: true, + "default_primary_connection_string_alias": { + Type: schema.TypeString, + Computed: true, + Sensitive: true, }, - "capacity": { - Type: schema.TypeInt, - Computed: true, + "default_secondary_connection_string_alias": { + Type: schema.TypeString, + Computed: true, + Sensitive: true, }, "auto_inflate_enabled": { @@ -46,6 +48,11 @@ func dataSourceEventHubNamespace() *schema.Resource { Computed: true, }, + "capacity": { + Type: schema.TypeInt, + Computed: true, + }, + "kafka_enabled": { Type: schema.TypeBool, Computed: true, @@ -62,13 +69,13 @@ func dataSourceEventHubNamespace() *schema.Resource { Sensitive: true, }, - "default_secondary_connection_string": { + "default_primary_key": { Type: schema.TypeString, Computed: true, Sensitive: true, }, - "default_primary_key": { + "default_secondary_connection_string": { Type: schema.TypeString, Computed: true, Sensitive: true, @@ -80,6 +87,11 @@ func dataSourceEventHubNamespace() *schema.Resource { Sensitive: true, }, + "sku": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tags.SchemaDataSource(), }, } @@ -117,6 +129,8 @@ func dataSourceEventHubNamespaceRead(d *schema.ResourceData, meta interface{}) e if err != nil { log.Printf("[WARN] Unable to List default keys for EventHub Namespace %q (Resource Group %q): %+v", name, resourceGroup, err) } else { + d.Set("default_primary_connection_string_alias", keys.AliasPrimaryConnectionString) + d.Set("default_secondary_connection_string_alias", keys.AliasSecondaryConnectionString) d.Set("default_primary_connection_string", keys.PrimaryConnectionString) d.Set("default_secondary_connection_string", keys.SecondaryConnectionString) d.Set("default_primary_key", keys.PrimaryKey) diff --git a/azurerm/internal/services/eventhub/eventhub_namespace_resource.go b/azurerm/internal/services/eventhub/eventhub_namespace_resource.go index 35b2dbe0c20c4..45d7672e3acbc 100644 --- a/azurerm/internal/services/eventhub/eventhub_namespace_resource.go +++ b/azurerm/internal/services/eventhub/eventhub_namespace_resource.go @@ -158,13 +158,19 @@ func resourceArmEventHubNamespace() *schema.Resource { }, }, - "default_primary_connection_string": { + "default_primary_connection_string_alias": { Type: schema.TypeString, Computed: true, Sensitive: true, }, - "default_secondary_connection_string": { + "default_secondary_connection_string_alias": { + Type: schema.TypeString, + Computed: true, + Sensitive: true, + }, + + "default_primary_connection_string": { Type: schema.TypeString, Computed: true, Sensitive: true, @@ -176,6 +182,12 @@ func resourceArmEventHubNamespace() *schema.Resource { Sensitive: true, }, + "default_secondary_connection_string": { + Type: schema.TypeString, + Computed: true, + Sensitive: true, + }, + "default_secondary_key": { Type: schema.TypeString, Computed: true, @@ -326,6 +338,8 @@ func resourceArmEventHubNamespaceRead(d *schema.ResourceData, meta interface{}) if err != nil { log.Printf("[WARN] Unable to List default keys for EventHub Namespace %q: %+v", name, err) } else { + d.Set("default_primary_connection_string_alias", keys.AliasPrimaryConnectionString) + d.Set("default_secondary_connection_string_alias", keys.AliasSecondaryConnectionString) d.Set("default_primary_connection_string", keys.PrimaryConnectionString) d.Set("default_secondary_connection_string", keys.SecondaryConnectionString) d.Set("default_primary_key", keys.PrimaryKey) diff --git a/azurerm/internal/services/eventhub/tests/eventhub_authorization_rule_data_source_test.go b/azurerm/internal/services/eventhub/tests/eventhub_authorization_rule_data_source_test.go index b6691fc114d76..4ddb26fac7b35 100644 --- a/azurerm/internal/services/eventhub/tests/eventhub_authorization_rule_data_source_test.go +++ b/azurerm/internal/services/eventhub/tests/eventhub_authorization_rule_data_source_test.go @@ -33,6 +33,26 @@ func TestAccDataSourceAzureRMEventHubAuthorizationRule(t *testing.T) { }) } +func TestAccDataSourceAzureRMEventHubAuthorizationRule_withAliasConnectionString(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_eventhub_authorization_rule", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMEventHubAuthorizationRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAzureRMEventHubAuthorizationRule_withAliasConnectionString(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMEventHubAuthorizationRuleExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "primary_connection_string_alias"), + resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_connection_string_alias"), + ), + }, + }, + }) +} + func testAccDataSourceAzureRMEventHubAuthorizationRule_base(data acceptance.TestData, listen, send, manage bool) string { template := testAccAzureRMEventHubAuthorizationRule_base(data, listen, send, manage) return fmt.Sprintf(` @@ -46,3 +66,17 @@ data "azurerm_eventhub_authorization_rule" "test" { } `, template) } + +func testAccDataSourceAzureRMEventHubAuthorizationRule_withAliasConnectionString(data acceptance.TestData) string { + template := testAccAzureRMEventHubAuthorizationRule_withAliasConnectionString(data) + return fmt.Sprintf(` +%s + +data "azurerm_eventhub_authorization_rule" "test" { + name = azurerm_eventhub_authorization_rule.test.name + namespace_name = azurerm_eventhub_namespace.test.name + eventhub_name = azurerm_eventhub.test.name + resource_group_name = azurerm_resource_group.test.name +} +`, template) +} diff --git a/azurerm/internal/services/eventhub/tests/eventhub_authorization_rule_resource_test.go b/azurerm/internal/services/eventhub/tests/eventhub_authorization_rule_resource_test.go index d637f56d68857..d0071dfd3836b 100644 --- a/azurerm/internal/services/eventhub/tests/eventhub_authorization_rule_resource_test.go +++ b/azurerm/internal/services/eventhub/tests/eventhub_authorization_rule_resource_test.go @@ -164,6 +164,27 @@ func TestAccAzureRMEventHubAuthorizationRule_rightsUpdate(t *testing.T) { }) } +func TestAccAzureRMEventHubAuthorizationRule_withAliasConnectionString(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_eventhub_authorization_rule", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMEventHubAuthorizationRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAzureRMEventHubAuthorizationRule_withAliasConnectionString(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMEventHubAuthorizationRuleExists(data.ResourceName), + resource.TestCheckResourceAttrSet(data.ResourceName, "primary_connection_string_alias"), + resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_connection_string_alias"), + ), + }, + data.ImportStep(), + }, + }) +} + func testCheckAzureRMEventHubAuthorizationRuleDestroy(s *terraform.State) error { conn := acceptance.AzureProvider.Meta().(*clients.Client).Eventhub.EventHubsClient ctx := acceptance.AzureProvider.Meta().(*clients.Client).StopContext @@ -312,3 +333,66 @@ resource "azurerm_eventhub_authorization_rule" "import" { } `, template) } + +func testAccAzureRMEventHubAuthorizationRule_withAliasConnectionString(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-ehar-%[1]d" + location = "%[2]s" +} + +resource "azurerm_resource_group" "test2" { + name = "acctestRG2-ehar-%[1]d" + location = "%[3]s" +} + +resource "azurerm_eventhub_namespace" "test" { + name = "acctesteventhubnamespace-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + sku = "Standard" +} + +resource "azurerm_eventhub_namespace" "test2" { + name = "acctesteventhubnamespace2-%[1]d" + location = azurerm_resource_group.test2.location + resource_group_name = azurerm_resource_group.test2.name + + sku = "Standard" +} + +resource "azurerm_eventhub_namespace_disaster_recovery_config" "test" { + name = "acctest-EHN-DRC-%[1]d" + resource_group_name = azurerm_resource_group.test.name + namespace_name = azurerm_eventhub_namespace.test.name + partner_namespace_id = azurerm_eventhub_namespace.test2.id +} + +resource "azurerm_eventhub" "test" { + name = "acctesteventhub-%[1]d" + namespace_name = azurerm_eventhub_namespace.test.name + resource_group_name = azurerm_resource_group.test.name + + partition_count = 2 + message_retention = 1 +} + +resource "azurerm_eventhub_authorization_rule" "test" { + name = "acctest-%[1]d" + namespace_name = azurerm_eventhub_namespace.test.name + eventhub_name = azurerm_eventhub.test.name + resource_group_name = azurerm_resource_group.test.name + + listen = true + send = true + manage = true + + depends_on = [azurerm_eventhub_namespace_disaster_recovery_config.test] +} +`, data.RandomInteger, data.Locations.Primary, data.Locations.Secondary) +} diff --git a/azurerm/internal/services/eventhub/tests/eventhub_namespace_authorization_rule_data_source_test.go b/azurerm/internal/services/eventhub/tests/eventhub_namespace_authorization_rule_data_source_test.go index fcc963c67ca5f..1d7086c024780 100644 --- a/azurerm/internal/services/eventhub/tests/eventhub_namespace_authorization_rule_data_source_test.go +++ b/azurerm/internal/services/eventhub/tests/eventhub_namespace_authorization_rule_data_source_test.go @@ -9,7 +9,7 @@ import ( ) func TestAccDataSourceAzureRMEventHubNamespaceAuthorizationRule_basic(t *testing.T) { - data := acceptance.BuildTestData(t, "data.eventhub_namespace_authorization_rule", "test") + data := acceptance.BuildTestData(t, "data.azurerm_eventhub_namespace_authorization_rule", "test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { acceptance.PreCheck(t) }, @@ -27,6 +27,31 @@ func TestAccDataSourceAzureRMEventHubNamespaceAuthorizationRule_basic(t *testing }) } +func TestAccDataSourceAzureRMEventHubNamespaceAuthorizationRule_withAliasConnectionString(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_eventhub_namespace_authorization_rule", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + Steps: []resource.TestStep{ + { + // `primary_connection_string_alias` and `secondary_connection_string_alias` are still `nil` while `data.azurerm_eventhub_namespace_authorization_rule` is retrieving resource. since `azurerm_eventhub_namespace_disaster_recovery_config` hasn't been created. + // So these two properties should be checked in the second run. + // And `depends_on` cannot be applied to `azurerm_eventhub_namespace_authorization_rule`. + // Because it would throw error message `BreakPairing operation is only allowed on primary namespace with valid secondary namespace.` while destroying `azurerm_eventhub_namespace_disaster_recovery_config` if `depends_on` is applied. + Config: testAccAzureRMEventHubNamespaceAuthorizationRule_withAliasConnectionString(data), + }, + { + Config: testAccDataSourceEventHubNamespaceAuthorizationRule_withAliasConnectionString(data), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(data.ResourceName, "primary_connection_string_alias"), + resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_connection_string_alias"), + ), + }, + }, + }) +} + func testAccDataSourceEventHubNamespaceAuthorizationRule_basic(data acceptance.TestData, listen, send, manage bool) string { return fmt.Sprintf(` provider "azurerm" { @@ -63,3 +88,16 @@ data "azurerm_eventhub_namespace_authorization_rule" "test" { } `, data.RandomInteger, data.Locations.Primary, listen, send, manage) } + +func testAccDataSourceEventHubNamespaceAuthorizationRule_withAliasConnectionString(data acceptance.TestData) string { + template := testAccAzureRMEventHubNamespaceAuthorizationRule_withAliasConnectionString(data) + return fmt.Sprintf(` +%s + +data "azurerm_eventhub_namespace_authorization_rule" "test" { + name = azurerm_eventhub_namespace_authorization_rule.test.name + namespace_name = azurerm_eventhub_namespace.test.name + resource_group_name = azurerm_resource_group.test.name +} +`, template) +} diff --git a/azurerm/internal/services/eventhub/tests/eventhub_namespace_authorization_rule_resource_test.go b/azurerm/internal/services/eventhub/tests/eventhub_namespace_authorization_rule_resource_test.go index 5273d778f5392..d4c63a2b8b2ef 100644 --- a/azurerm/internal/services/eventhub/tests/eventhub_namespace_authorization_rule_resource_test.go +++ b/azurerm/internal/services/eventhub/tests/eventhub_namespace_authorization_rule_resource_test.go @@ -115,6 +115,36 @@ func TestAccAzureRMEventHubNamespaceAuthorizationRule_rightsUpdate(t *testing.T) }) } +func TestAccAzureRMEventHubNamespaceAuthorizationRule_withAliasConnectionString(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_eventhub_namespace_authorization_rule", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMEventHubNamespaceAuthorizationRuleDestroy, + Steps: []resource.TestStep{ + { + // `primary_connection_string_alias` and `secondary_connection_string_alias` are still `nil` in `azurerm_eventhub_namespace_authorization_rule` after created `azurerm_eventhub_namespace` successfully since `azurerm_eventhub_namespace_disaster_recovery_config` hasn't been created. + // So these two properties should be checked in the second run. + // And `depends_on` cannot be applied to `azurerm_eventhub_namespace_authorization_rule`. + // Because it would throw error message `BreakPairing operation is only allowed on primary namespace with valid secondary namespace.` while destroying `azurerm_eventhub_namespace_disaster_recovery_config` if `depends_on` is applied. + Config: testAccAzureRMEventHubNamespaceAuthorizationRule_withAliasConnectionString(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMEventHubNamespaceAuthorizationRuleExists(data.ResourceName), + ), + }, + { + Config: testAccAzureRMEventHubNamespaceAuthorizationRule_withAliasConnectionString(data), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(data.ResourceName, "primary_connection_string_alias"), + resource.TestCheckResourceAttrSet(data.ResourceName, "secondary_connection_string_alias"), + ), + }, + data.ImportStep(), + }, + }) +} + func TestAccAzureRMEventHubNamespaceAuthorizationRule_multi(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_eventhub_namespace_authorization_rule", "test1") resourceTwoName := "azurerm_eventhub_namespace_authorization_rule.test2" @@ -249,6 +279,55 @@ resource "azurerm_eventhub_namespace_authorization_rule" "test" { `, data.RandomInteger, data.Locations.Primary, listen, send, manage) } +func testAccAzureRMEventHubNamespaceAuthorizationRule_withAliasConnectionString(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-ehnar-%[1]d" + location = "%[2]s" +} + +resource "azurerm_resource_group" "test2" { + name = "acctestRG2-ehnar-%[1]d" + location = "%[3]s" +} + +resource "azurerm_eventhub_namespace" "test" { + name = "acctesteventhubnamespace-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + sku = "Standard" +} + +resource "azurerm_eventhub_namespace" "test2" { + name = "acctesteventhubnamespace2-%[1]d" + location = azurerm_resource_group.test2.location + resource_group_name = azurerm_resource_group.test2.name + sku = "Standard" +} + +resource "azurerm_eventhub_namespace_disaster_recovery_config" "test" { + name = "acctest-EHN-DRC-%[1]d" + resource_group_name = azurerm_resource_group.test.name + namespace_name = azurerm_eventhub_namespace.test.name + partner_namespace_id = azurerm_eventhub_namespace.test2.id +} + +resource "azurerm_eventhub_namespace_authorization_rule" "test" { + name = "acctest-EHN-AR%[1]d" + namespace_name = azurerm_eventhub_namespace.test.name + resource_group_name = azurerm_resource_group.test.name + + listen = true + send = true + manage = true +} +`, data.RandomInteger, data.Locations.Primary, data.Locations.Secondary) +} + func testAccAzureRMEventHubNamespaceAuthorizationRule_requiresImport(data acceptance.TestData, listen, send, manage bool) string { template := testAccAzureRMEventHubNamespaceAuthorizationRule_base(data, listen, send, manage) return fmt.Sprintf(` diff --git a/azurerm/internal/services/eventhub/tests/eventhub_namespace_data_source_test.go b/azurerm/internal/services/eventhub/tests/eventhub_namespace_data_source_test.go index 97a171726f4a3..12020c172f8f9 100644 --- a/azurerm/internal/services/eventhub/tests/eventhub_namespace_data_source_test.go +++ b/azurerm/internal/services/eventhub/tests/eventhub_namespace_data_source_test.go @@ -45,6 +45,29 @@ func TestAccDataSourceAzureRMEventHubNamespace_complete(t *testing.T) { }) } +func TestAccDataSourceAzureRMEventHubNamespace_withAliasConnectionString(t *testing.T) { + data := acceptance.BuildTestData(t, "data.azurerm_eventhub_namespace", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + Steps: []resource.TestStep{ + { + // `default_primary_connection_string_alias` and `default_secondary_connection_string_alias` are still `nil` while `data.azurerm_eventhub_namespace` is retrieving resource. since `azurerm_eventhub_namespace_disaster_recovery_config` hasn't been created. + // So these two properties should be checked in the second run. + Config: testAccAzureRMEventHubNamespace_withAliasConnectionString(data), + }, + { + Config: testAccDataSourceEventHubNamespace_withAliasConnectionString(data), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(data.ResourceName, "default_primary_connection_string_alias"), + resource.TestCheckResourceAttrSet(data.ResourceName, "default_secondary_connection_string_alias"), + ), + }, + }, + }) +} + func testAccDataSourceEventHubNamespace_basic(data acceptance.TestData) string { return fmt.Sprintf(` provider "azurerm" { @@ -97,3 +120,15 @@ data "azurerm_eventhub_namespace" "test" { } `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } + +func testAccDataSourceEventHubNamespace_withAliasConnectionString(data acceptance.TestData) string { + template := testAccAzureRMEventHubNamespace_withAliasConnectionString(data) + return fmt.Sprintf(` +%s + +data "azurerm_eventhub_namespace" "test" { + name = azurerm_eventhub_namespace.test.name + resource_group_name = azurerm_eventhub_namespace.test.resource_group_name +} +`, template) +} diff --git a/azurerm/internal/services/eventhub/tests/eventhub_namespace_resource_test.go b/azurerm/internal/services/eventhub/tests/eventhub_namespace_resource_test.go index e783390ff797b..74e724c1dfb16 100644 --- a/azurerm/internal/services/eventhub/tests/eventhub_namespace_resource_test.go +++ b/azurerm/internal/services/eventhub/tests/eventhub_namespace_resource_test.go @@ -153,6 +153,34 @@ func TestAccAzureRMEventHubNamespace_readDefaultKeys(t *testing.T) { }) } +func TestAccAzureRMEventHubNamespace_withAliasConnectionString(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_eventhub_namespace", "test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { acceptance.PreCheck(t) }, + Providers: acceptance.SupportedProviders, + CheckDestroy: testCheckAzureRMEventHubNamespaceDestroy, + Steps: []resource.TestStep{ + { + // `default_primary_connection_string_alias` and `default_secondary_connection_string_alias` are still `nil` in `azurerm_eventhub_namespace` after created `azurerm_eventhub_namespace` successfully since `azurerm_eventhub_namespace_disaster_recovery_config` hasn't been created. + // So these two properties should be checked in the second run. + Config: testAccAzureRMEventHubNamespace_withAliasConnectionString(data), + Check: resource.ComposeTestCheckFunc( + testCheckAzureRMEventHubNamespaceExists(data.ResourceName), + ), + }, + { + Config: testAccAzureRMEventHubNamespace_withAliasConnectionString(data), + Check: resource.ComposeTestCheckFunc( + resource.TestMatchResourceAttr(data.ResourceName, "default_primary_connection_string_alias", regexp.MustCompile("Endpoint=.+")), + resource.TestMatchResourceAttr(data.ResourceName, "default_secondary_connection_string_alias", regexp.MustCompile("Endpoint=.+")), + ), + }, + data.ImportStep(), + }, + }) +} + func TestAccAzureRMEventHubNamespace_maximumThroughputUnits(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_eventhub_namespace", "test") @@ -414,6 +442,47 @@ resource "azurerm_eventhub_namespace" "test" { `, data.RandomInteger, data.Locations.Primary, data.RandomInteger) } +func testAccAzureRMEventHubNamespace_withAliasConnectionString(data acceptance.TestData) string { + return fmt.Sprintf(` +provider "azurerm" { + features {} +} + +resource "azurerm_resource_group" "test" { + name = "acctestRG-ehn-%[1]d" + location = "%[2]s" +} + +resource "azurerm_resource_group" "test2" { + name = "acctestRG2-ehn-%[1]d" + location = "%[3]s" +} + +resource "azurerm_eventhub_namespace" "test" { + name = "acctesteventhubnamespace-%[1]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + + sku = "Standard" +} + +resource "azurerm_eventhub_namespace" "test2" { + name = "acctesteventhubnamespace2-%[1]d" + location = azurerm_resource_group.test2.location + resource_group_name = azurerm_resource_group.test2.name + + sku = "Standard" +} + +resource "azurerm_eventhub_namespace_disaster_recovery_config" "test" { + name = "acctest-EHN-DRC-%[1]d" + resource_group_name = azurerm_resource_group.test.name + namespace_name = azurerm_eventhub_namespace.test.name + partner_namespace_id = azurerm_eventhub_namespace.test2.id +} +`, data.RandomInteger, data.Locations.Primary, data.Locations.Secondary) +} + func testAccAzureRMEventHubNamespace_requiresImport(data acceptance.TestData) string { template := testAccAzureRMEventHubNamespace_basic(data) return fmt.Sprintf(` diff --git a/website/docs/d/eventhub_authorization_rule.html.markdown b/website/docs/d/eventhub_authorization_rule.html.markdown index c19a239f6f1c1..33a14a7a69c36 100644 --- a/website/docs/d/eventhub_authorization_rule.html.markdown +++ b/website/docs/d/eventhub_authorization_rule.html.markdown @@ -37,14 +37,18 @@ The following attributes are exported: * `id` - The EventHub ID. -* `primary_key` - The Primary Key for the Event Hubs Authorization Rule. +* `primary_connection_string_alias` - The alias of the Primary Connection String for the Event Hubs Authorization Rule. + +* `secondary_connection_string_alias` - The alias of the Secondary Connection String for the Event Hubs Authorization Rule. * `primary_connection_string` - The Primary Connection String for the Event Hubs Authorization Rule. -* `secondary_key` - The Secondary Key for the Event Hubs Authorization Rule. +* `primary_key` - The Primary Key for the Event Hubs Authorization Rule. * `secondary_connection_string` - The Secondary Connection String for the Event Hubs Authorization Rule. +* `secondary_key` - The Secondary Key for the Event Hubs Authorization Rule. + ## Timeouts The `timeouts` block allows you to specify [timeouts](https://www.terraform.io/docs/configuration/resources.html#timeouts) for certain actions: diff --git a/website/docs/d/eventhub_namespace.html.markdown b/website/docs/d/eventhub_namespace.html.markdown index 9ab5630429806..f62ee07863b99 100644 --- a/website/docs/d/eventhub_namespace.html.markdown +++ b/website/docs/d/eventhub_namespace.html.markdown @@ -50,10 +50,16 @@ The following attributes are exported only if there is an authorization rule nam * `default_primary_connection_string` - The primary connection string for the authorization rule `RootManageSharedAccessKey`. +* `default_primary_connection_string_alias` - The alias of the primary connection string for the authorization + rule `RootManageSharedAccessKey`. + +* `default_primary_key` - The primary access key for the authorization rule `RootManageSharedAccessKey`. + * `default_secondary_connection_string` - The secondary connection string for the authorization rule `RootManageSharedAccessKey`. -* `default_primary_key` - The primary access key for the authorization rule `RootManageSharedAccessKey`. +* `default_secondary_connection_string_alias` - The alias of the secondary connection string for the + authorization rule `RootManageSharedAccessKey`. * `default_secondary_key` - The secondary access key for the authorization rule `RootManageSharedAccessKey`. diff --git a/website/docs/d/eventhub_namespace_authorization_rule.html.markdown b/website/docs/d/eventhub_namespace_authorization_rule.html.markdown index a8779443c50ee..600fe0d3dd7af 100644 --- a/website/docs/d/eventhub_namespace_authorization_rule.html.markdown +++ b/website/docs/d/eventhub_namespace_authorization_rule.html.markdown @@ -40,20 +40,23 @@ The following attributes are exported: * `id` - The EventHub ID. -* `listen` - Does this Authorization Rule have permissions to Listen to the Event Hub? +* `primary_connection_string_alias` - The alias of the Primary Connection String for the Event Hubs authorization Rule. -* `send` - Does this Authorization Rule have permissions to Send to the Event Hub? +* `secondary_connection_string_alias` - The alias of the Secondary Connection String for the Event Hubs authorization Rule. -* `manage` - Does this Authorization Rule have permissions to Manage to the Event Hub? +* `listen` - Does this Authorization Rule have permissions to Listen to the Event Hub? -* `primary_key` - The Primary Key for the Event Hubs authorization Rule. +* `manage` - Does this Authorization Rule have permissions to Manage to the Event Hub? * `primary_connection_string` - The Primary Connection String for the Event Hubs authorization Rule. -* `secondary_key` - The Secondary Key for the Event Hubs authorization Rule. +* `primary_key` - The Primary Key for the Event Hubs authorization Rule. * `secondary_connection_string` - The Secondary Connection String for the Event Hubs authorization Rule. +* `secondary_key` - The Secondary Key for the Event Hubs authorization Rule. + +* `send` - Does this Authorization Rule have permissions to Send to the Event Hub? ## Timeouts diff --git a/website/docs/r/eventhub_authorization_rule.html.markdown b/website/docs/r/eventhub_authorization_rule.html.markdown index f82030227e128..97830e2a53cb8 100644 --- a/website/docs/r/eventhub_authorization_rule.html.markdown +++ b/website/docs/r/eventhub_authorization_rule.html.markdown @@ -75,14 +75,18 @@ The following attributes are exported: * `id` - The EventHub ID. -* `primary_key` - The Primary Key for the Event Hubs authorization Rule. +* `primary_connection_string_alias` - The alias of the Primary Connection String for the Event Hubs authorization Rule, which is generated when disaster recovery is enabled. + +* `secondary_connection_string_alias` - The alias of the Secondary Connection String for the Event Hubs Authorization Rule, which is generated when disaster recovery is enabled. * `primary_connection_string` - The Primary Connection String for the Event Hubs authorization Rule. -* `secondary_key` - The Secondary Key for the Event Hubs Authorization Rule. +* `primary_key` - The Primary Key for the Event Hubs authorization Rule. * `secondary_connection_string` - The Secondary Connection String for the Event Hubs Authorization Rule. +* `secondary_key` - The Secondary Key for the Event Hubs Authorization Rule. + ## Timeouts diff --git a/website/docs/r/eventhub_namespace.html.markdown b/website/docs/r/eventhub_namespace.html.markdown index 387b26daebda9..e541c6cab8242 100644 --- a/website/docs/r/eventhub_namespace.html.markdown +++ b/website/docs/r/eventhub_namespace.html.markdown @@ -91,10 +91,16 @@ The following attributes are exported only if there is an authorization rule nam * `default_primary_connection_string` - The primary connection string for the authorization rule `RootManageSharedAccessKey`. +* `default_primary_connection_string_alias` - The alias of the primary connection string for the authorization + rule `RootManageSharedAccessKey`, which is generated when disaster recovery is enabled. + +* `default_primary_key` - The primary access key for the authorization rule `RootManageSharedAccessKey`. + * `default_secondary_connection_string` - The secondary connection string for the authorization rule `RootManageSharedAccessKey`. -* `default_primary_key` - The primary access key for the authorization rule `RootManageSharedAccessKey`. +* `default_secondary_connection_string_alias` - The alias of the secondary connection string for the + authorization rule `RootManageSharedAccessKey`, which is generated when disaster recovery is enabled. * `default_secondary_key` - The secondary access key for the authorization rule `RootManageSharedAccessKey`. diff --git a/website/docs/r/eventhub_namespace_authorization_rule.html.markdown b/website/docs/r/eventhub_namespace_authorization_rule.html.markdown index b6060c91accd7..850691cc355cc 100644 --- a/website/docs/r/eventhub_namespace_authorization_rule.html.markdown +++ b/website/docs/r/eventhub_namespace_authorization_rule.html.markdown @@ -65,14 +65,18 @@ The following attributes are exported: * `id` - The EventHub Namespace Authorization Rule ID. -* `primary_key` - The Primary Key for the Authorization Rule. +* `primary_connection_string_alias` - The alias of the Primary Connection String for the Authorization Rule, which is generated when disaster recovery is enabled. + +* `secondary_connection_string_alias` - The alias of the Secondary Connection String for the Authorization Rule, which is generated when disaster recovery is enabled. * `primary_connection_string` - The Primary Connection String for the Authorization Rule. -* `secondary_key` - The Secondary Key for the Authorization Rule. +* `primary_key` - The Primary Key for the Authorization Rule. * `secondary_connection_string` - The Secondary Connection String for the Authorization Rule. +* `secondary_key` - The Secondary Key for the Authorization Rule. + ## Timeouts From 26b97918ba94c97ca2559d31ea2b9d95253ff2cc Mon Sep 17 00:00:00 2001 From: kt Date: Thu, 7 May 2020 10:31:30 -0700 Subject: [PATCH 141/142] update CHANGELOG.md to include #6708 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3aaf54c72616c..49715f3852d34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,9 @@ IMPROVEMENTS: * `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_eventhub_authorization_rule` - support for the `primary_connection_string_alias` an `secondary_connection_string_alias` propeties [GH-6708] +* `azurerm_eventhub_namespace_authorization_rule` - support for the `primary_connection_string_alias` an `secondary_connection_string_alias` propeties [GH-6708] +* `azurerm_eventhub_namespace` - support for the `default_primary_connection_string_alias` an `_defaultsecondary_connection_string_alias` propeties [GH-6708] * `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] * `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] @@ -20,6 +23,9 @@ IMPROVEMENTS: * `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] +* `data.azurerm_eventhub_authorization_rule` - support for the `primary_connection_string_alias` an `secondary_connection_string_alias` propeties [GH-6708] +* `data.azurerm_eventhub_namespace_authorization_rule` - support for the `primary_connection_string_alias` an `secondary_connection_string_alias` propeties [GH-6708] +* `data.azurerm_eventhub_namespace` - support for the `default_primary_connection_string_alias` an `_defaultsecondary_connection_string_alias` propeties [GH-6708] BUG FIXES: From 2cceff12e442cbc4de5fdaabded200a75ba0b99f Mon Sep 17 00:00:00 2001 From: Tom Harvey Date: Thu, 7 May 2020 19:43:47 +0200 Subject: [PATCH 142/142] updating to include #6817 / formatting --- CHANGELOG.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49715f3852d34..ecf5f77f3a069 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,13 @@ 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] +* **New Resource:** `azurerm_sentinel_alert_rule_scheduled` [GH-6650] IMPROVEMENTS: +* Data Source: `azurerm_eventhub_authorization_rule` - support for the `primary_connection_string_alias` an `secondary_connection_string_alias` propeties [GH-6708] +* Data Source: `azurerm_eventhub_namespace_authorization_rule` - support for the `primary_connection_string_alias` an `secondary_connection_string_alias` propeties [GH-6708] +* Data Source: `azurerm_eventhub_namespace` - support for the `default_primary_connection_string_alias` an `_defaultsecondary_connection_string_alias` propeties [GH-6708] * `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] @@ -23,12 +26,10 @@ IMPROVEMENTS: * `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] -* `data.azurerm_eventhub_authorization_rule` - support for the `primary_connection_string_alias` an `secondary_connection_string_alias` propeties [GH-6708] -* `data.azurerm_eventhub_namespace_authorization_rule` - support for the `primary_connection_string_alias` an `secondary_connection_string_alias` propeties [GH-6708] -* `data.azurerm_eventhub_namespace` - support for the `default_primary_connection_string_alias` an `_defaultsecondary_connection_string_alias` propeties [GH-6708] BUG FIXES: +* provider: raising an error when the environment is set to `AZURESTACKCLOUD` [GH-6817] * `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]