From 954326337bb1eb96ddf1bdd0261712ccaf0b5c1d Mon Sep 17 00:00:00 2001 From: Vladimir Lazarenko Date: Wed, 25 Aug 2021 23:19:29 +0200 Subject: [PATCH] `devtestlabs`: Upgrade API to `2018-09-15` and... (#13074) Fixes #7221 --- .../services/devtestlabs/client/client.go | 2 +- ...st_global_vm_shutdown_schedule_resource.go | 23 +- ...obal_vm_shutdown_schedule_resource_test.go | 2 + .../devtestlabs/dev_test_lab_resource.go | 2 +- .../dev_test_lab_schedule_resource.go | 10 +- ...dev_test_linux_virtual_machine_resource.go | 2 +- .../devtestlabs/dev_test_policy_resource.go | 2 +- .../dev_test_virtual_network_data_source.go | 2 +- .../dev_test_virtual_network_resource.go | 2 +- ...v_test_windows_virtual_machine_resource.go | 2 +- internal/services/devtestlabs/helpers.go | 2 +- .../services/devtestlabs/validate/devtest.go | 2 +- .../dtl/CHANGELOG.md | 0 .../{2016-05-15 => 2018-09-15}/dtl/_meta.json | 4 +- .../dtl/armtemplates.go | 32 +- .../dtl/artifacts.go | 32 +- .../dtl/artifactsources.go | 38 +- .../{2016-05-15 => 2018-09-15}/dtl/client.go | 2 +- .../{2016-05-15 => 2018-09-15}/dtl/costs.go | 4 +- .../dtl/customimages.go | 115 +- .../{2016-05-15 => 2018-09-15}/dtl/disks.go | 121 +- .../{2016-05-15 => 2018-09-15}/dtl/enums.go | 44 +- .../dtl/environments.go | 117 +- .../dtl/formulas.go | 132 +- .../dtl/galleryimages.go | 28 +- .../dtl/globalschedules.go | 70 +- .../{2016-05-15 => 2018-09-15}/dtl/labs.go | 193 +- .../{2016-05-15 => 2018-09-15}/dtl/models.go | 9748 ++++++++++------- .../dtl/notificationchannels.go | 54 +- .../dtl/operations.go | 2 +- .../dtl/policies.go | 38 +- .../dtl/policysets.go | 2 +- .../dtl/provideroperations.go | 2 +- .../dtl/schedules.go | 62 +- .../{2016-05-15 => 2018-09-15}/dtl/secrets.go | 149 +- .../mgmt/2018-09-15/dtl/servicefabrics.go | 758 ++ .../2018-09-15/dtl/servicefabricschedules.go | 597 + .../dtl/servicerunners.go | 138 +- .../{2016-05-15 => 2018-09-15}/dtl/users.go | 70 +- .../{2016-05-15 => 2018-09-15}/dtl/version.go | 2 +- .../dtl/virtualmachines.go | 533 +- .../dtl/virtualmachineschedules.go | 40 +- .../dtl/virtualnetworks.go | 38 +- vendor/modules.txt | 2 +- ..._global_vm_shutdown_schedule.html.markdown | 2 + 45 files changed, 8320 insertions(+), 4902 deletions(-) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/CHANGELOG.md (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/_meta.json (87%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/armtemplates.go (91%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/artifacts.go (94%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/artifactsources.go (94%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/client.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/costs.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/customimages.go (79%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/disks.go (84%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/enums.go (91%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/environments.go (79%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/formulas.go (78%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/galleryimages.go (87%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/globalschedules.go (93%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/labs.go (86%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/models.go (69%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/notificationchannels.go (93%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/operations.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/policies.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/policysets.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/provideroperations.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/schedules.go (93%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/secrets.go (76%) create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/servicefabrics.go create mode 100644 vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/servicefabricschedules.go rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/servicerunners.go (65%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/users.go (91%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/version.go (90%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/virtualmachines.go (67%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/virtualmachineschedules.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/{2016-05-15 => 2018-09-15}/dtl/virtualnetworks.go (94%) diff --git a/internal/services/devtestlabs/client/client.go b/internal/services/devtestlabs/client/client.go index 38729a220ef6..8b0dd55dca1c 100644 --- a/internal/services/devtestlabs/client/client.go +++ b/internal/services/devtestlabs/client/client.go @@ -1,7 +1,7 @@ package client import ( - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" "github.com/hashicorp/terraform-provider-azurerm/internal/common" ) diff --git a/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource.go b/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource.go index 29e0defcbeac..1e19d458db38 100644 --- a/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource.go +++ b/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -88,6 +88,10 @@ func resourceDevTestGlobalVMShutdownSchedule() *pluginsdk.Resource { Type: pluginsdk.TypeString, Optional: true, }, + "email": { + Type: pluginsdk.TypeString, + Optional: true, + }, }, }, }, @@ -257,18 +261,20 @@ func expandDevTestGlobalVMShutdownScheduleNotificationSettings(d *pluginsdk.Reso notificationSettingsConfig := notificationSettingsConfigs[0].(map[string]interface{}) webhookUrl := notificationSettingsConfig["webhook_url"].(string) timeInMinutes := int32(notificationSettingsConfig["time_in_minutes"].(int)) + email := notificationSettingsConfig["email"].(string) - var notificationStatus dtl.NotificationStatus + var notificationStatus dtl.EnableStatus if notificationSettingsConfig["enabled"].(bool) { - notificationStatus = dtl.NotificationStatusEnabled + notificationStatus = dtl.EnableStatusEnabled } else { - notificationStatus = dtl.NotificationStatusDisabled + notificationStatus = dtl.EnableStatusDisabled } return &dtl.NotificationSettings{ - WebhookURL: &webhookUrl, - TimeInMinutes: &timeInMinutes, - Status: notificationStatus, + WebhookURL: &webhookUrl, + TimeInMinutes: &timeInMinutes, + Status: notificationStatus, + EmailRecipient: &email, } } @@ -287,7 +293,8 @@ func flattenDevTestGlobalVMShutdownScheduleNotificationSettings(notificationSett result["time_in_minutes"] = *notificationSettings.TimeInMinutes } - result["enabled"] = notificationSettings.Status == dtl.NotificationStatusEnabled + result["enabled"] = notificationSettings.Status == dtl.EnableStatusEnabled + result["email"] = notificationSettings.EmailRecipient return []interface{}{result} } diff --git a/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource_test.go b/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource_test.go index f81df1f18279..8fe3fa1d8021 100644 --- a/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource_test.go +++ b/internal/services/devtestlabs/dev_test_global_vm_shutdown_schedule_resource_test.go @@ -55,6 +55,7 @@ func TestAccDevTestGlobalVMShutdownSchedule_autoShutdownComplete(t *testing.T) { check.That(data.ResourceName).Key("notification_settings.0.enabled").HasValue("true"), check.That(data.ResourceName).Key("notification_settings.0.time_in_minutes").HasValue("15"), check.That(data.ResourceName).Key("notification_settings.0.webhook_url").HasValue("https://www.bing.com/2/4"), + check.That(data.ResourceName).Key("notification_settings.0.email").HasValue("alerts@devtest.com"), check.That(data.ResourceName).Key("daily_recurrence_time").HasValue("1100"), check.That(data.ResourceName).Key("tags.%").HasValue("1"), check.That(data.ResourceName).Key("tags.Environment").HasValue("Production"), @@ -217,6 +218,7 @@ resource "azurerm_dev_test_global_vm_shutdown_schedule" "test" { notification_settings { time_in_minutes = 15 webhook_url = "https://www.bing.com/2/4" + email = "alerts@devtest.com" enabled = true } diff --git a/internal/services/devtestlabs/dev_test_lab_resource.go b/internal/services/devtestlabs/dev_test_lab_resource.go index 3441b92bb859..25f20fcf0cb5 100644 --- a/internal/services/devtestlabs/dev_test_lab_resource.go +++ b/internal/services/devtestlabs/dev_test_lab_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/devtestlabs/dev_test_lab_schedule_resource.go b/internal/services/devtestlabs/dev_test_lab_schedule_resource.go index e880f0142a69..21fea4ef490c 100644 --- a/internal/services/devtestlabs/dev_test_lab_schedule_resource.go +++ b/internal/services/devtestlabs/dev_test_lab_schedule_resource.go @@ -5,7 +5,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" @@ -153,10 +153,10 @@ func resourceDevTestLabSchedules() *pluginsdk.Resource { "status": { Type: pluginsdk.TypeString, Optional: true, - Default: dtl.NotificationStatusDisabled, + Default: dtl.EnableStatusDisabled, ValidateFunc: validation.StringInSlice([]string{ - string(dtl.NotificationStatusEnabled), - string(dtl.NotificationStatusDisabled), + string(dtl.EnableStatusEnabled), + string(dtl.EnableStatusDisabled), }, false), }, "time_in_minutes": { @@ -430,7 +430,7 @@ func expandDevTestScheduleNotificationSettings(d *pluginsdk.ResourceData) *dtl.N webhookUrl := notificationSettingsConfig["webhook_url"].(string) timeInMinutes := int32(notificationSettingsConfig["time_in_minutes"].(int)) - notificationStatus := dtl.NotificationStatus(notificationSettingsConfig["status"].(string)) + notificationStatus := dtl.EnableStatus(notificationSettingsConfig["status"].(string)) return &dtl.NotificationSettings{ WebhookURL: &webhookUrl, diff --git a/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go b/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go index 8fb5e3c0ef3d..bf60bbe7c8b1 100644 --- a/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go +++ b/internal/services/devtestlabs/dev_test_linux_virtual_machine_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/devtestlabs/dev_test_policy_resource.go b/internal/services/devtestlabs/dev_test_policy_resource.go index d94f76ffa378..565fd45ad465 100644 --- a/internal/services/devtestlabs/dev_test_policy_resource.go +++ b/internal/services/devtestlabs/dev_test_policy_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/devtestlabs/dev_test_virtual_network_data_source.go b/internal/services/devtestlabs/dev_test_virtual_network_data_source.go index 4ac6fda4d5ea..b4917bdd0d06 100644 --- a/internal/services/devtestlabs/dev_test_virtual_network_data_source.go +++ b/internal/services/devtestlabs/dev_test_virtual_network_data_source.go @@ -4,7 +4,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" "github.com/hashicorp/terraform-provider-azurerm/internal/services/devtestlabs/validate" diff --git a/internal/services/devtestlabs/dev_test_virtual_network_resource.go b/internal/services/devtestlabs/dev_test_virtual_network_resource.go index 6c5f5ebdd691..ba856db6d506 100644 --- a/internal/services/devtestlabs/dev_test_virtual_network_resource.go +++ b/internal/services/devtestlabs/dev_test_virtual_network_resource.go @@ -6,7 +6,7 @@ import ( "regexp" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go b/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go index 3fd136753444..f935784435b8 100644 --- a/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go +++ b/internal/services/devtestlabs/dev_test_windows_virtual_machine_resource.go @@ -5,7 +5,7 @@ import ( "log" "time" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" "github.com/hashicorp/terraform-provider-azurerm/helpers/azure" "github.com/hashicorp/terraform-provider-azurerm/helpers/tf" "github.com/hashicorp/terraform-provider-azurerm/internal/clients" diff --git a/internal/services/devtestlabs/helpers.go b/internal/services/devtestlabs/helpers.go index 79537245b9af..938dde67444a 100644 --- a/internal/services/devtestlabs/helpers.go +++ b/internal/services/devtestlabs/helpers.go @@ -1,7 +1,7 @@ package devtestlabs import ( - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" "github.com/hashicorp/terraform-provider-azurerm/helpers/validate" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" diff --git a/internal/services/devtestlabs/validate/devtest.go b/internal/services/devtestlabs/validate/devtest.go index 0274f41d1727..3f54d0d7e3f9 100644 --- a/internal/services/devtestlabs/validate/devtest.go +++ b/internal/services/devtestlabs/validate/devtest.go @@ -4,7 +4,7 @@ import ( "fmt" "regexp" - "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl" + "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/pluginsdk" "github.com/hashicorp/terraform-provider-azurerm/internal/tf/validation" ) diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/CHANGELOG.md b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/CHANGELOG.md similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/CHANGELOG.md rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/CHANGELOG.md diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/_meta.json b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/_meta.json similarity index 87% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/_meta.json rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/_meta.json index 0c1dcc9280c8..0496731125e9 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/_meta.json +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/_meta.json @@ -1,10 +1,10 @@ { "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", "readme": "/_/azure-rest-api-specs/specification/devtestlabs/resource-manager/readme.md", - "tag": "package-2016-05", + "tag": "package-2018-09", "use": "@microsoft.azure/autorest.go@2.1.183", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-2016-05 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/devtestlabs/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.183 --tag=package-2018-09 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/devtestlabs/resource-manager/readme.md", "additional_properties": { "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION" } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/armtemplates.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/armtemplates.go similarity index 91% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/armtemplates.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/armtemplates.go index 10a1473e25a1..b00e5d365bde 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/armtemplates.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/armtemplates.go @@ -35,7 +35,7 @@ func NewArmTemplatesClientWithBaseURI(baseURI string, subscriptionID string) Arm // resourceGroupName - the name of the resource group. // labName - the name of the lab. // artifactSourceName - the name of the artifact source. -// name - the name of the azure Resource Manager template. +// name - the name of the azure resource manager template. // expand - specify the $expand query. Example: 'properties($select=displayName)' func (client ArmTemplatesClient) Get(ctx context.Context, resourceGroupName string, labName string, artifactSourceName string, name string, expand string) (result ArmTemplate, err error) { if tracing.IsEnabled() { @@ -80,7 +80,7 @@ func (client ArmTemplatesClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -120,16 +120,16 @@ func (client ArmTemplatesClient) GetResponder(resp *http.Response) (result ArmTe // labName - the name of the lab. // artifactSourceName - the name of the artifact source. // expand - specify the $expand query. Example: 'properties($select=displayName)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client ArmTemplatesClient) List(ctx context.Context, resourceGroupName string, labName string, artifactSourceName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationArmTemplatePage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client ArmTemplatesClient) List(ctx context.Context, resourceGroupName string, labName string, artifactSourceName string, expand string, filter string, top *int32, orderby string) (result ArmTemplateListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ArmTemplatesClient.List") defer func() { sc := -1 - if result.rwcat.Response.Response != nil { - sc = result.rwcat.Response.Response.StatusCode + if result.atl.Response.Response != nil { + sc = result.atl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -143,17 +143,17 @@ func (client ArmTemplatesClient) List(ctx context.Context, resourceGroupName str resp, err := client.ListSender(req) if err != nil { - result.rwcat.Response = autorest.Response{Response: resp} + result.atl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.ArmTemplatesClient", "List", resp, "Failure sending request") return } - result.rwcat, err = client.ListResponder(resp) + result.atl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.ArmTemplatesClient", "List", resp, "Failure responding to request") return } - if result.rwcat.hasNextLink() && result.rwcat.IsEmpty() { + if result.atl.hasNextLink() && result.atl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -170,7 +170,7 @@ func (client ArmTemplatesClient) ListPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -203,7 +203,7 @@ func (client ArmTemplatesClient) ListSender(req *http.Request) (*http.Response, // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client ArmTemplatesClient) ListResponder(resp *http.Response) (result ResponseWithContinuationArmTemplate, err error) { +func (client ArmTemplatesClient) ListResponder(resp *http.Response) (result ArmTemplateList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -214,8 +214,8 @@ func (client ArmTemplatesClient) ListResponder(resp *http.Response) (result Resp } // listNextResults retrieves the next set of results, if any. -func (client ArmTemplatesClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationArmTemplate) (result ResponseWithContinuationArmTemplate, err error) { - req, err := lastResults.responseWithContinuationArmTemplatePreparer(ctx) +func (client ArmTemplatesClient) listNextResults(ctx context.Context, lastResults ArmTemplateList) (result ArmTemplateList, err error) { + req, err := lastResults.armTemplateListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.ArmTemplatesClient", "listNextResults", nil, "Failure preparing next results request") } @@ -235,7 +235,7 @@ func (client ArmTemplatesClient) listNextResults(ctx context.Context, lastResult } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ArmTemplatesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, artifactSourceName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationArmTemplateIterator, err error) { +func (client ArmTemplatesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, artifactSourceName string, expand string, filter string, top *int32, orderby string) (result ArmTemplateListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ArmTemplatesClient.List") defer func() { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/artifacts.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/artifacts.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/artifacts.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/artifacts.go index 0adb32ac4388..75747df41c8c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/artifacts.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/artifacts.go @@ -81,7 +81,7 @@ func (client ArtifactsClient) GenerateArmTemplatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client ArtifactsClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -204,16 +204,16 @@ func (client ArtifactsClient) GetResponder(resp *http.Response) (result Artifact // labName - the name of the lab. // artifactSourceName - the name of the artifact source. // expand - specify the $expand query. Example: 'properties($select=title)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client ArtifactsClient) List(ctx context.Context, resourceGroupName string, labName string, artifactSourceName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationArtifactPage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client ArtifactsClient) List(ctx context.Context, resourceGroupName string, labName string, artifactSourceName string, expand string, filter string, top *int32, orderby string) (result ArtifactListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ArtifactsClient.List") defer func() { sc := -1 - if result.rwca.Response.Response != nil { - sc = result.rwca.Response.Response.StatusCode + if result.al.Response.Response != nil { + sc = result.al.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -227,17 +227,17 @@ func (client ArtifactsClient) List(ctx context.Context, resourceGroupName string resp, err := client.ListSender(req) if err != nil { - result.rwca.Response = autorest.Response{Response: resp} + result.al.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.ArtifactsClient", "List", resp, "Failure sending request") return } - result.rwca, err = client.ListResponder(resp) + result.al, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.ArtifactsClient", "List", resp, "Failure responding to request") return } - if result.rwca.hasNextLink() && result.rwca.IsEmpty() { + if result.al.hasNextLink() && result.al.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -254,7 +254,7 @@ func (client ArtifactsClient) ListPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -287,7 +287,7 @@ func (client ArtifactsClient) ListSender(req *http.Request) (*http.Response, err // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client ArtifactsClient) ListResponder(resp *http.Response) (result ResponseWithContinuationArtifact, err error) { +func (client ArtifactsClient) ListResponder(resp *http.Response) (result ArtifactList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -298,8 +298,8 @@ func (client ArtifactsClient) ListResponder(resp *http.Response) (result Respons } // listNextResults retrieves the next set of results, if any. -func (client ArtifactsClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationArtifact) (result ResponseWithContinuationArtifact, err error) { - req, err := lastResults.responseWithContinuationArtifactPreparer(ctx) +func (client ArtifactsClient) listNextResults(ctx context.Context, lastResults ArtifactList) (result ArtifactList, err error) { + req, err := lastResults.artifactListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.ArtifactsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -319,7 +319,7 @@ func (client ArtifactsClient) listNextResults(ctx context.Context, lastResults R } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ArtifactsClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, artifactSourceName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationArtifactIterator, err error) { +func (client ArtifactsClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, artifactSourceName string, expand string, filter string, top *int32, orderby string) (result ArtifactListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ArtifactsClient.List") defer func() { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/artifactsources.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/artifactsources.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/artifactsources.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/artifactsources.go index 5250a027a3cc..212a4609c836 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/artifactsources.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/artifactsources.go @@ -85,7 +85,7 @@ func (client ArtifactSourcesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +165,7 @@ func (client ArtifactSourcesClient) DeletePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -243,7 +243,7 @@ func (client ArtifactSourcesClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -282,16 +282,16 @@ func (client ArtifactSourcesClient) GetResponder(resp *http.Response) (result Ar // resourceGroupName - the name of the resource group. // labName - the name of the lab. // expand - specify the $expand query. Example: 'properties($select=displayName)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client ArtifactSourcesClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationArtifactSourcePage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client ArtifactSourcesClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ArtifactSourceListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ArtifactSourcesClient.List") defer func() { sc := -1 - if result.rwcas.Response.Response != nil { - sc = result.rwcas.Response.Response.StatusCode + if result.asl.Response.Response != nil { + sc = result.asl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -305,17 +305,17 @@ func (client ArtifactSourcesClient) List(ctx context.Context, resourceGroupName resp, err := client.ListSender(req) if err != nil { - result.rwcas.Response = autorest.Response{Response: resp} + result.asl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.ArtifactSourcesClient", "List", resp, "Failure sending request") return } - result.rwcas, err = client.ListResponder(resp) + result.asl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.ArtifactSourcesClient", "List", resp, "Failure responding to request") return } - if result.rwcas.hasNextLink() && result.rwcas.IsEmpty() { + if result.asl.hasNextLink() && result.asl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -331,7 +331,7 @@ func (client ArtifactSourcesClient) ListPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -364,7 +364,7 @@ func (client ArtifactSourcesClient) ListSender(req *http.Request) (*http.Respons // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client ArtifactSourcesClient) ListResponder(resp *http.Response) (result ResponseWithContinuationArtifactSource, err error) { +func (client ArtifactSourcesClient) ListResponder(resp *http.Response) (result ArtifactSourceList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -375,8 +375,8 @@ func (client ArtifactSourcesClient) ListResponder(resp *http.Response) (result R } // listNextResults retrieves the next set of results, if any. -func (client ArtifactSourcesClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationArtifactSource) (result ResponseWithContinuationArtifactSource, err error) { - req, err := lastResults.responseWithContinuationArtifactSourcePreparer(ctx) +func (client ArtifactSourcesClient) listNextResults(ctx context.Context, lastResults ArtifactSourceList) (result ArtifactSourceList, err error) { + req, err := lastResults.artifactSourceListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.ArtifactSourcesClient", "listNextResults", nil, "Failure preparing next results request") } @@ -396,7 +396,7 @@ func (client ArtifactSourcesClient) listNextResults(ctx context.Context, lastRes } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ArtifactSourcesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationArtifactSourceIterator, err error) { +func (client ArtifactSourcesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ArtifactSourceListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ArtifactSourcesClient.List") defer func() { @@ -411,7 +411,7 @@ func (client ArtifactSourcesClient) ListComplete(ctx context.Context, resourceGr return } -// Update modify properties of artifact sources. +// Update allows modifying tags of artifact sources. All other properties will be ignored. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. @@ -459,7 +459,7 @@ func (client ArtifactSourcesClient) UpdatePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/client.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/client.go index 7989df04ea89..c1bee7292bab 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/client.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/client.go @@ -1,4 +1,4 @@ -// Package dtl implements the Azure ARM Dtl service API version 2016-05-15. +// Package dtl implements the Azure ARM Dtl service API version 2018-09-15. // // The DevTest Labs Client. package dtl diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/costs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/costs.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/costs.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/costs.go index 33533c19a0b1..4552ebf48d28 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/costs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/costs.go @@ -85,7 +85,7 @@ func (client CostsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -166,7 +166,7 @@ func (client CostsClient) GetPreparer(ctx context.Context, resourceGroupName str "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/customimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/customimages.go similarity index 79% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/customimages.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/customimages.go index 530c28503ebc..88e5473d283a 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/customimages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/customimages.go @@ -78,7 +78,7 @@ func (client CustomImagesClient) CreateOrUpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -160,7 +160,7 @@ func (client CustomImagesClient) DeletePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -247,7 +247,7 @@ func (client CustomImagesClient) GetPreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -286,16 +286,16 @@ func (client CustomImagesClient) GetResponder(resp *http.Response) (result Custo // resourceGroupName - the name of the resource group. // labName - the name of the lab. // expand - specify the $expand query. Example: 'properties($select=vm)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client CustomImagesClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationCustomImagePage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client CustomImagesClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result CustomImageListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CustomImagesClient.List") defer func() { sc := -1 - if result.rwcci.Response.Response != nil { - sc = result.rwcci.Response.Response.StatusCode + if result.cil.Response.Response != nil { + sc = result.cil.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -309,17 +309,17 @@ func (client CustomImagesClient) List(ctx context.Context, resourceGroupName str resp, err := client.ListSender(req) if err != nil { - result.rwcci.Response = autorest.Response{Response: resp} + result.cil.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.CustomImagesClient", "List", resp, "Failure sending request") return } - result.rwcci, err = client.ListResponder(resp) + result.cil, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.CustomImagesClient", "List", resp, "Failure responding to request") return } - if result.rwcci.hasNextLink() && result.rwcci.IsEmpty() { + if result.cil.hasNextLink() && result.cil.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -335,7 +335,7 @@ func (client CustomImagesClient) ListPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -368,7 +368,7 @@ func (client CustomImagesClient) ListSender(req *http.Request) (*http.Response, // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client CustomImagesClient) ListResponder(resp *http.Response) (result ResponseWithContinuationCustomImage, err error) { +func (client CustomImagesClient) ListResponder(resp *http.Response) (result CustomImageList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -379,8 +379,8 @@ func (client CustomImagesClient) ListResponder(resp *http.Response) (result Resp } // listNextResults retrieves the next set of results, if any. -func (client CustomImagesClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationCustomImage) (result ResponseWithContinuationCustomImage, err error) { - req, err := lastResults.responseWithContinuationCustomImagePreparer(ctx) +func (client CustomImagesClient) listNextResults(ctx context.Context, lastResults CustomImageList) (result CustomImageList, err error) { + req, err := lastResults.customImageListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.CustomImagesClient", "listNextResults", nil, "Failure preparing next results request") } @@ -400,7 +400,7 @@ func (client CustomImagesClient) listNextResults(ctx context.Context, lastResult } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client CustomImagesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationCustomImageIterator, err error) { +func (client CustomImagesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result CustomImageListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/CustomImagesClient.List") defer func() { @@ -414,3 +414,84 @@ func (client CustomImagesClient) ListComplete(ctx context.Context, resourceGroup result.page, err = client.List(ctx, resourceGroupName, labName, expand, filter, top, orderby) return } + +// Update allows modifying tags of custom images. All other properties will be ignored. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// name - the name of the custom image. +// customImage - a custom image. +func (client CustomImagesClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, customImage CustomImageFragment) (result CustomImage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomImagesClient.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, labName, name, customImage) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.CustomImagesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.CustomImagesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.CustomImagesClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CustomImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, labName string, name string, customImage CustomImageFragment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-09-15" + 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.DevTestLab/labs/{labName}/customimages/{name}", pathParameters), + autorest.WithJSON(customImage), + 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 CustomImagesClient) 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 CustomImagesClient) UpdateResponder(resp *http.Response) (result CustomImage, err error) { + err = autorest.Respond( + resp, + 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/devtestlabs/mgmt/2016-05-15/dtl/disks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/disks.go similarity index 84% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/disks.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/disks.go index aa69a488e6a0..dbcff32f2e41 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/disks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/disks.go @@ -74,7 +74,7 @@ func (client DisksClient) AttachPreparer(ctx context.Context, resourceGroupName "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -248,7 +248,7 @@ func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -331,7 +331,7 @@ func (client DisksClient) DetachPreparer(ctx context.Context, resourceGroupName "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -422,7 +422,7 @@ func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName str "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -462,16 +462,16 @@ func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err er // labName - the name of the lab. // userName - the name of the user profile. // expand - specify the $expand query. Example: 'properties($select=diskType)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client DisksClient) List(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationDiskPage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client DisksClient) List(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result DiskListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List") defer func() { sc := -1 - if result.rwcd.Response.Response != nil { - sc = result.rwcd.Response.Response.StatusCode + if result.dl.Response.Response != nil { + sc = result.dl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -485,17 +485,17 @@ func (client DisksClient) List(ctx context.Context, resourceGroupName string, la resp, err := client.ListSender(req) if err != nil { - result.rwcd.Response = autorest.Response{Response: resp} + result.dl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.DisksClient", "List", resp, "Failure sending request") return } - result.rwcd, err = client.ListResponder(resp) + result.dl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.DisksClient", "List", resp, "Failure responding to request") return } - if result.rwcd.hasNextLink() && result.rwcd.IsEmpty() { + if result.dl.hasNextLink() && result.dl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -512,7 +512,7 @@ func (client DisksClient) ListPreparer(ctx context.Context, resourceGroupName st "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -545,7 +545,7 @@ func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client DisksClient) ListResponder(resp *http.Response) (result ResponseWithContinuationDisk, err error) { +func (client DisksClient) ListResponder(resp *http.Response) (result DiskList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -556,8 +556,8 @@ func (client DisksClient) ListResponder(resp *http.Response) (result ResponseWit } // listNextResults retrieves the next set of results, if any. -func (client DisksClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationDisk) (result ResponseWithContinuationDisk, err error) { - req, err := lastResults.responseWithContinuationDiskPreparer(ctx) +func (client DisksClient) listNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) { + req, err := lastResults.diskListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.DisksClient", "listNextResults", nil, "Failure preparing next results request") } @@ -577,7 +577,7 @@ func (client DisksClient) listNextResults(ctx context.Context, lastResults Respo } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client DisksClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationDiskIterator, err error) { +func (client DisksClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result DiskListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List") defer func() { @@ -591,3 +591,86 @@ func (client DisksClient) ListComplete(ctx context.Context, resourceGroupName st result.page, err = client.List(ctx, resourceGroupName, labName, userName, expand, filter, top, orderby) return } + +// Update allows modifying tags of disks. All other properties will be ignored. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// name - the name of the disk. +// disk - a Disk. +func (client DisksClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, name string, disk DiskFragment) (result Disk, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.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, labName, userName, name, disk) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.DisksClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.DisksClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.DisksClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string, disk DiskFragment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + 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.DevTestLab/labs/{labName}/users/{userName}/disks/{name}", pathParameters), + autorest.WithJSON(disk), + 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 DisksClient) 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 DisksClient) UpdateResponder(resp *http.Response) (result Disk, err error) { + err = autorest.Respond( + resp, + 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/devtestlabs/mgmt/2016-05-15/dtl/enums.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/enums.go similarity index 91% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/enums.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/enums.go index 8b7803aa51e8..34ee9ac80296 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/enums.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/enums.go @@ -70,6 +70,21 @@ func PossibleEnableStatusValues() []EnableStatus { return []EnableStatus{EnableStatusDisabled, EnableStatusEnabled} } +// EnvironmentPermission enumerates the values for environment permission. +type EnvironmentPermission string + +const ( + // Contributor ... + Contributor EnvironmentPermission = "Contributor" + // Reader ... + Reader EnvironmentPermission = "Reader" +) + +// PossibleEnvironmentPermissionValues returns an array of possible values for the EnvironmentPermission const type. +func PossibleEnvironmentPermissionValues() []EnvironmentPermission { + return []EnvironmentPermission{Contributor, Reader} +} + // FileUploadOptions enumerates the values for file upload options. type FileUploadOptions string @@ -229,21 +244,6 @@ func PossibleNotificationChannelEventTypeValues() []NotificationChannelEventType return []NotificationChannelEventType{AutoShutdown, Cost} } -// NotificationStatus enumerates the values for notification status. -type NotificationStatus string - -const ( - // NotificationStatusDisabled ... - NotificationStatusDisabled NotificationStatus = "Disabled" - // NotificationStatusEnabled ... - NotificationStatusEnabled NotificationStatus = "Enabled" -) - -// PossibleNotificationStatusValues returns an array of possible values for the NotificationStatus const type. -func PossibleNotificationStatusValues() []NotificationStatus { - return []NotificationStatus{NotificationStatusDisabled, NotificationStatusEnabled} -} - // PolicyEvaluatorType enumerates the values for policy evaluator type. type PolicyEvaluatorType string @@ -263,6 +263,8 @@ func PossiblePolicyEvaluatorTypeValues() []PolicyEvaluatorType { type PolicyFactName string const ( + // PolicyFactNameEnvironmentTemplate ... + PolicyFactNameEnvironmentTemplate PolicyFactName = "EnvironmentTemplate" // PolicyFactNameGalleryImage ... PolicyFactNameGalleryImage PolicyFactName = "GalleryImage" // PolicyFactNameLabPremiumVMCount ... @@ -273,6 +275,8 @@ const ( PolicyFactNameLabVMCount PolicyFactName = "LabVmCount" // PolicyFactNameLabVMSize ... PolicyFactNameLabVMSize PolicyFactName = "LabVmSize" + // PolicyFactNameScheduleEditPermission ... + PolicyFactNameScheduleEditPermission PolicyFactName = "ScheduleEditPermission" // PolicyFactNameUserOwnedLabPremiumVMCount ... PolicyFactNameUserOwnedLabPremiumVMCount PolicyFactName = "UserOwnedLabPremiumVmCount" // PolicyFactNameUserOwnedLabVMCount ... @@ -283,7 +287,7 @@ const ( // PossiblePolicyFactNameValues returns an array of possible values for the PolicyFactName const type. func PossiblePolicyFactNameValues() []PolicyFactName { - return []PolicyFactName{PolicyFactNameGalleryImage, PolicyFactNameLabPremiumVMCount, PolicyFactNameLabTargetCost, PolicyFactNameLabVMCount, PolicyFactNameLabVMSize, PolicyFactNameUserOwnedLabPremiumVMCount, PolicyFactNameUserOwnedLabVMCount, PolicyFactNameUserOwnedLabVMCountInSubnet} + return []PolicyFactName{PolicyFactNameEnvironmentTemplate, PolicyFactNameGalleryImage, PolicyFactNameLabPremiumVMCount, PolicyFactNameLabTargetCost, PolicyFactNameLabVMCount, PolicyFactNameLabVMSize, PolicyFactNameScheduleEditPermission, PolicyFactNameUserOwnedLabPremiumVMCount, PolicyFactNameUserOwnedLabVMCount, PolicyFactNameUserOwnedLabVMCountInSubnet} } // PolicyStatus enumerates the values for policy status. @@ -354,11 +358,13 @@ const ( Premium StorageType = "Premium" // Standard ... Standard StorageType = "Standard" + // StandardSSD ... + StandardSSD StorageType = "StandardSSD" ) // PossibleStorageTypeValues returns an array of possible values for the StorageType const type. func PossibleStorageTypeValues() []StorageType { - return []StorageType{Premium, Standard} + return []StorageType{Premium, Standard, StandardSSD} } // TargetCostStatus enumerates the values for target cost status. @@ -416,11 +422,13 @@ const ( FromCustomImage VirtualMachineCreationSource = "FromCustomImage" // FromGalleryImage ... FromGalleryImage VirtualMachineCreationSource = "FromGalleryImage" + // FromSharedGalleryImage ... + FromSharedGalleryImage VirtualMachineCreationSource = "FromSharedGalleryImage" ) // PossibleVirtualMachineCreationSourceValues returns an array of possible values for the VirtualMachineCreationSource const type. func PossibleVirtualMachineCreationSourceValues() []VirtualMachineCreationSource { - return []VirtualMachineCreationSource{FromCustomImage, FromGalleryImage} + return []VirtualMachineCreationSource{FromCustomImage, FromGalleryImage, FromSharedGalleryImage} } // WindowsOsState enumerates the values for windows os state. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/environments.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/environments.go similarity index 79% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/environments.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/environments.go index 5741b4d52a9a..0b5e311284ce 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/environments.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/environments.go @@ -80,7 +80,7 @@ func (client EnvironmentsClient) CreateOrUpdatePreparer(ctx context.Context, res "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,7 +164,7 @@ func (client EnvironmentsClient) DeletePreparer(ctx context.Context, resourceGro "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -253,7 +253,7 @@ func (client EnvironmentsClient) GetPreparer(ctx context.Context, resourceGroupN "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -293,16 +293,16 @@ func (client EnvironmentsClient) GetResponder(resp *http.Response) (result Envir // labName - the name of the lab. // userName - the name of the user profile. // expand - specify the $expand query. Example: 'properties($select=deploymentProperties)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client EnvironmentsClient) List(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationDtlEnvironmentPage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client EnvironmentsClient) List(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result EnvironmentListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EnvironmentsClient.List") defer func() { sc := -1 - if result.rwcde.Response.Response != nil { - sc = result.rwcde.Response.Response.StatusCode + if result.el.Response.Response != nil { + sc = result.el.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -316,17 +316,17 @@ func (client EnvironmentsClient) List(ctx context.Context, resourceGroupName str resp, err := client.ListSender(req) if err != nil { - result.rwcde.Response = autorest.Response{Response: resp} + result.el.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.EnvironmentsClient", "List", resp, "Failure sending request") return } - result.rwcde, err = client.ListResponder(resp) + result.el, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.EnvironmentsClient", "List", resp, "Failure responding to request") return } - if result.rwcde.hasNextLink() && result.rwcde.IsEmpty() { + if result.el.hasNextLink() && result.el.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -343,7 +343,7 @@ func (client EnvironmentsClient) ListPreparer(ctx context.Context, resourceGroup "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -376,7 +376,7 @@ func (client EnvironmentsClient) ListSender(req *http.Request) (*http.Response, // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client EnvironmentsClient) ListResponder(resp *http.Response) (result ResponseWithContinuationDtlEnvironment, err error) { +func (client EnvironmentsClient) ListResponder(resp *http.Response) (result EnvironmentList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -387,8 +387,8 @@ func (client EnvironmentsClient) ListResponder(resp *http.Response) (result Resp } // listNextResults retrieves the next set of results, if any. -func (client EnvironmentsClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationDtlEnvironment) (result ResponseWithContinuationDtlEnvironment, err error) { - req, err := lastResults.responseWithContinuationDtlEnvironmentPreparer(ctx) +func (client EnvironmentsClient) listNextResults(ctx context.Context, lastResults EnvironmentList) (result EnvironmentList, err error) { + req, err := lastResults.environmentListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.EnvironmentsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -408,7 +408,7 @@ func (client EnvironmentsClient) listNextResults(ctx context.Context, lastResult } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client EnvironmentsClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationDtlEnvironmentIterator, err error) { +func (client EnvironmentsClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result EnvironmentListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EnvironmentsClient.List") defer func() { @@ -422,3 +422,86 @@ func (client EnvironmentsClient) ListComplete(ctx context.Context, resourceGroup result.page, err = client.List(ctx, resourceGroupName, labName, userName, expand, filter, top, orderby) return } + +// Update allows modifying tags of environments. All other properties will be ignored. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// name - the name of the environment. +// dtlEnvironment - an environment, which is essentially an ARM template deployment. +func (client EnvironmentsClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, name string, dtlEnvironment EnvironmentFragment) (result Environment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EnvironmentsClient.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, labName, userName, name, dtlEnvironment) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.EnvironmentsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.EnvironmentsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.EnvironmentsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client EnvironmentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string, dtlEnvironment EnvironmentFragment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + 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.DevTestLab/labs/{labName}/users/{userName}/environments/{name}", pathParameters), + autorest.WithJSON(dtlEnvironment), + 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 EnvironmentsClient) 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 EnvironmentsClient) UpdateResponder(resp *http.Response) (result Environment, err error) { + err = autorest.Respond( + resp, + 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/devtestlabs/mgmt/2016-05-15/dtl/formulas.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/formulas.go similarity index 78% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/formulas.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/formulas.go index 9c0497f40ef5..08c764dbcef3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/formulas.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/formulas.go @@ -31,7 +31,7 @@ func NewFormulasClientWithBaseURI(baseURI string, subscriptionID string) Formula return FormulasClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create or replace an existing Formula. This operation can take a while to complete. +// CreateOrUpdate create or replace an existing formula. This operation can take a while to complete. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. @@ -50,20 +50,7 @@ func (client FormulasClient) CreateOrUpdate(ctx context.Context, resourceGroupNa } if err := validation.Validate([]validation.Validation{ {TargetValue: formula, - Constraints: []validation.Constraint{{Target: "formula.FormulaProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "formula.FormulaProperties.FormulaContent", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "formula.FormulaProperties.FormulaContent.LabVirtualMachineCreationParameterProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "formula.FormulaProperties.FormulaContent.LabVirtualMachineCreationParameterProperties.ApplicableSchedule", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "formula.FormulaProperties.FormulaContent.LabVirtualMachineCreationParameterProperties.ApplicableSchedule.ApplicableScheduleProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "formula.FormulaProperties.FormulaContent.LabVirtualMachineCreationParameterProperties.ApplicableSchedule.ApplicableScheduleProperties.LabVmsShutdown", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "formula.FormulaProperties.FormulaContent.LabVirtualMachineCreationParameterProperties.ApplicableSchedule.ApplicableScheduleProperties.LabVmsShutdown.ScheduleProperties", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "formula.FormulaProperties.FormulaContent.LabVirtualMachineCreationParameterProperties.ApplicableSchedule.ApplicableScheduleProperties.LabVmsStartup", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "formula.FormulaProperties.FormulaContent.LabVirtualMachineCreationParameterProperties.ApplicableSchedule.ApplicableScheduleProperties.LabVmsStartup.ScheduleProperties", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}, - }}, - }}}}}); err != nil { + Constraints: []validation.Constraint{{Target: "formula.FormulaProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("dtl.FormulasClient", "CreateOrUpdate", err.Error()) } @@ -91,7 +78,7 @@ func (client FormulasClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -180,7 +167,7 @@ func (client FormulasClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -258,7 +245,7 @@ func (client FormulasClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -297,16 +284,16 @@ func (client FormulasClient) GetResponder(resp *http.Response) (result Formula, // resourceGroupName - the name of the resource group. // labName - the name of the lab. // expand - specify the $expand query. Example: 'properties($select=description)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client FormulasClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationFormulaPage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client FormulasClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result FormulaListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/FormulasClient.List") defer func() { sc := -1 - if result.rwcf.Response.Response != nil { - sc = result.rwcf.Response.Response.StatusCode + if result.fl.Response.Response != nil { + sc = result.fl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -320,17 +307,17 @@ func (client FormulasClient) List(ctx context.Context, resourceGroupName string, resp, err := client.ListSender(req) if err != nil { - result.rwcf.Response = autorest.Response{Response: resp} + result.fl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.FormulasClient", "List", resp, "Failure sending request") return } - result.rwcf, err = client.ListResponder(resp) + result.fl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.FormulasClient", "List", resp, "Failure responding to request") return } - if result.rwcf.hasNextLink() && result.rwcf.IsEmpty() { + if result.fl.hasNextLink() && result.fl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -346,7 +333,7 @@ func (client FormulasClient) ListPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -379,7 +366,7 @@ func (client FormulasClient) ListSender(req *http.Request) (*http.Response, erro // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client FormulasClient) ListResponder(resp *http.Response) (result ResponseWithContinuationFormula, err error) { +func (client FormulasClient) ListResponder(resp *http.Response) (result FormulaList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -390,8 +377,8 @@ func (client FormulasClient) ListResponder(resp *http.Response) (result Response } // listNextResults retrieves the next set of results, if any. -func (client FormulasClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationFormula) (result ResponseWithContinuationFormula, err error) { - req, err := lastResults.responseWithContinuationFormulaPreparer(ctx) +func (client FormulasClient) listNextResults(ctx context.Context, lastResults FormulaList) (result FormulaList, err error) { + req, err := lastResults.formulaListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.FormulasClient", "listNextResults", nil, "Failure preparing next results request") } @@ -411,7 +398,7 @@ func (client FormulasClient) listNextResults(ctx context.Context, lastResults Re } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client FormulasClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationFormulaIterator, err error) { +func (client FormulasClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result FormulaListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/FormulasClient.List") defer func() { @@ -425,3 +412,84 @@ func (client FormulasClient) ListComplete(ctx context.Context, resourceGroupName result.page, err = client.List(ctx, resourceGroupName, labName, expand, filter, top, orderby) return } + +// Update allows modifying tags of formulas. All other properties will be ignored. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// name - the name of the formula. +// formula - a formula for creating a VM, specifying an image base and other parameters +func (client FormulasClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, formula FormulaFragment) (result Formula, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FormulasClient.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, labName, name, formula) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.FormulasClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.FormulasClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.FormulasClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client FormulasClient) UpdatePreparer(ctx context.Context, resourceGroupName string, labName string, name string, formula FormulaFragment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-09-15" + 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.DevTestLab/labs/{labName}/formulas/{name}", pathParameters), + autorest.WithJSON(formula), + 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 FormulasClient) 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 FormulasClient) UpdateResponder(resp *http.Response) (result Formula, err error) { + err = autorest.Respond( + resp, + 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/devtestlabs/mgmt/2016-05-15/dtl/galleryimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/galleryimages.go similarity index 87% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/galleryimages.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/galleryimages.go index ba4e648ec5c2..74554d4ca998 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/galleryimages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/galleryimages.go @@ -35,16 +35,16 @@ func NewGalleryImagesClientWithBaseURI(baseURI string, subscriptionID string) Ga // resourceGroupName - the name of the resource group. // labName - the name of the lab. // expand - specify the $expand query. Example: 'properties($select=author)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client GalleryImagesClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationGalleryImagePage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client GalleryImagesClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result GalleryImageListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.List") defer func() { sc := -1 - if result.rwcgi.Response.Response != nil { - sc = result.rwcgi.Response.Response.StatusCode + if result.gil.Response.Response != nil { + sc = result.gil.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -58,17 +58,17 @@ func (client GalleryImagesClient) List(ctx context.Context, resourceGroupName st resp, err := client.ListSender(req) if err != nil { - result.rwcgi.Response = autorest.Response{Response: resp} + result.gil.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.GalleryImagesClient", "List", resp, "Failure sending request") return } - result.rwcgi, err = client.ListResponder(resp) + result.gil, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.GalleryImagesClient", "List", resp, "Failure responding to request") return } - if result.rwcgi.hasNextLink() && result.rwcgi.IsEmpty() { + if result.gil.hasNextLink() && result.gil.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -84,7 +84,7 @@ func (client GalleryImagesClient) ListPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -117,7 +117,7 @@ func (client GalleryImagesClient) ListSender(req *http.Request) (*http.Response, // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client GalleryImagesClient) ListResponder(resp *http.Response) (result ResponseWithContinuationGalleryImage, err error) { +func (client GalleryImagesClient) ListResponder(resp *http.Response) (result GalleryImageList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -128,8 +128,8 @@ func (client GalleryImagesClient) ListResponder(resp *http.Response) (result Res } // listNextResults retrieves the next set of results, if any. -func (client GalleryImagesClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationGalleryImage) (result ResponseWithContinuationGalleryImage, err error) { - req, err := lastResults.responseWithContinuationGalleryImagePreparer(ctx) +func (client GalleryImagesClient) listNextResults(ctx context.Context, lastResults GalleryImageList) (result GalleryImageList, err error) { + req, err := lastResults.galleryImageListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.GalleryImagesClient", "listNextResults", nil, "Failure preparing next results request") } @@ -149,7 +149,7 @@ func (client GalleryImagesClient) listNextResults(ctx context.Context, lastResul } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client GalleryImagesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationGalleryImageIterator, err error) { +func (client GalleryImagesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result GalleryImageListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImagesClient.List") defer func() { diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/globalschedules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/globalschedules.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/globalschedules.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/globalschedules.go index bbcecff5e94a..117c371d43c7 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/globalschedules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/globalschedules.go @@ -83,7 +83,7 @@ func (client GlobalSchedulesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -161,7 +161,7 @@ func (client GlobalSchedulesClient) DeletePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -229,7 +229,7 @@ func (client GlobalSchedulesClient) ExecutePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -314,7 +314,7 @@ func (client GlobalSchedulesClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -352,16 +352,16 @@ func (client GlobalSchedulesClient) GetResponder(resp *http.Response) (result Sc // Parameters: // resourceGroupName - the name of the resource group. // expand - specify the $expand query. Example: 'properties($select=status)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client GlobalSchedulesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationSchedulePage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client GlobalSchedulesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, expand string, filter string, top *int32, orderby string) (result ScheduleListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GlobalSchedulesClient.ListByResourceGroup") defer func() { sc := -1 - if result.rwcs.Response.Response != nil { - sc = result.rwcs.Response.Response.StatusCode + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -375,17 +375,17 @@ func (client GlobalSchedulesClient) ListByResourceGroup(ctx context.Context, res resp, err := client.ListByResourceGroupSender(req) if err != nil { - result.rwcs.Response = autorest.Response{Response: resp} + result.sl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.GlobalSchedulesClient", "ListByResourceGroup", resp, "Failure sending request") return } - result.rwcs, err = client.ListByResourceGroupResponder(resp) + result.sl, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.GlobalSchedulesClient", "ListByResourceGroup", resp, "Failure responding to request") return } - if result.rwcs.hasNextLink() && result.rwcs.IsEmpty() { + if result.sl.hasNextLink() && result.sl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -400,7 +400,7 @@ func (client GlobalSchedulesClient) ListByResourceGroupPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -433,7 +433,7 @@ func (client GlobalSchedulesClient) ListByResourceGroupSender(req *http.Request) // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. -func (client GlobalSchedulesClient) ListByResourceGroupResponder(resp *http.Response) (result ResponseWithContinuationSchedule, err error) { +func (client GlobalSchedulesClient) ListByResourceGroupResponder(resp *http.Response) (result ScheduleList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -444,8 +444,8 @@ func (client GlobalSchedulesClient) ListByResourceGroupResponder(resp *http.Resp } // listByResourceGroupNextResults retrieves the next set of results, if any. -func (client GlobalSchedulesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ResponseWithContinuationSchedule) (result ResponseWithContinuationSchedule, err error) { - req, err := lastResults.responseWithContinuationSchedulePreparer(ctx) +func (client GlobalSchedulesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ScheduleList) (result ScheduleList, err error) { + req, err := lastResults.scheduleListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.GlobalSchedulesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") } @@ -465,7 +465,7 @@ func (client GlobalSchedulesClient) listByResourceGroupNextResults(ctx context.C } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client GlobalSchedulesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationScheduleIterator, err error) { +func (client GlobalSchedulesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand string, filter string, top *int32, orderby string) (result ScheduleListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GlobalSchedulesClient.ListByResourceGroup") defer func() { @@ -483,16 +483,16 @@ func (client GlobalSchedulesClient) ListByResourceGroupComplete(ctx context.Cont // ListBySubscription list schedules in a subscription. // Parameters: // expand - specify the $expand query. Example: 'properties($select=status)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client GlobalSchedulesClient) ListBySubscription(ctx context.Context, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationSchedulePage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client GlobalSchedulesClient) ListBySubscription(ctx context.Context, expand string, filter string, top *int32, orderby string) (result ScheduleListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GlobalSchedulesClient.ListBySubscription") defer func() { sc := -1 - if result.rwcs.Response.Response != nil { - sc = result.rwcs.Response.Response.StatusCode + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -506,17 +506,17 @@ func (client GlobalSchedulesClient) ListBySubscription(ctx context.Context, expa resp, err := client.ListBySubscriptionSender(req) if err != nil { - result.rwcs.Response = autorest.Response{Response: resp} + result.sl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.GlobalSchedulesClient", "ListBySubscription", resp, "Failure sending request") return } - result.rwcs, err = client.ListBySubscriptionResponder(resp) + result.sl, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.GlobalSchedulesClient", "ListBySubscription", resp, "Failure responding to request") return } - if result.rwcs.hasNextLink() && result.rwcs.IsEmpty() { + if result.sl.hasNextLink() && result.sl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -530,7 +530,7 @@ func (client GlobalSchedulesClient) ListBySubscriptionPreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -563,7 +563,7 @@ func (client GlobalSchedulesClient) ListBySubscriptionSender(req *http.Request) // ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always // closes the http.Response Body. -func (client GlobalSchedulesClient) ListBySubscriptionResponder(resp *http.Response) (result ResponseWithContinuationSchedule, err error) { +func (client GlobalSchedulesClient) ListBySubscriptionResponder(resp *http.Response) (result ScheduleList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -574,8 +574,8 @@ func (client GlobalSchedulesClient) ListBySubscriptionResponder(resp *http.Respo } // listBySubscriptionNextResults retrieves the next set of results, if any. -func (client GlobalSchedulesClient) listBySubscriptionNextResults(ctx context.Context, lastResults ResponseWithContinuationSchedule) (result ResponseWithContinuationSchedule, err error) { - req, err := lastResults.responseWithContinuationSchedulePreparer(ctx) +func (client GlobalSchedulesClient) listBySubscriptionNextResults(ctx context.Context, lastResults ScheduleList) (result ScheduleList, err error) { + req, err := lastResults.scheduleListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.GlobalSchedulesClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") } @@ -595,7 +595,7 @@ func (client GlobalSchedulesClient) listBySubscriptionNextResults(ctx context.Co } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client GlobalSchedulesClient) ListBySubscriptionComplete(ctx context.Context, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationScheduleIterator, err error) { +func (client GlobalSchedulesClient) ListBySubscriptionComplete(ctx context.Context, expand string, filter string, top *int32, orderby string) (result ScheduleListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/GlobalSchedulesClient.ListBySubscription") defer func() { @@ -649,7 +649,7 @@ func (client GlobalSchedulesClient) RetargetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -690,7 +690,7 @@ func (client GlobalSchedulesClient) RetargetResponder(resp *http.Response) (resu return } -// Update modify properties of schedules. +// Update allows modifying tags of schedules. All other properties will be ignored. // Parameters: // resourceGroupName - the name of the resource group. // name - the name of the schedule. @@ -736,7 +736,7 @@ func (client GlobalSchedulesClient) UpdatePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/labs.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/labs.go similarity index 86% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/labs.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/labs.go index bbbc67038c8c..ee7980b02440 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/labs.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/labs.go @@ -10,7 +10,6 @@ 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" ) @@ -69,7 +68,7 @@ func (client LabsClient) ClaimAnyVMPreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -124,21 +123,6 @@ func (client LabsClient) CreateEnvironment(ctx context.Context, resourceGroupNam tracing.EndSpan(ctx, sc, err) }() } - if err := validation.Validate([]validation.Validation{ - {TargetValue: labVirtualMachineCreationParameter, - Constraints: []validation.Constraint{{Target: "labVirtualMachineCreationParameter.LabVirtualMachineCreationParameterProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "labVirtualMachineCreationParameter.LabVirtualMachineCreationParameterProperties.ApplicableSchedule", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "labVirtualMachineCreationParameter.LabVirtualMachineCreationParameterProperties.ApplicableSchedule.ApplicableScheduleProperties", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "labVirtualMachineCreationParameter.LabVirtualMachineCreationParameterProperties.ApplicableSchedule.ApplicableScheduleProperties.LabVmsShutdown", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "labVirtualMachineCreationParameter.LabVirtualMachineCreationParameterProperties.ApplicableSchedule.ApplicableScheduleProperties.LabVmsShutdown.ScheduleProperties", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "labVirtualMachineCreationParameter.LabVirtualMachineCreationParameterProperties.ApplicableSchedule.ApplicableScheduleProperties.LabVmsStartup", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "labVirtualMachineCreationParameter.LabVirtualMachineCreationParameterProperties.ApplicableSchedule.ApplicableScheduleProperties.LabVmsStartup.ScheduleProperties", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}, - }}}}}); err != nil { - return result, validation.NewError("dtl.LabsClient", "CreateEnvironment", err.Error()) - } - req, err := client.CreateEnvironmentPreparer(ctx, resourceGroupName, name, labVirtualMachineCreationParameter) if err != nil { err = autorest.NewErrorWithError(err, "dtl.LabsClient", "CreateEnvironment", nil, "Failure preparing request") @@ -162,7 +146,7 @@ func (client LabsClient) CreateEnvironmentPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +226,7 @@ func (client LabsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -322,7 +306,7 @@ func (client LabsClient) DeletePreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -401,7 +385,7 @@ func (client LabsClient) ExportResourceUsagePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -488,7 +472,7 @@ func (client LabsClient) GenerateUploadURIPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -567,7 +551,7 @@ func (client LabsClient) GetPreparer(ctx context.Context, resourceGroupName stri "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -601,20 +585,101 @@ func (client LabsClient) GetResponder(resp *http.Response) (result Lab, err erro return } +// ImportVirtualMachine import a virtual machine into a different lab. This operation can take a while to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// name - the name of the lab. +// importLabVirtualMachineRequest - this represents the payload required to import a virtual machine from a +// different lab into the current one +func (client LabsClient) ImportVirtualMachine(ctx context.Context, resourceGroupName string, name string, importLabVirtualMachineRequest ImportLabVirtualMachineRequest) (result LabsImportVirtualMachineFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.ImportVirtualMachine") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ImportVirtualMachinePreparer(ctx, resourceGroupName, name, importLabVirtualMachineRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.LabsClient", "ImportVirtualMachine", nil, "Failure preparing request") + return + } + + result, err = client.ImportVirtualMachineSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.LabsClient", "ImportVirtualMachine", nil, "Failure sending request") + return + } + + return +} + +// ImportVirtualMachinePreparer prepares the ImportVirtualMachine request. +func (client LabsClient) ImportVirtualMachinePreparer(ctx context.Context, resourceGroupName string, name string, importLabVirtualMachineRequest ImportLabVirtualMachineRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-09-15" + 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.DevTestLab/labs/{name}/importVirtualMachine", pathParameters), + autorest.WithJSON(importLabVirtualMachineRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ImportVirtualMachineSender sends the ImportVirtualMachine request. The method will close the +// http.Response Body if it receives an error. +func (client LabsClient) ImportVirtualMachineSender(req *http.Request) (future LabsImportVirtualMachineFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ImportVirtualMachineResponder handles the response to the ImportVirtualMachine request. The method always +// closes the http.Response Body. +func (client LabsClient) ImportVirtualMachineResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + // ListByResourceGroup list labs in a resource group. // Parameters: // resourceGroupName - the name of the resource group. // expand - specify the $expand query. Example: 'properties($select=defaultStorageAccount)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client LabsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationLabPage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client LabsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, expand string, filter string, top *int32, orderby string) (result LabListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.ListByResourceGroup") defer func() { sc := -1 - if result.rwcl.Response.Response != nil { - sc = result.rwcl.Response.Response.StatusCode + if result.ll.Response.Response != nil { + sc = result.ll.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -628,17 +693,17 @@ func (client LabsClient) ListByResourceGroup(ctx context.Context, resourceGroupN resp, err := client.ListByResourceGroupSender(req) if err != nil { - result.rwcl.Response = autorest.Response{Response: resp} + result.ll.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.LabsClient", "ListByResourceGroup", resp, "Failure sending request") return } - result.rwcl, err = client.ListByResourceGroupResponder(resp) + result.ll, err = client.ListByResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.LabsClient", "ListByResourceGroup", resp, "Failure responding to request") return } - if result.rwcl.hasNextLink() && result.rwcl.IsEmpty() { + if result.ll.hasNextLink() && result.ll.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -653,7 +718,7 @@ func (client LabsClient) ListByResourceGroupPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -686,7 +751,7 @@ func (client LabsClient) ListByResourceGroupSender(req *http.Request) (*http.Res // ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always // closes the http.Response Body. -func (client LabsClient) ListByResourceGroupResponder(resp *http.Response) (result ResponseWithContinuationLab, err error) { +func (client LabsClient) ListByResourceGroupResponder(resp *http.Response) (result LabList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -697,8 +762,8 @@ func (client LabsClient) ListByResourceGroupResponder(resp *http.Response) (resu } // listByResourceGroupNextResults retrieves the next set of results, if any. -func (client LabsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ResponseWithContinuationLab) (result ResponseWithContinuationLab, err error) { - req, err := lastResults.responseWithContinuationLabPreparer(ctx) +func (client LabsClient) listByResourceGroupNextResults(ctx context.Context, lastResults LabList) (result LabList, err error) { + req, err := lastResults.labListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.LabsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") } @@ -718,7 +783,7 @@ func (client LabsClient) listByResourceGroupNextResults(ctx context.Context, las } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client LabsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationLabIterator, err error) { +func (client LabsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, expand string, filter string, top *int32, orderby string) (result LabListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.ListByResourceGroup") defer func() { @@ -736,16 +801,16 @@ func (client LabsClient) ListByResourceGroupComplete(ctx context.Context, resour // ListBySubscription list labs in a subscription. // Parameters: // expand - specify the $expand query. Example: 'properties($select=defaultStorageAccount)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client LabsClient) ListBySubscription(ctx context.Context, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationLabPage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client LabsClient) ListBySubscription(ctx context.Context, expand string, filter string, top *int32, orderby string) (result LabListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.ListBySubscription") defer func() { sc := -1 - if result.rwcl.Response.Response != nil { - sc = result.rwcl.Response.Response.StatusCode + if result.ll.Response.Response != nil { + sc = result.ll.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -759,17 +824,17 @@ func (client LabsClient) ListBySubscription(ctx context.Context, expand string, resp, err := client.ListBySubscriptionSender(req) if err != nil { - result.rwcl.Response = autorest.Response{Response: resp} + result.ll.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.LabsClient", "ListBySubscription", resp, "Failure sending request") return } - result.rwcl, err = client.ListBySubscriptionResponder(resp) + result.ll, err = client.ListBySubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.LabsClient", "ListBySubscription", resp, "Failure responding to request") return } - if result.rwcl.hasNextLink() && result.rwcl.IsEmpty() { + if result.ll.hasNextLink() && result.ll.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -783,7 +848,7 @@ func (client LabsClient) ListBySubscriptionPreparer(ctx context.Context, expand "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -816,7 +881,7 @@ func (client LabsClient) ListBySubscriptionSender(req *http.Request) (*http.Resp // ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always // closes the http.Response Body. -func (client LabsClient) ListBySubscriptionResponder(resp *http.Response) (result ResponseWithContinuationLab, err error) { +func (client LabsClient) ListBySubscriptionResponder(resp *http.Response) (result LabList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -827,8 +892,8 @@ func (client LabsClient) ListBySubscriptionResponder(resp *http.Response) (resul } // listBySubscriptionNextResults retrieves the next set of results, if any. -func (client LabsClient) listBySubscriptionNextResults(ctx context.Context, lastResults ResponseWithContinuationLab) (result ResponseWithContinuationLab, err error) { - req, err := lastResults.responseWithContinuationLabPreparer(ctx) +func (client LabsClient) listBySubscriptionNextResults(ctx context.Context, lastResults LabList) (result LabList, err error) { + req, err := lastResults.labListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.LabsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") } @@ -848,7 +913,7 @@ func (client LabsClient) listBySubscriptionNextResults(ctx context.Context, last } // ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. -func (client LabsClient) ListBySubscriptionComplete(ctx context.Context, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationLabIterator, err error) { +func (client LabsClient) ListBySubscriptionComplete(ctx context.Context, expand string, filter string, top *int32, orderby string) (result LabListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.ListBySubscription") defer func() { @@ -867,13 +932,13 @@ func (client LabsClient) ListBySubscriptionComplete(ctx context.Context, expand // Parameters: // resourceGroupName - the name of the resource group. // name - the name of the lab. -func (client LabsClient) ListVhds(ctx context.Context, resourceGroupName string, name string) (result ResponseWithContinuationLabVhdPage, err error) { +func (client LabsClient) ListVhds(ctx context.Context, resourceGroupName string, name string) (result LabVhdListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.ListVhds") defer func() { sc := -1 - if result.rwclv.Response.Response != nil { - sc = result.rwclv.Response.Response.StatusCode + if result.lvl.Response.Response != nil { + sc = result.lvl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -887,17 +952,17 @@ func (client LabsClient) ListVhds(ctx context.Context, resourceGroupName string, resp, err := client.ListVhdsSender(req) if err != nil { - result.rwclv.Response = autorest.Response{Response: resp} + result.lvl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.LabsClient", "ListVhds", resp, "Failure sending request") return } - result.rwclv, err = client.ListVhdsResponder(resp) + result.lvl, err = client.ListVhdsResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.LabsClient", "ListVhds", resp, "Failure responding to request") return } - if result.rwclv.hasNextLink() && result.rwclv.IsEmpty() { + if result.lvl.hasNextLink() && result.lvl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -913,7 +978,7 @@ func (client LabsClient) ListVhdsPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -934,7 +999,7 @@ func (client LabsClient) ListVhdsSender(req *http.Request) (*http.Response, erro // ListVhdsResponder handles the response to the ListVhds request. The method always // closes the http.Response Body. -func (client LabsClient) ListVhdsResponder(resp *http.Response) (result ResponseWithContinuationLabVhd, err error) { +func (client LabsClient) ListVhdsResponder(resp *http.Response) (result LabVhdList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -945,8 +1010,8 @@ func (client LabsClient) ListVhdsResponder(resp *http.Response) (result Response } // listVhdsNextResults retrieves the next set of results, if any. -func (client LabsClient) listVhdsNextResults(ctx context.Context, lastResults ResponseWithContinuationLabVhd) (result ResponseWithContinuationLabVhd, err error) { - req, err := lastResults.responseWithContinuationLabVhdPreparer(ctx) +func (client LabsClient) listVhdsNextResults(ctx context.Context, lastResults LabVhdList) (result LabVhdList, err error) { + req, err := lastResults.labVhdListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.LabsClient", "listVhdsNextResults", nil, "Failure preparing next results request") } @@ -966,7 +1031,7 @@ func (client LabsClient) listVhdsNextResults(ctx context.Context, lastResults Re } // ListVhdsComplete enumerates all values, automatically crossing page boundaries as required. -func (client LabsClient) ListVhdsComplete(ctx context.Context, resourceGroupName string, name string) (result ResponseWithContinuationLabVhdIterator, err error) { +func (client LabsClient) ListVhdsComplete(ctx context.Context, resourceGroupName string, name string) (result LabVhdListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.ListVhds") defer func() { @@ -981,7 +1046,7 @@ func (client LabsClient) ListVhdsComplete(ctx context.Context, resourceGroupName return } -// Update modify properties of labs. +// Update allows modifying tags of labs. All other properties will be ignored. // Parameters: // resourceGroupName - the name of the resource group. // name - the name of the lab. @@ -1027,7 +1092,7 @@ func (client LabsClient) UpdatePreparer(ctx context.Context, resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/models.go similarity index 69% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/models.go index 460a0d5175f3..bd4b57d78cf3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/models.go @@ -18,7 +18,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl" // ApplicableSchedule schedules applicable to a virtual machine. The schedules may have been defined on a // VM or on lab level. @@ -127,14 +127,6 @@ func (as *ApplicableSchedule) UnmarshalJSON(body []byte) error { type ApplicableScheduleFragment struct { // ApplicableSchedulePropertiesFragment - The properties of the resource. *ApplicableSchedulePropertiesFragment `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` // Tags - The tags of the resource. Tags map[string]*string `json:"tags"` } @@ -145,9 +137,6 @@ func (asf ApplicableScheduleFragment) MarshalJSON() ([]byte, error) { if asf.ApplicableSchedulePropertiesFragment != nil { objectMap["properties"] = asf.ApplicableSchedulePropertiesFragment } - if asf.Location != nil { - objectMap["location"] = asf.Location - } if asf.Tags != nil { objectMap["tags"] = asf.Tags } @@ -172,42 +161,6 @@ func (asf *ApplicableScheduleFragment) UnmarshalJSON(body []byte) error { } asf.ApplicableSchedulePropertiesFragment = &applicableSchedulePropertiesFragment } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - asf.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - asf.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - asf.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - asf.Location = &location - } case "tags": if v != nil { var tags map[string]*string @@ -355,6 +308,165 @@ type ArmTemplateInfo struct { Parameters interface{} `json:"parameters,omitempty"` } +// ArmTemplateList the response of a list operation. +type ArmTemplateList struct { + autorest.Response `json:"-"` + // Value - Results of the list operation. + Value *[]ArmTemplate `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ArmTemplateListIterator provides access to a complete listing of ArmTemplate values. +type ArmTemplateListIterator struct { + i int + page ArmTemplateListPage +} + +// 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 *ArmTemplateListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArmTemplateListIterator.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 *ArmTemplateListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ArmTemplateListIterator) 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 ArmTemplateListIterator) Response() ArmTemplateList { + 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 ArmTemplateListIterator) Value() ArmTemplate { + if !iter.page.NotDone() { + return ArmTemplate{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ArmTemplateListIterator type. +func NewArmTemplateListIterator(page ArmTemplateListPage) ArmTemplateListIterator { + return ArmTemplateListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (atl ArmTemplateList) IsEmpty() bool { + return atl.Value == nil || len(*atl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (atl ArmTemplateList) hasNextLink() bool { + return atl.NextLink != nil && len(*atl.NextLink) != 0 +} + +// armTemplateListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (atl ArmTemplateList) armTemplateListPreparer(ctx context.Context) (*http.Request, error) { + if !atl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(atl.NextLink))) +} + +// ArmTemplateListPage contains a page of ArmTemplate values. +type ArmTemplateListPage struct { + fn func(context.Context, ArmTemplateList) (ArmTemplateList, error) + atl ArmTemplateList +} + +// 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 *ArmTemplateListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArmTemplateListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.atl) + if err != nil { + return err + } + page.atl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *ArmTemplateListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ArmTemplateListPage) NotDone() bool { + return !page.atl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ArmTemplateListPage) Response() ArmTemplateList { + return page.atl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ArmTemplateListPage) Values() []ArmTemplate { + if page.atl.IsEmpty() { + return nil + } + return *page.atl.Value +} + +// Creates a new instance of the ArmTemplateListPage type. +func NewArmTemplateListPage(cur ArmTemplateList, getNextPage func(context.Context, ArmTemplateList) (ArmTemplateList, error)) ArmTemplateListPage { + return ArmTemplateListPage{ + fn: getNextPage, + atl: cur, + } +} + // ArmTemplateParameterProperties properties of an Azure Resource Manager template parameter. type ArmTemplateParameterProperties struct { // Name - The name of the template parameter. @@ -363,6 +475,14 @@ type ArmTemplateParameterProperties struct { Value *string `json:"value,omitempty"` } +// ArmTemplateParameterPropertiesFragment properties of an Azure Resource Manager template parameter. +type ArmTemplateParameterPropertiesFragment struct { + // Name - The name of the template parameter. + Name *string `json:"name,omitempty"` + // Value - The value of the template parameter. + Value *string `json:"value,omitempty"` +} + // ArmTemplateProperties properties of an Azure Resource Manager template. type ArmTemplateProperties struct { // DisplayName - READ-ONLY; The display name of the ARM template. @@ -379,6 +499,8 @@ type ArmTemplateProperties struct { CreatedDate *date.Time `json:"createdDate,omitempty"` // ParametersValueFilesInfo - READ-ONLY; File name and parameter values information from all azuredeploy.*.parameters.json for the ARM template. ParametersValueFilesInfo *[]ParametersValueFileInfo `json:"parametersValueFilesInfo,omitempty"` + // Enabled - READ-ONLY; Whether or not ARM template is enabled for use by lab user. + Enabled *bool `json:"enabled,omitempty"` } // MarshalJSON is the custom marshaler for ArmTemplateProperties. @@ -512,6 +634,8 @@ type ArtifactDeploymentStatusPropertiesFragment struct { type ArtifactInstallProperties struct { // ArtifactID - The artifact's identifier. ArtifactID *string `json:"artifactId,omitempty"` + // ArtifactTitle - The artifact's title. + ArtifactTitle *string `json:"artifactTitle,omitempty"` // Parameters - The parameters of the artifact. Parameters *[]ArtifactParameterProperties `json:"parameters,omitempty"` // Status - The status of the artifact. @@ -528,6 +652,8 @@ type ArtifactInstallProperties struct { type ArtifactInstallPropertiesFragment struct { // ArtifactID - The artifact's identifier. ArtifactID *string `json:"artifactId,omitempty"` + // ArtifactTitle - The artifact's title. + ArtifactTitle *string `json:"artifactTitle,omitempty"` // Parameters - The parameters of the artifact. Parameters *[]ArtifactParameterPropertiesFragment `json:"parameters,omitempty"` // Status - The status of the artifact. @@ -540,73 +666,232 @@ type ArtifactInstallPropertiesFragment struct { InstallTime *date.Time `json:"installTime,omitempty"` } -// ArtifactParameterProperties properties of an artifact parameter. -type ArtifactParameterProperties struct { - // Name - The name of the artifact parameter. - Name *string `json:"name,omitempty"` - // Value - The value of the artifact parameter. - Value *string `json:"value,omitempty"` +// ArtifactList the response of a list operation. +type ArtifactList struct { + autorest.Response `json:"-"` + // Value - Results of the list operation. + Value *[]Artifact `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` } -// ArtifactParameterPropertiesFragment properties of an artifact parameter. -type ArtifactParameterPropertiesFragment struct { - // Name - The name of the artifact parameter. - Name *string `json:"name,omitempty"` - // Value - The value of the artifact parameter. - Value *string `json:"value,omitempty"` +// ArtifactListIterator provides access to a complete listing of Artifact values. +type ArtifactListIterator struct { + i int + page ArtifactListPage } -// ArtifactProperties properties of an artifact. -type ArtifactProperties struct { - // Title - READ-ONLY; The artifact's title. - Title *string `json:"title,omitempty"` - // Description - READ-ONLY; The artifact's description. - Description *string `json:"description,omitempty"` - // Publisher - READ-ONLY; The artifact's publisher. - Publisher *string `json:"publisher,omitempty"` - // FilePath - READ-ONLY; The file path to the artifact. - FilePath *string `json:"filePath,omitempty"` - // Icon - READ-ONLY; The URI to the artifact icon. - Icon *string `json:"icon,omitempty"` - // TargetOsType - READ-ONLY; The artifact's target OS. - TargetOsType *string `json:"targetOsType,omitempty"` - // Parameters - READ-ONLY; The artifact's parameters. - Parameters interface{} `json:"parameters,omitempty"` - // CreatedDate - READ-ONLY; The artifact's creation date. - CreatedDate *date.Time `json:"createdDate,omitempty"` +// 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 *ArtifactListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArtifactListIterator.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 } -// MarshalJSON is the custom marshaler for ArtifactProperties. -func (ap ArtifactProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - return json.Marshal(objectMap) +// 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 *ArtifactListIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// ArtifactSource properties of an artifact source. -type ArtifactSource struct { - autorest.Response `json:"-"` - // ArtifactSourceProperties - The properties of the resource. - *ArtifactSourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` - // Tags - The tags of the resource. - Tags map[string]*string `json:"tags"` +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ArtifactListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// MarshalJSON is the custom marshaler for ArtifactSource. -func (as ArtifactSource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if as.ArtifactSourceProperties != nil { - objectMap["properties"] = as.ArtifactSourceProperties - } - if as.Location != nil { - objectMap["location"] = as.Location +// Response returns the raw server response from the last page request. +func (iter ArtifactListIterator) Response() ArtifactList { + 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 ArtifactListIterator) Value() Artifact { + if !iter.page.NotDone() { + return Artifact{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ArtifactListIterator type. +func NewArtifactListIterator(page ArtifactListPage) ArtifactListIterator { + return ArtifactListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al ArtifactList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (al ArtifactList) hasNextLink() bool { + return al.NextLink != nil && len(*al.NextLink) != 0 +} + +// artifactListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al ArtifactList) artifactListPreparer(ctx context.Context) (*http.Request, error) { + if !al.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(al.NextLink))) +} + +// ArtifactListPage contains a page of Artifact values. +type ArtifactListPage struct { + fn func(context.Context, ArtifactList) (ArtifactList, error) + al ArtifactList +} + +// 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 *ArtifactListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArtifactListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.al) + if err != nil { + return err + } + page.al = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *ArtifactListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ArtifactListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ArtifactListPage) Response() ArtifactList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ArtifactListPage) Values() []Artifact { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the ArtifactListPage type. +func NewArtifactListPage(cur ArtifactList, getNextPage func(context.Context, ArtifactList) (ArtifactList, error)) ArtifactListPage { + return ArtifactListPage{ + fn: getNextPage, + al: cur, + } +} + +// ArtifactParameterProperties properties of an artifact parameter. +type ArtifactParameterProperties struct { + // Name - The name of the artifact parameter. + Name *string `json:"name,omitempty"` + // Value - The value of the artifact parameter. + Value *string `json:"value,omitempty"` +} + +// ArtifactParameterPropertiesFragment properties of an artifact parameter. +type ArtifactParameterPropertiesFragment struct { + // Name - The name of the artifact parameter. + Name *string `json:"name,omitempty"` + // Value - The value of the artifact parameter. + Value *string `json:"value,omitempty"` +} + +// ArtifactProperties properties of an artifact. +type ArtifactProperties struct { + // Title - READ-ONLY; The artifact's title. + Title *string `json:"title,omitempty"` + // Description - READ-ONLY; The artifact's description. + Description *string `json:"description,omitempty"` + // Publisher - READ-ONLY; The artifact's publisher. + Publisher *string `json:"publisher,omitempty"` + // FilePath - READ-ONLY; The file path to the artifact. + FilePath *string `json:"filePath,omitempty"` + // Icon - READ-ONLY; The URI to the artifact icon. + Icon *string `json:"icon,omitempty"` + // TargetOsType - READ-ONLY; The artifact's target OS. + TargetOsType *string `json:"targetOsType,omitempty"` + // Parameters - READ-ONLY; The artifact's parameters. + Parameters interface{} `json:"parameters,omitempty"` + // CreatedDate - READ-ONLY; The artifact's creation date. + CreatedDate *date.Time `json:"createdDate,omitempty"` +} + +// MarshalJSON is the custom marshaler for ArtifactProperties. +func (ap ArtifactProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ArtifactSource properties of an artifact source. +type ArtifactSource struct { + autorest.Response `json:"-"` + // ArtifactSourceProperties - The properties of the resource. + *ArtifactSourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The identifier of the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ArtifactSource. +func (as ArtifactSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if as.ArtifactSourceProperties != nil { + objectMap["properties"] = as.ArtifactSourceProperties + } + if as.Location != nil { + objectMap["location"] = as.Location } if as.Tags != nil { objectMap["tags"] = as.Tags @@ -687,14 +972,6 @@ func (as *ArtifactSource) UnmarshalJSON(body []byte) error { type ArtifactSourceFragment struct { // ArtifactSourcePropertiesFragment - The properties of the resource. *ArtifactSourcePropertiesFragment `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` // Tags - The tags of the resource. Tags map[string]*string `json:"tags"` } @@ -705,9 +982,6 @@ func (asf ArtifactSourceFragment) MarshalJSON() ([]byte, error) { if asf.ArtifactSourcePropertiesFragment != nil { objectMap["properties"] = asf.ArtifactSourcePropertiesFragment } - if asf.Location != nil { - objectMap["location"] = asf.Location - } if asf.Tags != nil { objectMap["tags"] = asf.Tags } @@ -732,42 +1006,6 @@ func (asf *ArtifactSourceFragment) UnmarshalJSON(body []byte) error { } asf.ArtifactSourcePropertiesFragment = &artifactSourcePropertiesFragment } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - asf.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - asf.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - asf.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - asf.Location = &location - } case "tags": if v != nil { var tags map[string]*string @@ -783,70 +1021,167 @@ func (asf *ArtifactSourceFragment) UnmarshalJSON(body []byte) error { return nil } -// ArtifactSourceProperties properties of an artifact source. -type ArtifactSourceProperties struct { - // DisplayName - The artifact source's display name. - DisplayName *string `json:"displayName,omitempty"` - // URI - The artifact source's URI. - URI *string `json:"uri,omitempty"` - // SourceType - The artifact source's type. Possible values include: 'VsoGit', 'GitHub' - SourceType SourceControlType `json:"sourceType,omitempty"` - // FolderPath - The folder containing artifacts. - FolderPath *string `json:"folderPath,omitempty"` - // ArmTemplateFolderPath - The folder containing Azure Resource Manager templates. - ArmTemplateFolderPath *string `json:"armTemplateFolderPath,omitempty"` - // BranchRef - The artifact source's branch reference. - BranchRef *string `json:"branchRef,omitempty"` - // SecurityToken - The security token to authenticate to the artifact source. - SecurityToken *string `json:"securityToken,omitempty"` - // Status - Indicates if the artifact source is enabled (values: Enabled, Disabled). Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' - Status EnableStatus `json:"status,omitempty"` - // CreatedDate - READ-ONLY; The artifact source's creation date. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +// ArtifactSourceList the response of a list operation. +type ArtifactSourceList struct { + autorest.Response `json:"-"` + // Value - Results of the list operation. + Value *[]ArtifactSource `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for ArtifactSourceProperties. -func (asp ArtifactSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if asp.DisplayName != nil { - objectMap["displayName"] = asp.DisplayName - } - if asp.URI != nil { - objectMap["uri"] = asp.URI - } - if asp.SourceType != "" { - objectMap["sourceType"] = asp.SourceType - } - if asp.FolderPath != nil { - objectMap["folderPath"] = asp.FolderPath - } - if asp.ArmTemplateFolderPath != nil { - objectMap["armTemplateFolderPath"] = asp.ArmTemplateFolderPath - } - if asp.BranchRef != nil { - objectMap["branchRef"] = asp.BranchRef - } - if asp.SecurityToken != nil { - objectMap["securityToken"] = asp.SecurityToken - } - if asp.Status != "" { - objectMap["status"] = asp.Status +// ArtifactSourceListIterator provides access to a complete listing of ArtifactSource values. +type ArtifactSourceListIterator struct { + i int + page ArtifactSourceListPage +} + +// 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 *ArtifactSourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArtifactSourceListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if asp.ProvisioningState != nil { - objectMap["provisioningState"] = asp.ProvisioningState + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - if asp.UniqueIdentifier != nil { - objectMap["uniqueIdentifier"] = asp.UniqueIdentifier + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err } - return json.Marshal(objectMap) + iter.i = 0 + return nil } -// ArtifactSourcePropertiesFragment properties of an artifact source. -type ArtifactSourcePropertiesFragment struct { +// 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 *ArtifactSourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ArtifactSourceListIterator) 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 ArtifactSourceListIterator) Response() ArtifactSourceList { + 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 ArtifactSourceListIterator) Value() ArtifactSource { + if !iter.page.NotDone() { + return ArtifactSource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ArtifactSourceListIterator type. +func NewArtifactSourceListIterator(page ArtifactSourceListPage) ArtifactSourceListIterator { + return ArtifactSourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (asl ArtifactSourceList) IsEmpty() bool { + return asl.Value == nil || len(*asl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (asl ArtifactSourceList) hasNextLink() bool { + return asl.NextLink != nil && len(*asl.NextLink) != 0 +} + +// artifactSourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (asl ArtifactSourceList) artifactSourceListPreparer(ctx context.Context) (*http.Request, error) { + if !asl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(asl.NextLink))) +} + +// ArtifactSourceListPage contains a page of ArtifactSource values. +type ArtifactSourceListPage struct { + fn func(context.Context, ArtifactSourceList) (ArtifactSourceList, error) + asl ArtifactSourceList +} + +// 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 *ArtifactSourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ArtifactSourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.asl) + if err != nil { + return err + } + page.asl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *ArtifactSourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ArtifactSourceListPage) NotDone() bool { + return !page.asl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ArtifactSourceListPage) Response() ArtifactSourceList { + return page.asl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ArtifactSourceListPage) Values() []ArtifactSource { + if page.asl.IsEmpty() { + return nil + } + return *page.asl.Value +} + +// Creates a new instance of the ArtifactSourceListPage type. +func NewArtifactSourceListPage(cur ArtifactSourceList, getNextPage func(context.Context, ArtifactSourceList) (ArtifactSourceList, error)) ArtifactSourceListPage { + return ArtifactSourceListPage{ + fn: getNextPage, + asl: cur, + } +} + +// ArtifactSourceProperties properties of an artifact source. +type ArtifactSourceProperties struct { // DisplayName - The artifact source's display name. DisplayName *string `json:"displayName,omitempty"` // URI - The artifact source's URI. @@ -863,12 +1198,64 @@ type ArtifactSourcePropertiesFragment struct { SecurityToken *string `json:"securityToken,omitempty"` // Status - Indicates if the artifact source is enabled (values: Enabled, Disabled). Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' Status EnableStatus `json:"status,omitempty"` - // ProvisioningState - The provisioning status of the resource. + // CreatedDate - READ-ONLY; The artifact source's creation date. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning status of the resource. ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` } +// MarshalJSON is the custom marshaler for ArtifactSourceProperties. +func (asp ArtifactSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asp.DisplayName != nil { + objectMap["displayName"] = asp.DisplayName + } + if asp.URI != nil { + objectMap["uri"] = asp.URI + } + if asp.SourceType != "" { + objectMap["sourceType"] = asp.SourceType + } + if asp.FolderPath != nil { + objectMap["folderPath"] = asp.FolderPath + } + if asp.ArmTemplateFolderPath != nil { + objectMap["armTemplateFolderPath"] = asp.ArmTemplateFolderPath + } + if asp.BranchRef != nil { + objectMap["branchRef"] = asp.BranchRef + } + if asp.SecurityToken != nil { + objectMap["securityToken"] = asp.SecurityToken + } + if asp.Status != "" { + objectMap["status"] = asp.Status + } + return json.Marshal(objectMap) +} + +// ArtifactSourcePropertiesFragment properties of an artifact source. +type ArtifactSourcePropertiesFragment struct { + // DisplayName - The artifact source's display name. + DisplayName *string `json:"displayName,omitempty"` + // URI - The artifact source's URI. + URI *string `json:"uri,omitempty"` + // SourceType - The artifact source's type. Possible values include: 'VsoGit', 'GitHub' + SourceType SourceControlType `json:"sourceType,omitempty"` + // FolderPath - The folder containing artifacts. + FolderPath *string `json:"folderPath,omitempty"` + // ArmTemplateFolderPath - The folder containing Azure Resource Manager templates. + ArmTemplateFolderPath *string `json:"armTemplateFolderPath,omitempty"` + // BranchRef - The artifact source's branch reference. + BranchRef *string `json:"branchRef,omitempty"` + // SecurityToken - The security token to authenticate to the artifact source. + SecurityToken *string `json:"securityToken,omitempty"` + // Status - Indicates if the artifact source is enabled (values: Enabled, Disabled). Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' + Status EnableStatus `json:"status,omitempty"` +} + // AttachDiskProperties properties of the disk to attach. type AttachDiskProperties struct { // LeasedByLabVMID - The resource ID of the Lab virtual machine to which the disk is attached. @@ -877,11 +1264,21 @@ type AttachDiskProperties struct { // AttachNewDataDiskOptions properties to attach new disk to the Virtual Machine. type AttachNewDataDiskOptions struct { - // DiskSizeGiB - Size of the disk to be attached in Gibibytes. + // DiskSizeGiB - Size of the disk to be attached in GibiBytes. + DiskSizeGiB *int32 `json:"diskSizeGiB,omitempty"` + // DiskName - The name of the disk to be attached. + DiskName *string `json:"diskName,omitempty"` + // DiskType - The storage type for the disk (i.e. Standard, Premium). Possible values include: 'Standard', 'Premium', 'StandardSSD' + DiskType StorageType `json:"diskType,omitempty"` +} + +// AttachNewDataDiskOptionsFragment properties to attach new disk to the Virtual Machine. +type AttachNewDataDiskOptionsFragment struct { + // DiskSizeGiB - Size of the disk to be attached in GibiBytes. DiskSizeGiB *int32 `json:"diskSizeGiB,omitempty"` // DiskName - The name of the disk to be attached. DiskName *string `json:"diskName,omitempty"` - // DiskType - The storage type for the disk (i.e. Standard, Premium). Possible values include: 'Standard', 'Premium' + // DiskType - The storage type for the disk (i.e. Standard, Premium). Possible values include: 'Standard', 'Premium', 'StandardSSD' DiskType StorageType `json:"diskType,omitempty"` } @@ -891,16 +1288,26 @@ type BulkCreationParameters struct { InstanceCount *int32 `json:"instanceCount,omitempty"` } +// BulkCreationParametersFragment parameters for creating multiple virtual machines as a single action. +type BulkCreationParametersFragment struct { + // InstanceCount - The number of virtual machine instances to create. + InstanceCount *int32 `json:"instanceCount,omitempty"` +} + // CloudError error from a REST request. type CloudError struct { + // Error - The cloud error that occurred Error *CloudErrorBody `json:"error,omitempty"` } // CloudErrorBody body of an error from a REST request. type CloudErrorBody struct { - Code *string `json:"code,omitempty"` + // Code - The error code. + Code *string `json:"code,omitempty"` + // Message - The error message. Message *string `json:"message,omitempty"` - Target *string `json:"target,omitempty"` + // Target - The error target. + Target *string `json:"target,omitempty"` // Details - Inner errors. Details *[]CloudErrorBody `json:"details,omitempty"` } @@ -1100,101 +1507,389 @@ func (ci *CustomImage) UnmarshalJSON(body []byte) error { return nil } -// CustomImageProperties properties of a custom image. -type CustomImageProperties struct { - // VM - The virtual machine from which the image is to be created. - VM *CustomImagePropertiesFromVM `json:"vm,omitempty"` - // Vhd - The VHD from which the image is to be created. - Vhd *CustomImagePropertiesCustom `json:"vhd,omitempty"` - // Description - The description of the custom image. - Description *string `json:"description,omitempty"` - // Author - The author of the custom image. - Author *string `json:"author,omitempty"` - // CreationDate - READ-ONLY; The creation date of the custom image. - CreationDate *date.Time `json:"creationDate,omitempty"` - // ManagedImageID - The Managed Image Id backing the custom image. - ManagedImageID *string `json:"managedImageId,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +// CustomImageFragment a custom image. +type CustomImageFragment struct { + // CustomImagePropertiesFragment - The properties of the resource. + *CustomImagePropertiesFragment `json:"properties,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for CustomImageProperties. -func (cip CustomImageProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for CustomImageFragment. +func (cif CustomImageFragment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if cip.VM != nil { - objectMap["vm"] = cip.VM - } - if cip.Vhd != nil { - objectMap["vhd"] = cip.Vhd - } - if cip.Description != nil { - objectMap["description"] = cip.Description - } - if cip.Author != nil { - objectMap["author"] = cip.Author - } - if cip.ManagedImageID != nil { - objectMap["managedImageId"] = cip.ManagedImageID + if cif.CustomImagePropertiesFragment != nil { + objectMap["properties"] = cif.CustomImagePropertiesFragment } - if cip.ProvisioningState != nil { - objectMap["provisioningState"] = cip.ProvisioningState - } - if cip.UniqueIdentifier != nil { - objectMap["uniqueIdentifier"] = cip.UniqueIdentifier + if cif.Tags != nil { + objectMap["tags"] = cif.Tags } return json.Marshal(objectMap) } -// CustomImagePropertiesCustom properties for creating a custom image from a VHD. -type CustomImagePropertiesCustom struct { - // ImageName - The image name. - ImageName *string `json:"imageName,omitempty"` - // SysPrep - Indicates whether sysprep has been run on the VHD. - SysPrep *bool `json:"sysPrep,omitempty"` - // OsType - The OS type of the custom image (i.e. Windows, Linux). Possible values include: 'Windows', 'Linux', 'None' - OsType CustomImageOsType `json:"osType,omitempty"` -} +// UnmarshalJSON is the custom unmarshaler for CustomImageFragment struct. +func (cif *CustomImageFragment) 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 customImagePropertiesFragment CustomImagePropertiesFragment + err = json.Unmarshal(*v, &customImagePropertiesFragment) + if err != nil { + return err + } + cif.CustomImagePropertiesFragment = &customImagePropertiesFragment + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cif.Tags = tags + } + } + } -// CustomImagePropertiesFromVM properties for creating a custom image from a virtual machine. -type CustomImagePropertiesFromVM struct { - // SourceVMID - The source vm identifier. - SourceVMID *string `json:"sourceVmId,omitempty"` - // WindowsOsInfo - The Windows OS information of the VM. - WindowsOsInfo *WindowsOsInfo `json:"windowsOsInfo,omitempty"` - // LinuxOsInfo - The Linux OS information of the VM. - LinuxOsInfo *LinuxOsInfo `json:"linuxOsInfo,omitempty"` + return nil } -// CustomImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type CustomImagesCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(CustomImagesClient) (CustomImage, error) +// CustomImageList the response of a list operation. +type CustomImageList struct { + autorest.Response `json:"-"` + // Value - Results of the list operation. + Value *[]CustomImage `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` } -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *CustomImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { - return err - } - future.FutureAPI = &azFuture - future.Result = future.result - return nil +// CustomImageListIterator provides access to a complete listing of CustomImage values. +type CustomImageListIterator struct { + i int + page CustomImageListPage } -// result is the default implementation for CustomImagesCreateOrUpdateFuture.Result. -func (future *CustomImagesCreateOrUpdateFuture) result(client CustomImagesClient) (ci CustomImage, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "dtl.CustomImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } +// 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 *CustomImageListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomImageListIterator.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 *CustomImageListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CustomImageListIterator) 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 CustomImageListIterator) Response() CustomImageList { + 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 CustomImageListIterator) Value() CustomImage { + if !iter.page.NotDone() { + return CustomImage{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CustomImageListIterator type. +func NewCustomImageListIterator(page CustomImageListPage) CustomImageListIterator { + return CustomImageListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cil CustomImageList) IsEmpty() bool { + return cil.Value == nil || len(*cil.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cil CustomImageList) hasNextLink() bool { + return cil.NextLink != nil && len(*cil.NextLink) != 0 +} + +// customImageListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cil CustomImageList) customImageListPreparer(ctx context.Context) (*http.Request, error) { + if !cil.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cil.NextLink))) +} + +// CustomImageListPage contains a page of CustomImage values. +type CustomImageListPage struct { + fn func(context.Context, CustomImageList) (CustomImageList, error) + cil CustomImageList +} + +// 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 *CustomImageListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomImageListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cil) + if err != nil { + return err + } + page.cil = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *CustomImageListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CustomImageListPage) NotDone() bool { + return !page.cil.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CustomImageListPage) Response() CustomImageList { + return page.cil +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CustomImageListPage) Values() []CustomImage { + if page.cil.IsEmpty() { + return nil + } + return *page.cil.Value +} + +// Creates a new instance of the CustomImageListPage type. +func NewCustomImageListPage(cur CustomImageList, getNextPage func(context.Context, CustomImageList) (CustomImageList, error)) CustomImageListPage { + return CustomImageListPage{ + fn: getNextPage, + cil: cur, + } +} + +// CustomImageProperties properties of a custom image. +type CustomImageProperties struct { + // VM - The virtual machine from which the image is to be created. + VM *CustomImagePropertiesFromVM `json:"vm,omitempty"` + // Vhd - The VHD from which the image is to be created. + Vhd *CustomImagePropertiesCustom `json:"vhd,omitempty"` + // Description - The description of the custom image. + Description *string `json:"description,omitempty"` + // Author - The author of the custom image. + Author *string `json:"author,omitempty"` + // CreationDate - READ-ONLY; The creation date of the custom image. + CreationDate *date.Time `json:"creationDate,omitempty"` + // ManagedImageID - The Managed Image Id backing the custom image. + ManagedImageID *string `json:"managedImageId,omitempty"` + // ManagedSnapshotID - The Managed Snapshot Id backing the custom image. + ManagedSnapshotID *string `json:"managedSnapshotId,omitempty"` + // DataDiskStorageInfo - Storage information about the data disks present in the custom image + DataDiskStorageInfo *[]DataDiskStorageTypeInfo `json:"dataDiskStorageInfo,omitempty"` + // CustomImagePlan - Storage information about the plan related to this custom image + CustomImagePlan *CustomImagePropertiesFromPlan `json:"customImagePlan,omitempty"` + // IsPlanAuthorized - Whether or not the custom images underlying offer/plan has been enabled for programmatic deployment + IsPlanAuthorized *bool `json:"isPlanAuthorized,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty"` + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomImageProperties. +func (cip CustomImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cip.VM != nil { + objectMap["vm"] = cip.VM + } + if cip.Vhd != nil { + objectMap["vhd"] = cip.Vhd + } + if cip.Description != nil { + objectMap["description"] = cip.Description + } + if cip.Author != nil { + objectMap["author"] = cip.Author + } + if cip.ManagedImageID != nil { + objectMap["managedImageId"] = cip.ManagedImageID + } + if cip.ManagedSnapshotID != nil { + objectMap["managedSnapshotId"] = cip.ManagedSnapshotID + } + if cip.DataDiskStorageInfo != nil { + objectMap["dataDiskStorageInfo"] = cip.DataDiskStorageInfo + } + if cip.CustomImagePlan != nil { + objectMap["customImagePlan"] = cip.CustomImagePlan + } + if cip.IsPlanAuthorized != nil { + objectMap["isPlanAuthorized"] = cip.IsPlanAuthorized + } + return json.Marshal(objectMap) +} + +// CustomImagePropertiesCustom properties for creating a custom image from a VHD. +type CustomImagePropertiesCustom struct { + // ImageName - The image name. + ImageName *string `json:"imageName,omitempty"` + // SysPrep - Indicates whether sysprep has been run on the VHD. + SysPrep *bool `json:"sysPrep,omitempty"` + // OsType - The OS type of the custom image (i.e. Windows, Linux). Possible values include: 'Windows', 'Linux', 'None' + OsType CustomImageOsType `json:"osType,omitempty"` +} + +// CustomImagePropertiesCustomFragment properties for creating a custom image from a VHD. +type CustomImagePropertiesCustomFragment struct { + // ImageName - The image name. + ImageName *string `json:"imageName,omitempty"` + // SysPrep - Indicates whether sysprep has been run on the VHD. + SysPrep *bool `json:"sysPrep,omitempty"` + // OsType - The OS type of the custom image (i.e. Windows, Linux). Possible values include: 'Windows', 'Linux', 'None' + OsType CustomImageOsType `json:"osType,omitempty"` +} + +// CustomImagePropertiesFragment properties of a custom image. +type CustomImagePropertiesFragment struct { + // VM - The virtual machine from which the image is to be created. + VM *CustomImagePropertiesFromVMFragment `json:"vm,omitempty"` + // Vhd - The VHD from which the image is to be created. + Vhd *CustomImagePropertiesCustomFragment `json:"vhd,omitempty"` + // Description - The description of the custom image. + Description *string `json:"description,omitempty"` + // Author - The author of the custom image. + Author *string `json:"author,omitempty"` + // ManagedImageID - The Managed Image Id backing the custom image. + ManagedImageID *string `json:"managedImageId,omitempty"` + // ManagedSnapshotID - The Managed Snapshot Id backing the custom image. + ManagedSnapshotID *string `json:"managedSnapshotId,omitempty"` + // DataDiskStorageInfo - Storage information about the data disks present in the custom image + DataDiskStorageInfo *[]DataDiskStorageTypeInfoFragment `json:"dataDiskStorageInfo,omitempty"` + // CustomImagePlan - Storage information about the plan related to this custom image + CustomImagePlan *CustomImagePropertiesFromPlanFragment `json:"customImagePlan,omitempty"` + // IsPlanAuthorized - Whether or not the custom images underlying offer/plan has been enabled for programmatic deployment + IsPlanAuthorized *bool `json:"isPlanAuthorized,omitempty"` +} + +// CustomImagePropertiesFromPlan properties for plan on a custom image. +type CustomImagePropertiesFromPlan struct { + // ID - The id of the plan, equivalent to name of the plan + ID *string `json:"id,omitempty"` + // Publisher - The publisher for the plan from the marketplace image the custom image is derived from + Publisher *string `json:"publisher,omitempty"` + // Offer - The offer for the plan from the marketplace image the custom image is derived from + Offer *string `json:"offer,omitempty"` +} + +// CustomImagePropertiesFromPlanFragment properties for plan on a custom image. +type CustomImagePropertiesFromPlanFragment struct { + // ID - The id of the plan, equivalent to name of the plan + ID *string `json:"id,omitempty"` + // Publisher - The publisher for the plan from the marketplace image the custom image is derived from + Publisher *string `json:"publisher,omitempty"` + // Offer - The offer for the plan from the marketplace image the custom image is derived from + Offer *string `json:"offer,omitempty"` +} + +// CustomImagePropertiesFromVM properties for creating a custom image from a virtual machine. +type CustomImagePropertiesFromVM struct { + // SourceVMID - The source vm identifier. + SourceVMID *string `json:"sourceVmId,omitempty"` + // WindowsOsInfo - The Windows OS information of the VM. + WindowsOsInfo *WindowsOsInfo `json:"windowsOsInfo,omitempty"` + // LinuxOsInfo - The Linux OS information of the VM. + LinuxOsInfo *LinuxOsInfo `json:"linuxOsInfo,omitempty"` +} + +// CustomImagePropertiesFromVMFragment properties for creating a custom image from a virtual machine. +type CustomImagePropertiesFromVMFragment struct { + // SourceVMID - The source vm identifier. + SourceVMID *string `json:"sourceVmId,omitempty"` + // WindowsOsInfo - The Windows OS information of the VM. + WindowsOsInfo *WindowsOsInfoFragment `json:"windowsOsInfo,omitempty"` + // LinuxOsInfo - The Linux OS information of the VM. + LinuxOsInfo *LinuxOsInfoFragment `json:"linuxOsInfo,omitempty"` +} + +// CustomImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type CustomImagesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(CustomImagesClient) (CustomImage, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *CustomImagesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for CustomImagesCreateOrUpdateFuture.Result. +func (future *CustomImagesCreateOrUpdateFuture) result(client CustomImagesClient) (ci CustomImage, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.CustomImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } if !done { ci.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("dtl.CustomImagesCreateOrUpdateFuture") @@ -1257,6 +1952,32 @@ type DataDiskProperties struct { HostCaching HostCachingOptions `json:"hostCaching,omitempty"` } +// DataDiskPropertiesFragment request body for adding a new or existing data disk to a virtual machine. +type DataDiskPropertiesFragment struct { + // AttachNewDataDiskOptions - Specifies options to attach a new disk to the virtual machine. + AttachNewDataDiskOptions *AttachNewDataDiskOptionsFragment `json:"attachNewDataDiskOptions,omitempty"` + // ExistingLabDiskID - Specifies the existing lab disk id to attach to virtual machine. + ExistingLabDiskID *string `json:"existingLabDiskId,omitempty"` + // HostCaching - Caching option for a data disk (i.e. None, ReadOnly, ReadWrite). Possible values include: 'HostCachingOptionsNone', 'HostCachingOptionsReadOnly', 'HostCachingOptionsReadWrite' + HostCaching HostCachingOptions `json:"hostCaching,omitempty"` +} + +// DataDiskStorageTypeInfo storage information about the data disks present in the custom image +type DataDiskStorageTypeInfo struct { + // Lun - Disk Lun + Lun *string `json:"lun,omitempty"` + // StorageType - Disk Storage Type. Possible values include: 'Standard', 'Premium', 'StandardSSD' + StorageType StorageType `json:"storageType,omitempty"` +} + +// DataDiskStorageTypeInfoFragment storage information about the data disks present in the custom image +type DataDiskStorageTypeInfoFragment struct { + // Lun - Disk Lun + Lun *string `json:"lun,omitempty"` + // StorageType - Disk Storage Type. Possible values include: 'Standard', 'Premium', 'StandardSSD' + StorageType StorageType `json:"storageType,omitempty"` +} + // DayDetails properties of a daily schedule. type DayDetails struct { // Time - The time of day the schedule will occur. @@ -1382,27 +2103,239 @@ func (d *Disk) UnmarshalJSON(body []byte) error { return nil } -// DiskProperties properties of a disk. -type DiskProperties struct { - // DiskType - The storage type for the disk (i.e. Standard, Premium). Possible values include: 'Standard', 'Premium' - DiskType StorageType `json:"diskType,omitempty"` - // DiskSizeGiB - The size of the disk in Gibibytes. - DiskSizeGiB *int32 `json:"diskSizeGiB,omitempty"` - // LeasedByLabVMID - The resource ID of the VM to which this disk is leased. - LeasedByLabVMID *string `json:"leasedByLabVmId,omitempty"` - // DiskBlobName - When backed by a blob, the name of the VHD blob without extension. - DiskBlobName *string `json:"diskBlobName,omitempty"` - // DiskURI - When backed by a blob, the URI of underlying blob. - DiskURI *string `json:"diskUri,omitempty"` - // CreatedDate - READ-ONLY; The creation date of the disk. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // HostCaching - The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite). - HostCaching *string `json:"hostCaching,omitempty"` - // ManagedDiskID - When backed by managed disk, this is the ID of the compute disk resource. +// DiskFragment a Disk. +type DiskFragment struct { + // DiskPropertiesFragment - The properties of the resource. + *DiskPropertiesFragment `json:"properties,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for DiskFragment. +func (df DiskFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if df.DiskPropertiesFragment != nil { + objectMap["properties"] = df.DiskPropertiesFragment + } + if df.Tags != nil { + objectMap["tags"] = df.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiskFragment struct. +func (df *DiskFragment) 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 diskPropertiesFragment DiskPropertiesFragment + err = json.Unmarshal(*v, &diskPropertiesFragment) + if err != nil { + return err + } + df.DiskPropertiesFragment = &diskPropertiesFragment + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + df.Tags = tags + } + } + } + + return nil +} + +// DiskList the response of a list operation. +type DiskList struct { + autorest.Response `json:"-"` + // Value - Results of the list operation. + Value *[]Disk `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// DiskListIterator provides access to a complete listing of Disk values. +type DiskListIterator struct { + i int + page DiskListPage +} + +// 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 *DiskListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.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 *DiskListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiskListIterator) 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 DiskListIterator) Response() DiskList { + 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 DiskListIterator) Value() Disk { + if !iter.page.NotDone() { + return Disk{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiskListIterator type. +func NewDiskListIterator(page DiskListPage) DiskListIterator { + return DiskListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dl DiskList) IsEmpty() bool { + return dl.Value == nil || len(*dl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dl DiskList) hasNextLink() bool { + return dl.NextLink != nil && len(*dl.NextLink) != 0 +} + +// diskListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) { + if !dl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dl.NextLink))) +} + +// DiskListPage contains a page of Disk values. +type DiskListPage struct { + fn func(context.Context, DiskList) (DiskList, error) + dl DiskList +} + +// 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 *DiskListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dl) + if err != nil { + return err + } + page.dl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *DiskListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiskListPage) NotDone() bool { + return !page.dl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiskListPage) Response() DiskList { + return page.dl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiskListPage) Values() []Disk { + if page.dl.IsEmpty() { + return nil + } + return *page.dl.Value +} + +// Creates a new instance of the DiskListPage type. +func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage { + return DiskListPage{ + fn: getNextPage, + dl: cur, + } +} + +// DiskProperties properties of a disk. +type DiskProperties struct { + // DiskType - The storage type for the disk (i.e. Standard, Premium). Possible values include: 'Standard', 'Premium', 'StandardSSD' + DiskType StorageType `json:"diskType,omitempty"` + // DiskSizeGiB - The size of the disk in GibiBytes. + DiskSizeGiB *int32 `json:"diskSizeGiB,omitempty"` + // LeasedByLabVMID - The resource ID of the VM to which this disk is leased. + LeasedByLabVMID *string `json:"leasedByLabVmId,omitempty"` + // DiskBlobName - When backed by a blob, the name of the VHD blob without extension. + DiskBlobName *string `json:"diskBlobName,omitempty"` + // DiskURI - When backed by a blob, the URI of underlying blob. + DiskURI *string `json:"diskUri,omitempty"` + // CreatedDate - READ-ONLY; The creation date of the disk. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // HostCaching - The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite). + HostCaching *string `json:"hostCaching,omitempty"` + // ManagedDiskID - When backed by managed disk, this is the ID of the compute disk resource. ManagedDiskID *string `json:"managedDiskId,omitempty"` - // ProvisioningState - The provisioning status of the resource. + // ProvisioningState - READ-ONLY; The provisioning status of the resource. ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` } @@ -1430,15 +2363,27 @@ func (dp DiskProperties) MarshalJSON() ([]byte, error) { if dp.ManagedDiskID != nil { objectMap["managedDiskId"] = dp.ManagedDiskID } - if dp.ProvisioningState != nil { - objectMap["provisioningState"] = dp.ProvisioningState - } - if dp.UniqueIdentifier != nil { - objectMap["uniqueIdentifier"] = dp.UniqueIdentifier - } return json.Marshal(objectMap) } +// DiskPropertiesFragment properties of a disk. +type DiskPropertiesFragment struct { + // DiskType - The storage type for the disk (i.e. Standard, Premium). Possible values include: 'Standard', 'Premium', 'StandardSSD' + DiskType StorageType `json:"diskType,omitempty"` + // DiskSizeGiB - The size of the disk in GibiBytes. + DiskSizeGiB *int32 `json:"diskSizeGiB,omitempty"` + // LeasedByLabVMID - The resource ID of the VM to which this disk is leased. + LeasedByLabVMID *string `json:"leasedByLabVmId,omitempty"` + // DiskBlobName - When backed by a blob, the name of the VHD blob without extension. + DiskBlobName *string `json:"diskBlobName,omitempty"` + // DiskURI - When backed by a blob, the URI of underlying blob. + DiskURI *string `json:"diskUri,omitempty"` + // HostCaching - The host caching policy of the disk (i.e. None, ReadOnly, ReadWrite). + HostCaching *string `json:"hostCaching,omitempty"` + // ManagedDiskID - When backed by managed disk, this is the ID of the compute disk resource. + ManagedDiskID *string `json:"managedDiskId,omitempty"` +} + // DisksAttachFuture an abstraction for monitoring and retrieving the results of a long-running operation. type DisksAttachFuture struct { azure.FutureAPI @@ -1699,68 +2644,290 @@ type EnvironmentDeploymentProperties struct { Parameters *[]ArmTemplateParameterProperties `json:"parameters,omitempty"` } -// EnvironmentProperties properties of an environment. -type EnvironmentProperties struct { - // DeploymentProperties - The deployment properties of the environment. - DeploymentProperties *EnvironmentDeploymentProperties `json:"deploymentProperties,omitempty"` - // ArmTemplateDisplayName - The display name of the Azure Resource Manager template that produced the environment. - ArmTemplateDisplayName *string `json:"armTemplateDisplayName,omitempty"` - // ResourceGroupID - READ-ONLY; The identifier of the resource group containing the environment's resources. - ResourceGroupID *string `json:"resourceGroupId,omitempty"` - // CreatedByUser - READ-ONLY; The creator of the environment. - CreatedByUser *string `json:"createdByUser,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +// EnvironmentDeploymentPropertiesFragment properties of an environment deployment. +type EnvironmentDeploymentPropertiesFragment struct { + // ArmTemplateID - The Azure Resource Manager template's identifier. + ArmTemplateID *string `json:"armTemplateId,omitempty"` + // Parameters - The parameters of the Azure Resource Manager template. + Parameters *[]ArmTemplateParameterPropertiesFragment `json:"parameters,omitempty"` } -// MarshalJSON is the custom marshaler for EnvironmentProperties. -func (ep EnvironmentProperties) MarshalJSON() ([]byte, error) { +// EnvironmentFragment an environment, which is essentially an ARM template deployment. +type EnvironmentFragment struct { + // EnvironmentPropertiesFragment - The properties of the resource. + *EnvironmentPropertiesFragment `json:"properties,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for EnvironmentFragment. +func (ef EnvironmentFragment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if ep.DeploymentProperties != nil { - objectMap["deploymentProperties"] = ep.DeploymentProperties - } - if ep.ArmTemplateDisplayName != nil { - objectMap["armTemplateDisplayName"] = ep.ArmTemplateDisplayName + if ef.EnvironmentPropertiesFragment != nil { + objectMap["properties"] = ef.EnvironmentPropertiesFragment } - if ep.ProvisioningState != nil { - objectMap["provisioningState"] = ep.ProvisioningState - } - if ep.UniqueIdentifier != nil { - objectMap["uniqueIdentifier"] = ep.UniqueIdentifier + if ef.Tags != nil { + objectMap["tags"] = ef.Tags } return json.Marshal(objectMap) } -// EnvironmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type EnvironmentsCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(EnvironmentsClient) (Environment, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *EnvironmentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { +// UnmarshalJSON is the custom unmarshaler for EnvironmentFragment struct. +func (ef *EnvironmentFragment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { return err } - future.FutureAPI = &azFuture - future.Result = future.result + for k, v := range m { + switch k { + case "properties": + if v != nil { + var environmentPropertiesFragment EnvironmentPropertiesFragment + err = json.Unmarshal(*v, &environmentPropertiesFragment) + if err != nil { + return err + } + ef.EnvironmentPropertiesFragment = &environmentPropertiesFragment + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ef.Tags = tags + } + } + } + return nil } -// result is the default implementation for EnvironmentsCreateOrUpdateFuture.Result. -func (future *EnvironmentsCreateOrUpdateFuture) result(client EnvironmentsClient) (e Environment, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "dtl.EnvironmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") - return - } +// EnvironmentList the response of a list operation. +type EnvironmentList struct { + autorest.Response `json:"-"` + // Value - Results of the list operation. + Value *[]Environment `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// EnvironmentListIterator provides access to a complete listing of Environment values. +type EnvironmentListIterator struct { + i int + page EnvironmentListPage +} + +// 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 *EnvironmentListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EnvironmentListIterator.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 *EnvironmentListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EnvironmentListIterator) 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 EnvironmentListIterator) Response() EnvironmentList { + 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 EnvironmentListIterator) Value() Environment { + if !iter.page.NotDone() { + return Environment{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EnvironmentListIterator type. +func NewEnvironmentListIterator(page EnvironmentListPage) EnvironmentListIterator { + return EnvironmentListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (el EnvironmentList) IsEmpty() bool { + return el.Value == nil || len(*el.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (el EnvironmentList) hasNextLink() bool { + return el.NextLink != nil && len(*el.NextLink) != 0 +} + +// environmentListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (el EnvironmentList) environmentListPreparer(ctx context.Context) (*http.Request, error) { + if !el.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(el.NextLink))) +} + +// EnvironmentListPage contains a page of Environment values. +type EnvironmentListPage struct { + fn func(context.Context, EnvironmentList) (EnvironmentList, error) + el EnvironmentList +} + +// 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 *EnvironmentListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EnvironmentListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.el) + if err != nil { + return err + } + page.el = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *EnvironmentListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EnvironmentListPage) NotDone() bool { + return !page.el.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EnvironmentListPage) Response() EnvironmentList { + return page.el +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EnvironmentListPage) Values() []Environment { + if page.el.IsEmpty() { + return nil + } + return *page.el.Value +} + +// Creates a new instance of the EnvironmentListPage type. +func NewEnvironmentListPage(cur EnvironmentList, getNextPage func(context.Context, EnvironmentList) (EnvironmentList, error)) EnvironmentListPage { + return EnvironmentListPage{ + fn: getNextPage, + el: cur, + } +} + +// EnvironmentProperties properties of an environment. +type EnvironmentProperties struct { + // DeploymentProperties - The deployment properties of the environment. + DeploymentProperties *EnvironmentDeploymentProperties `json:"deploymentProperties,omitempty"` + // ArmTemplateDisplayName - The display name of the Azure Resource Manager template that produced the environment. + ArmTemplateDisplayName *string `json:"armTemplateDisplayName,omitempty"` + // ResourceGroupID - READ-ONLY; The identifier of the resource group containing the environment's resources. + ResourceGroupID *string `json:"resourceGroupId,omitempty"` + // CreatedByUser - READ-ONLY; The creator of the environment. + CreatedByUser *string `json:"createdByUser,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty"` + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +} + +// MarshalJSON is the custom marshaler for EnvironmentProperties. +func (ep EnvironmentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ep.DeploymentProperties != nil { + objectMap["deploymentProperties"] = ep.DeploymentProperties + } + if ep.ArmTemplateDisplayName != nil { + objectMap["armTemplateDisplayName"] = ep.ArmTemplateDisplayName + } + return json.Marshal(objectMap) +} + +// EnvironmentPropertiesFragment properties of an environment. +type EnvironmentPropertiesFragment struct { + // DeploymentProperties - The deployment properties of the environment. + DeploymentProperties *EnvironmentDeploymentPropertiesFragment `json:"deploymentProperties,omitempty"` + // ArmTemplateDisplayName - The display name of the Azure Resource Manager template that produced the environment. + ArmTemplateDisplayName *string `json:"armTemplateDisplayName,omitempty"` +} + +// EnvironmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type EnvironmentsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(EnvironmentsClient) (Environment, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *EnvironmentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for EnvironmentsCreateOrUpdateFuture.Result. +func (future *EnvironmentsCreateOrUpdateFuture) result(client EnvironmentsClient) (e Environment, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.EnvironmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } if !done { e.Response.Response = future.Response() err = azure.NewAsyncOpIncompleteError("dtl.EnvironmentsCreateOrUpdateFuture") @@ -1821,6 +2988,8 @@ type EvaluatePoliciesProperties struct { FactData *string `json:"factData,omitempty"` // ValueOffset - The value offset. ValueOffset *string `json:"valueOffset,omitempty"` + // UserObjectID - The user for which policies will be evaluated + UserObjectID *string `json:"userObjectId,omitempty"` } // EvaluatePoliciesRequest request body for evaluating a policy set. @@ -1973,82 +3142,308 @@ func (f *Formula) UnmarshalJSON(body []byte) error { return nil } -// FormulaProperties properties of a formula. -type FormulaProperties struct { - // Description - The description of the formula. - Description *string `json:"description,omitempty"` - // Author - The author of the formula. - Author *string `json:"author,omitempty"` - // OsType - The OS type of the formula. - OsType *string `json:"osType,omitempty"` - // CreationDate - READ-ONLY; The creation date of the formula. - CreationDate *date.Time `json:"creationDate,omitempty"` - // FormulaContent - The content of the formula. - FormulaContent *LabVirtualMachineCreationParameter `json:"formulaContent,omitempty"` - // VM - Information about a VM from which a formula is to be created. - VM *FormulaPropertiesFromVM `json:"vm,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +// FormulaFragment a formula for creating a VM, specifying an image base and other parameters +type FormulaFragment struct { + // FormulaPropertiesFragment - The properties of the resource. + *FormulaPropertiesFragment `json:"properties,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for FormulaProperties. -func (fp FormulaProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for FormulaFragment. +func (ff FormulaFragment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if fp.Description != nil { - objectMap["description"] = fp.Description - } - if fp.Author != nil { - objectMap["author"] = fp.Author - } - if fp.OsType != nil { - objectMap["osType"] = fp.OsType - } - if fp.FormulaContent != nil { - objectMap["formulaContent"] = fp.FormulaContent - } - if fp.VM != nil { - objectMap["vm"] = fp.VM - } - if fp.ProvisioningState != nil { - objectMap["provisioningState"] = fp.ProvisioningState + if ff.FormulaPropertiesFragment != nil { + objectMap["properties"] = ff.FormulaPropertiesFragment } - if fp.UniqueIdentifier != nil { - objectMap["uniqueIdentifier"] = fp.UniqueIdentifier + if ff.Tags != nil { + objectMap["tags"] = ff.Tags } return json.Marshal(objectMap) } -// FormulaPropertiesFromVM information about a VM from which a formula is to be created. -type FormulaPropertiesFromVM struct { - // LabVMID - The identifier of the VM from which a formula is to be created. - LabVMID *string `json:"labVmId,omitempty"` -} - -// FormulasCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type FormulasCreateOrUpdateFuture struct { - azure.FutureAPI - // Result returns the result of the asynchronous operation. - // If the operation has not completed it will return an error. - Result func(FormulasClient) (Formula, error) -} - -// UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *FormulasCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { - var azFuture azure.Future - if err := json.Unmarshal(body, &azFuture); err != nil { +// UnmarshalJSON is the custom unmarshaler for FormulaFragment struct. +func (ff *FormulaFragment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { return err } - future.FutureAPI = &azFuture - future.Result = future.result + for k, v := range m { + switch k { + case "properties": + if v != nil { + var formulaPropertiesFragment FormulaPropertiesFragment + err = json.Unmarshal(*v, &formulaPropertiesFragment) + if err != nil { + return err + } + ff.FormulaPropertiesFragment = &formulaPropertiesFragment + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ff.Tags = tags + } + } + } + return nil } -// result is the default implementation for FormulasCreateOrUpdateFuture.Result. -func (future *FormulasCreateOrUpdateFuture) result(client FormulasClient) (f Formula, err error) { - var done bool +// FormulaList the response of a list operation. +type FormulaList struct { + autorest.Response `json:"-"` + // Value - Results of the list operation. + Value *[]Formula `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// FormulaListIterator provides access to a complete listing of Formula values. +type FormulaListIterator struct { + i int + page FormulaListPage +} + +// 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 *FormulaListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FormulaListIterator.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 *FormulaListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FormulaListIterator) 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 FormulaListIterator) Response() FormulaList { + 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 FormulaListIterator) Value() Formula { + if !iter.page.NotDone() { + return Formula{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FormulaListIterator type. +func NewFormulaListIterator(page FormulaListPage) FormulaListIterator { + return FormulaListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (fl FormulaList) IsEmpty() bool { + return fl.Value == nil || len(*fl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (fl FormulaList) hasNextLink() bool { + return fl.NextLink != nil && len(*fl.NextLink) != 0 +} + +// formulaListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (fl FormulaList) formulaListPreparer(ctx context.Context) (*http.Request, error) { + if !fl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(fl.NextLink))) +} + +// FormulaListPage contains a page of Formula values. +type FormulaListPage struct { + fn func(context.Context, FormulaList) (FormulaList, error) + fl FormulaList +} + +// 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 *FormulaListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FormulaListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.fl) + if err != nil { + return err + } + page.fl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *FormulaListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FormulaListPage) NotDone() bool { + return !page.fl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FormulaListPage) Response() FormulaList { + return page.fl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FormulaListPage) Values() []Formula { + if page.fl.IsEmpty() { + return nil + } + return *page.fl.Value +} + +// Creates a new instance of the FormulaListPage type. +func NewFormulaListPage(cur FormulaList, getNextPage func(context.Context, FormulaList) (FormulaList, error)) FormulaListPage { + return FormulaListPage{ + fn: getNextPage, + fl: cur, + } +} + +// FormulaProperties properties of a formula. +type FormulaProperties struct { + // Description - The description of the formula. + Description *string `json:"description,omitempty"` + // Author - The author of the formula. + Author *string `json:"author,omitempty"` + // OsType - The OS type of the formula. + OsType *string `json:"osType,omitempty"` + // CreationDate - READ-ONLY; The creation date of the formula. + CreationDate *date.Time `json:"creationDate,omitempty"` + // FormulaContent - The content of the formula. + FormulaContent *LabVirtualMachineCreationParameter `json:"formulaContent,omitempty"` + // VM - Information about a VM from which a formula is to be created. + VM *FormulaPropertiesFromVM `json:"vm,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty"` + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +} + +// MarshalJSON is the custom marshaler for FormulaProperties. +func (fp FormulaProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fp.Description != nil { + objectMap["description"] = fp.Description + } + if fp.Author != nil { + objectMap["author"] = fp.Author + } + if fp.OsType != nil { + objectMap["osType"] = fp.OsType + } + if fp.FormulaContent != nil { + objectMap["formulaContent"] = fp.FormulaContent + } + if fp.VM != nil { + objectMap["vm"] = fp.VM + } + return json.Marshal(objectMap) +} + +// FormulaPropertiesFragment properties of a formula. +type FormulaPropertiesFragment struct { + // Description - The description of the formula. + Description *string `json:"description,omitempty"` + // Author - The author of the formula. + Author *string `json:"author,omitempty"` + // OsType - The OS type of the formula. + OsType *string `json:"osType,omitempty"` + // FormulaContent - The content of the formula. + FormulaContent *LabVirtualMachineCreationParameterFragment `json:"formulaContent,omitempty"` + // VM - Information about a VM from which a formula is to be created. + VM *FormulaPropertiesFromVMFragment `json:"vm,omitempty"` +} + +// FormulaPropertiesFromVM information about a VM from which a formula is to be created. +type FormulaPropertiesFromVM struct { + // LabVMID - The identifier of the VM from which a formula is to be created. + LabVMID *string `json:"labVmId,omitempty"` +} + +// FormulaPropertiesFromVMFragment information about a VM from which a formula is to be created. +type FormulaPropertiesFromVMFragment struct { + // LabVMID - The identifier of the VM from which a formula is to be created. + LabVMID *string `json:"labVmId,omitempty"` +} + +// FormulasCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type FormulasCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(FormulasClient) (Formula, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *FormulasCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for FormulasCreateOrUpdateFuture.Result. +func (future *FormulasCreateOrUpdateFuture) result(client FormulasClient) (f Formula, err error) { + var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { err = autorest.NewErrorWithError(err, "dtl.FormulasCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") @@ -2169,44 +3564,213 @@ func (gi *GalleryImage) UnmarshalJSON(body []byte) error { return nil } -// GalleryImageProperties properties of a gallery image. -type GalleryImageProperties struct { - // Author - The author of the gallery image. - Author *string `json:"author,omitempty"` - // CreatedDate - READ-ONLY; The creation date of the gallery image. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // Description - The description of the gallery image. - Description *string `json:"description,omitempty"` - // ImageReference - The image reference of the gallery image. - ImageReference *GalleryImageReference `json:"imageReference,omitempty"` - // Icon - The icon of the gallery image. - Icon *string `json:"icon,omitempty"` - // Enabled - Indicates whether this gallery image is enabled. - Enabled *bool `json:"enabled,omitempty"` +// GalleryImageList the response of a list operation. +type GalleryImageList struct { + autorest.Response `json:"-"` + // Value - Results of the list operation. + Value *[]GalleryImage `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for GalleryImageProperties. -func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if gip.Author != nil { - objectMap["author"] = gip.Author - } - if gip.Description != nil { - objectMap["description"] = gip.Description - } - if gip.ImageReference != nil { - objectMap["imageReference"] = gip.ImageReference +// GalleryImageListIterator provides access to a complete listing of GalleryImage values. +type GalleryImageListIterator struct { + i int + page GalleryImageListPage +} + +// 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 *GalleryImageListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if gip.Icon != nil { - objectMap["icon"] = gip.Icon + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - if gip.Enabled != nil { - objectMap["enabled"] = gip.Enabled + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err } - return json.Marshal(objectMap) + iter.i = 0 + return nil } -// GalleryImageReference the reference information for an Azure Marketplace image. +// 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 *GalleryImageListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter GalleryImageListIterator) 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 GalleryImageListIterator) Response() GalleryImageList { + 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 GalleryImageListIterator) Value() GalleryImage { + if !iter.page.NotDone() { + return GalleryImage{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the GalleryImageListIterator type. +func NewGalleryImageListIterator(page GalleryImageListPage) GalleryImageListIterator { + return GalleryImageListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (gil GalleryImageList) IsEmpty() bool { + return gil.Value == nil || len(*gil.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (gil GalleryImageList) hasNextLink() bool { + return gil.NextLink != nil && len(*gil.NextLink) != 0 +} + +// galleryImageListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (gil GalleryImageList) galleryImageListPreparer(ctx context.Context) (*http.Request, error) { + if !gil.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(gil.NextLink))) +} + +// GalleryImageListPage contains a page of GalleryImage values. +type GalleryImageListPage struct { + fn func(context.Context, GalleryImageList) (GalleryImageList, error) + gil GalleryImageList +} + +// 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 *GalleryImageListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GalleryImageListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.gil) + if err != nil { + return err + } + page.gil = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *GalleryImageListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page GalleryImageListPage) NotDone() bool { + return !page.gil.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page GalleryImageListPage) Response() GalleryImageList { + return page.gil +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page GalleryImageListPage) Values() []GalleryImage { + if page.gil.IsEmpty() { + return nil + } + return *page.gil.Value +} + +// Creates a new instance of the GalleryImageListPage type. +func NewGalleryImageListPage(cur GalleryImageList, getNextPage func(context.Context, GalleryImageList) (GalleryImageList, error)) GalleryImageListPage { + return GalleryImageListPage{ + fn: getNextPage, + gil: cur, + } +} + +// GalleryImageProperties properties of a gallery image. +type GalleryImageProperties struct { + // Author - The author of the gallery image. + Author *string `json:"author,omitempty"` + // CreatedDate - READ-ONLY; The creation date of the gallery image. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // Description - The description of the gallery image. + Description *string `json:"description,omitempty"` + // ImageReference - The image reference of the gallery image. + ImageReference *GalleryImageReference `json:"imageReference,omitempty"` + // Icon - The icon of the gallery image. + Icon *string `json:"icon,omitempty"` + // Enabled - Indicates whether this gallery image is enabled. + Enabled *bool `json:"enabled,omitempty"` + // PlanID - The third party plan that applies to this image + PlanID *string `json:"planId,omitempty"` + // IsPlanAuthorized - Indicates if the plan has been authorized for programmatic deployment. + IsPlanAuthorized *bool `json:"isPlanAuthorized,omitempty"` +} + +// MarshalJSON is the custom marshaler for GalleryImageProperties. +func (gip GalleryImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gip.Author != nil { + objectMap["author"] = gip.Author + } + if gip.Description != nil { + objectMap["description"] = gip.Description + } + if gip.ImageReference != nil { + objectMap["imageReference"] = gip.ImageReference + } + if gip.Icon != nil { + objectMap["icon"] = gip.Icon + } + if gip.Enabled != nil { + objectMap["enabled"] = gip.Enabled + } + if gip.PlanID != nil { + objectMap["planId"] = gip.PlanID + } + if gip.IsPlanAuthorized != nil { + objectMap["isPlanAuthorized"] = gip.IsPlanAuthorized + } + return json.Marshal(objectMap) +} + +// GalleryImageReference the reference information for an Azure Marketplace image. type GalleryImageReference struct { // Offer - The offer of the gallery image. Offer *string `json:"offer,omitempty"` @@ -2357,6 +3921,15 @@ type IdentityProperties struct { ClientSecretURL *string `json:"clientSecretUrl,omitempty"` } +// ImportLabVirtualMachineRequest this represents the payload required to import a virtual machine from a +// different lab into the current one +type ImportLabVirtualMachineRequest struct { + // SourceVirtualMachineResourceID - The full resource ID of the virtual machine to be imported. + SourceVirtualMachineResourceID *string `json:"sourceVirtualMachineResourceId,omitempty"` + // DestinationVirtualMachineName - The name of the virtual machine in the destination lab + DestinationVirtualMachineName *string `json:"destinationVirtualMachineName,omitempty"` +} + // InboundNatRule a rule for NAT - exposing a VM's port (backendPort) on the public IP address using a load // balancer. type InboundNatRule struct { @@ -2480,6 +4053,59 @@ func (l *Lab) UnmarshalJSON(body []byte) error { return nil } +// LabAnnouncementProperties properties of a lab's announcement banner +type LabAnnouncementProperties struct { + // Title - The plain text title for the lab announcement + Title *string `json:"title,omitempty"` + // Markdown - The markdown text (if any) that this lab displays in the UI. If left empty/null, nothing will be shown. + Markdown *string `json:"markdown,omitempty"` + // Enabled - Is the lab announcement active/enabled at this time?. Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' + Enabled EnableStatus `json:"enabled,omitempty"` + // ExpirationDate - The time at which the announcement expires (null for never) + ExpirationDate *date.Time `json:"expirationDate,omitempty"` + // Expired - Has this announcement expired? + Expired *bool `json:"expired,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty"` + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +} + +// MarshalJSON is the custom marshaler for LabAnnouncementProperties. +func (lap LabAnnouncementProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lap.Title != nil { + objectMap["title"] = lap.Title + } + if lap.Markdown != nil { + objectMap["markdown"] = lap.Markdown + } + if lap.Enabled != "" { + objectMap["enabled"] = lap.Enabled + } + if lap.ExpirationDate != nil { + objectMap["expirationDate"] = lap.ExpirationDate + } + if lap.Expired != nil { + objectMap["expired"] = lap.Expired + } + return json.Marshal(objectMap) +} + +// LabAnnouncementPropertiesFragment properties of a lab's announcement banner +type LabAnnouncementPropertiesFragment struct { + // Title - The plain text title for the lab announcement + Title *string `json:"title,omitempty"` + // Markdown - The markdown text (if any) that this lab displays in the UI. If left empty/null, nothing will be shown. + Markdown *string `json:"markdown,omitempty"` + // Enabled - Is the lab announcement active/enabled at this time?. Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' + Enabled EnableStatus `json:"enabled,omitempty"` + // ExpirationDate - The time at which the announcement expires (null for never) + ExpirationDate *date.Time `json:"expirationDate,omitempty"` + // Expired - Has this announcement expired? + Expired *bool `json:"expired,omitempty"` +} + // LabCost a cost item. type LabCost struct { autorest.Response `json:"-"` @@ -2609,9 +4235,9 @@ type LabCostProperties struct { EndDateTime *date.Time `json:"endDateTime,omitempty"` // CreatedDate - The creation date of the cost. CreatedDate *date.Time `json:"createdDate,omitempty"` - // ProvisioningState - The provisioning status of the resource. + // ProvisioningState - READ-ONLY; The provisioning status of the resource. ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` } @@ -2633,12 +4259,6 @@ func (lcp LabCostProperties) MarshalJSON() ([]byte, error) { if lcp.CreatedDate != nil { objectMap["createdDate"] = lcp.CreatedDate } - if lcp.ProvisioningState != nil { - objectMap["provisioningState"] = lcp.ProvisioningState - } - if lcp.UniqueIdentifier != nil { - objectMap["uniqueIdentifier"] = lcp.UniqueIdentifier - } return json.Marshal(objectMap) } @@ -2652,14 +4272,6 @@ type LabCostSummaryProperties struct { type LabFragment struct { // LabPropertiesFragment - The properties of the resource. *LabPropertiesFragment `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` // Tags - The tags of the resource. Tags map[string]*string `json:"tags"` } @@ -2670,9 +4282,6 @@ func (lf LabFragment) MarshalJSON() ([]byte, error) { if lf.LabPropertiesFragment != nil { objectMap["properties"] = lf.LabPropertiesFragment } - if lf.Location != nil { - objectMap["location"] = lf.Location - } if lf.Tags != nil { objectMap["tags"] = lf.Tags } @@ -2697,42 +4306,6 @@ func (lf *LabFragment) UnmarshalJSON(body []byte) error { } lf.LabPropertiesFragment = &labPropertiesFragment } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - lf.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - lf.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - lf.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - lf.Location = &location - } case "tags": if v != nil { var tags map[string]*string @@ -2748,65 +4321,294 @@ func (lf *LabFragment) UnmarshalJSON(body []byte) error { return nil } -// LabProperties properties of a lab. -type LabProperties struct { - // DefaultStorageAccount - READ-ONLY; The lab's default storage account. - DefaultStorageAccount *string `json:"defaultStorageAccount,omitempty"` - // DefaultPremiumStorageAccount - READ-ONLY; The lab's default premium storage account. - DefaultPremiumStorageAccount *string `json:"defaultPremiumStorageAccount,omitempty"` - // ArtifactsStorageAccount - READ-ONLY; The lab's artifact storage account. - ArtifactsStorageAccount *string `json:"artifactsStorageAccount,omitempty"` - // PremiumDataDiskStorageAccount - READ-ONLY; The lab's premium data disk storage account. - PremiumDataDiskStorageAccount *string `json:"premiumDataDiskStorageAccount,omitempty"` - // VaultName - READ-ONLY; The lab's Key vault. - VaultName *string `json:"vaultName,omitempty"` - // LabStorageType - Type of storage used by the lab. It can be either Premium or Standard. Default is Premium. Possible values include: 'Standard', 'Premium' - LabStorageType StorageType `json:"labStorageType,omitempty"` - // CreatedDate - READ-ONLY; The creation date of the lab. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // PremiumDataDisks - The setting to enable usage of premium data disks. - // When its value is 'Enabled', creation of standard or premium data disks is allowed. - // When its value is 'Disabled', only creation of standard data disks is allowed. Possible values include: 'PremiumDataDiskDisabled', 'PremiumDataDiskEnabled' - PremiumDataDisks PremiumDataDisk `json:"premiumDataDisks,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +// LabList the response of a list operation. +type LabList struct { + autorest.Response `json:"-"` + // Value - Results of the list operation. + Value *[]Lab `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for LabProperties. -func (lp LabProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lp.LabStorageType != "" { - objectMap["labStorageType"] = lp.LabStorageType - } - if lp.PremiumDataDisks != "" { - objectMap["premiumDataDisks"] = lp.PremiumDataDisks +// LabListIterator provides access to a complete listing of Lab values. +type LabListIterator struct { + i int + page LabListPage +} + +// 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 *LabListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if lp.ProvisioningState != nil { - objectMap["provisioningState"] = lp.ProvisioningState + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - if lp.UniqueIdentifier != nil { - objectMap["uniqueIdentifier"] = lp.UniqueIdentifier + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err } - return json.Marshal(objectMap) -} - -// LabPropertiesFragment properties of a lab. -type LabPropertiesFragment struct { - // LabStorageType - Type of storage used by the lab. It can be either Premium or Standard. Default is Premium. Possible values include: 'Standard', 'Premium' - LabStorageType StorageType `json:"labStorageType,omitempty"` - // PremiumDataDisks - The setting to enable usage of premium data disks. - // When its value is 'Enabled', creation of standard or premium data disks is allowed. - // When its value is 'Disabled', only creation of standard data disks is allowed. Possible values include: 'PremiumDataDiskDisabled', 'PremiumDataDiskEnabled' - PremiumDataDisks PremiumDataDisk `json:"premiumDataDisks,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` + iter.i = 0 + return nil } -// LabResourceCostProperties the properties of a resource cost item. +// 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 *LabListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LabListIterator) 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 LabListIterator) Response() LabList { + 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 LabListIterator) Value() Lab { + if !iter.page.NotDone() { + return Lab{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LabListIterator type. +func NewLabListIterator(page LabListPage) LabListIterator { + return LabListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ll LabList) IsEmpty() bool { + return ll.Value == nil || len(*ll.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ll LabList) hasNextLink() bool { + return ll.NextLink != nil && len(*ll.NextLink) != 0 +} + +// labListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ll LabList) labListPreparer(ctx context.Context) (*http.Request, error) { + if !ll.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ll.NextLink))) +} + +// LabListPage contains a page of Lab values. +type LabListPage struct { + fn func(context.Context, LabList) (LabList, error) + ll LabList +} + +// 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 *LabListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ll) + if err != nil { + return err + } + page.ll = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *LabListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LabListPage) NotDone() bool { + return !page.ll.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LabListPage) Response() LabList { + return page.ll +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LabListPage) Values() []Lab { + if page.ll.IsEmpty() { + return nil + } + return *page.ll.Value +} + +// Creates a new instance of the LabListPage type. +func NewLabListPage(cur LabList, getNextPage func(context.Context, LabList) (LabList, error)) LabListPage { + return LabListPage{ + fn: getNextPage, + ll: cur, + } +} + +// LabProperties properties of a lab. +type LabProperties struct { + // DefaultStorageAccount - READ-ONLY; The lab's default storage account. + DefaultStorageAccount *string `json:"defaultStorageAccount,omitempty"` + // DefaultPremiumStorageAccount - READ-ONLY; The lab's default premium storage account. + DefaultPremiumStorageAccount *string `json:"defaultPremiumStorageAccount,omitempty"` + // ArtifactsStorageAccount - READ-ONLY; The lab's artifact storage account. + ArtifactsStorageAccount *string `json:"artifactsStorageAccount,omitempty"` + // PremiumDataDiskStorageAccount - READ-ONLY; The lab's premium data disk storage account. + PremiumDataDiskStorageAccount *string `json:"premiumDataDiskStorageAccount,omitempty"` + // VaultName - READ-ONLY; The lab's Key vault. + VaultName *string `json:"vaultName,omitempty"` + // LabStorageType - Type of storage used by the lab. It can be either Premium or Standard. Default is Premium. Possible values include: 'Standard', 'Premium', 'StandardSSD' + LabStorageType StorageType `json:"labStorageType,omitempty"` + // MandatoryArtifactsResourceIdsLinux - The ordered list of artifact resource IDs that should be applied on all Linux VM creations by default, prior to the artifacts specified by the user. + MandatoryArtifactsResourceIdsLinux *[]string `json:"mandatoryArtifactsResourceIdsLinux,omitempty"` + // MandatoryArtifactsResourceIdsWindows - The ordered list of artifact resource IDs that should be applied on all Windows VM creations by default, prior to the artifacts specified by the user. + MandatoryArtifactsResourceIdsWindows *[]string `json:"mandatoryArtifactsResourceIdsWindows,omitempty"` + // CreatedDate - READ-ONLY; The creation date of the lab. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // PremiumDataDisks - The setting to enable usage of premium data disks. + // When its value is 'Enabled', creation of standard or premium data disks is allowed. + // When its value is 'Disabled', only creation of standard data disks is allowed. Possible values include: 'PremiumDataDiskDisabled', 'PremiumDataDiskEnabled' + PremiumDataDisks PremiumDataDisk `json:"premiumDataDisks,omitempty"` + // EnvironmentPermission - The access rights to be granted to the user when provisioning an environment. Possible values include: 'Reader', 'Contributor' + EnvironmentPermission EnvironmentPermission `json:"environmentPermission,omitempty"` + // Announcement - The properties of any lab announcement associated with this lab + Announcement *LabAnnouncementProperties `json:"announcement,omitempty"` + // Support - The properties of any lab support message associated with this lab + Support *LabSupportProperties `json:"support,omitempty"` + // VMCreationResourceGroup - READ-ONLY; The resource group in which all new lab virtual machines will be created. To let DevTest Labs manage resource group creation, set this value to null. + VMCreationResourceGroup *string `json:"vmCreationResourceGroup,omitempty"` + // PublicIPID - READ-ONLY; The public IP address for the lab's load balancer. + PublicIPID *string `json:"publicIpId,omitempty"` + // LoadBalancerID - READ-ONLY; The load balancer used to for lab VMs that use shared IP address. + LoadBalancerID *string `json:"loadBalancerId,omitempty"` + // NetworkSecurityGroupID - READ-ONLY; The Network Security Group attached to the lab VMs Network interfaces to restrict open ports. + NetworkSecurityGroupID *string `json:"networkSecurityGroupId,omitempty"` + // ExtendedProperties - Extended properties of the lab used for experimental features + ExtendedProperties map[string]*string `json:"extendedProperties"` + // ProvisioningState - READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty"` + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +} + +// MarshalJSON is the custom marshaler for LabProperties. +func (lp LabProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lp.LabStorageType != "" { + objectMap["labStorageType"] = lp.LabStorageType + } + if lp.MandatoryArtifactsResourceIdsLinux != nil { + objectMap["mandatoryArtifactsResourceIdsLinux"] = lp.MandatoryArtifactsResourceIdsLinux + } + if lp.MandatoryArtifactsResourceIdsWindows != nil { + objectMap["mandatoryArtifactsResourceIdsWindows"] = lp.MandatoryArtifactsResourceIdsWindows + } + if lp.PremiumDataDisks != "" { + objectMap["premiumDataDisks"] = lp.PremiumDataDisks + } + if lp.EnvironmentPermission != "" { + objectMap["environmentPermission"] = lp.EnvironmentPermission + } + if lp.Announcement != nil { + objectMap["announcement"] = lp.Announcement + } + if lp.Support != nil { + objectMap["support"] = lp.Support + } + if lp.ExtendedProperties != nil { + objectMap["extendedProperties"] = lp.ExtendedProperties + } + return json.Marshal(objectMap) +} + +// LabPropertiesFragment properties of a lab. +type LabPropertiesFragment struct { + // LabStorageType - Type of storage used by the lab. It can be either Premium or Standard. Default is Premium. Possible values include: 'Standard', 'Premium', 'StandardSSD' + LabStorageType StorageType `json:"labStorageType,omitempty"` + // MandatoryArtifactsResourceIdsLinux - The ordered list of artifact resource IDs that should be applied on all Linux VM creations by default, prior to the artifacts specified by the user. + MandatoryArtifactsResourceIdsLinux *[]string `json:"mandatoryArtifactsResourceIdsLinux,omitempty"` + // MandatoryArtifactsResourceIdsWindows - The ordered list of artifact resource IDs that should be applied on all Windows VM creations by default, prior to the artifacts specified by the user. + MandatoryArtifactsResourceIdsWindows *[]string `json:"mandatoryArtifactsResourceIdsWindows,omitempty"` + // PremiumDataDisks - The setting to enable usage of premium data disks. + // When its value is 'Enabled', creation of standard or premium data disks is allowed. + // When its value is 'Disabled', only creation of standard data disks is allowed. Possible values include: 'PremiumDataDiskDisabled', 'PremiumDataDiskEnabled' + PremiumDataDisks PremiumDataDisk `json:"premiumDataDisks,omitempty"` + // EnvironmentPermission - The access rights to be granted to the user when provisioning an environment. Possible values include: 'Reader', 'Contributor' + EnvironmentPermission EnvironmentPermission `json:"environmentPermission,omitempty"` + // Announcement - The properties of any lab announcement associated with this lab + Announcement *LabAnnouncementPropertiesFragment `json:"announcement,omitempty"` + // Support - The properties of any lab support message associated with this lab + Support *LabSupportPropertiesFragment `json:"support,omitempty"` + // ExtendedProperties - Extended properties of the lab used for experimental features + ExtendedProperties map[string]*string `json:"extendedProperties"` +} + +// MarshalJSON is the custom marshaler for LabPropertiesFragment. +func (lpf LabPropertiesFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lpf.LabStorageType != "" { + objectMap["labStorageType"] = lpf.LabStorageType + } + if lpf.MandatoryArtifactsResourceIdsLinux != nil { + objectMap["mandatoryArtifactsResourceIdsLinux"] = lpf.MandatoryArtifactsResourceIdsLinux + } + if lpf.MandatoryArtifactsResourceIdsWindows != nil { + objectMap["mandatoryArtifactsResourceIdsWindows"] = lpf.MandatoryArtifactsResourceIdsWindows + } + if lpf.PremiumDataDisks != "" { + objectMap["premiumDataDisks"] = lpf.PremiumDataDisks + } + if lpf.EnvironmentPermission != "" { + objectMap["environmentPermission"] = lpf.EnvironmentPermission + } + if lpf.Announcement != nil { + objectMap["announcement"] = lpf.Announcement + } + if lpf.Support != nil { + objectMap["support"] = lpf.Support + } + if lpf.ExtendedProperties != nil { + objectMap["extendedProperties"] = lpf.ExtendedProperties + } + return json.Marshal(objectMap) +} + +// LabResourceCostProperties the properties of a resource cost item. type LabResourceCostProperties struct { // Resourcename - The name of the resource. Resourcename *string `json:"resourcename,omitempty"` @@ -3018,56 +4820,268 @@ func (future *LabsExportResourceUsageFuture) result(client LabsClient) (ar autor return } +// LabsImportVirtualMachineFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type LabsImportVirtualMachineFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LabsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LabsImportVirtualMachineFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LabsImportVirtualMachineFuture.Result. +func (future *LabsImportVirtualMachineFuture) result(client LabsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.LabsImportVirtualMachineFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.LabsImportVirtualMachineFuture") + return + } + ar.Response = future.Response() + return +} + +// LabSupportProperties properties of a lab's support banner +type LabSupportProperties struct { + // Enabled - Is the lab support banner active/enabled at this time?. Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' + Enabled EnableStatus `json:"enabled,omitempty"` + // Markdown - The markdown text (if any) that this lab displays in the UI. If left empty/null, nothing will be shown. + Markdown *string `json:"markdown,omitempty"` +} + +// LabSupportPropertiesFragment properties of a lab's support banner +type LabSupportPropertiesFragment struct { + // Enabled - Is the lab support banner active/enabled at this time?. Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' + Enabled EnableStatus `json:"enabled,omitempty"` + // Markdown - The markdown text (if any) that this lab displays in the UI. If left empty/null, nothing will be shown. + Markdown *string `json:"markdown,omitempty"` +} + // LabVhd properties of a VHD in the lab. type LabVhd struct { // ID - The URI to the VHD. ID *string `json:"id,omitempty"` } -// LabVirtualMachine a virtual machine. -type LabVirtualMachine struct { +// LabVhdList the response of a list operation. +type LabVhdList struct { autorest.Response `json:"-"` - // LabVirtualMachineProperties - The properties of the resource. - *LabVirtualMachineProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` - // Tags - The tags of the resource. - Tags map[string]*string `json:"tags"` + // Value - Results of the list operation. + Value *[]LabVhd `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for LabVirtualMachine. -func (lvm LabVirtualMachine) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lvm.LabVirtualMachineProperties != nil { - objectMap["properties"] = lvm.LabVirtualMachineProperties +// LabVhdListIterator provides access to a complete listing of LabVhd values. +type LabVhdListIterator struct { + i int + page LabVhdListPage +} + +// 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 *LabVhdListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabVhdListIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() } - if lvm.Location != nil { - objectMap["location"] = lvm.Location + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil } - if lvm.Tags != nil { - objectMap["tags"] = lvm.Tags + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err } - return json.Marshal(objectMap) + iter.i = 0 + return nil } -// UnmarshalJSON is the custom unmarshaler for LabVirtualMachine struct. -func (lvm *LabVirtualMachine) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { - return 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 *LabVhdListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LabVhdListIterator) 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 LabVhdListIterator) Response() LabVhdList { + 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 LabVhdListIterator) Value() LabVhd { + if !iter.page.NotDone() { + return LabVhd{} } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var labVirtualMachineProperties LabVirtualMachineProperties + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LabVhdListIterator type. +func NewLabVhdListIterator(page LabVhdListPage) LabVhdListIterator { + return LabVhdListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lvl LabVhdList) IsEmpty() bool { + return lvl.Value == nil || len(*lvl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lvl LabVhdList) hasNextLink() bool { + return lvl.NextLink != nil && len(*lvl.NextLink) != 0 +} + +// labVhdListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lvl LabVhdList) labVhdListPreparer(ctx context.Context) (*http.Request, error) { + if !lvl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lvl.NextLink))) +} + +// LabVhdListPage contains a page of LabVhd values. +type LabVhdListPage struct { + fn func(context.Context, LabVhdList) (LabVhdList, error) + lvl LabVhdList +} + +// 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 *LabVhdListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabVhdListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lvl) + if err != nil { + return err + } + page.lvl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *LabVhdListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LabVhdListPage) NotDone() bool { + return !page.lvl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LabVhdListPage) Response() LabVhdList { + return page.lvl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LabVhdListPage) Values() []LabVhd { + if page.lvl.IsEmpty() { + return nil + } + return *page.lvl.Value +} + +// Creates a new instance of the LabVhdListPage type. +func NewLabVhdListPage(cur LabVhdList, getNextPage func(context.Context, LabVhdList) (LabVhdList, error)) LabVhdListPage { + return LabVhdListPage{ + fn: getNextPage, + lvl: cur, + } +} + +// LabVirtualMachine a virtual machine. +type LabVirtualMachine struct { + autorest.Response `json:"-"` + // LabVirtualMachineProperties - The properties of the resource. + *LabVirtualMachineProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The identifier of the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for LabVirtualMachine. +func (lvm LabVirtualMachine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lvm.LabVirtualMachineProperties != nil { + objectMap["properties"] = lvm.LabVirtualMachineProperties + } + if lvm.Location != nil { + objectMap["location"] = lvm.Location + } + if lvm.Tags != nil { + objectMap["tags"] = lvm.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LabVirtualMachine struct. +func (lvm *LabVirtualMachine) 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 labVirtualMachineProperties LabVirtualMachineProperties err = json.Unmarshal(*v, &labVirtualMachineProperties) if err != nil { return err @@ -3206,105 +5220,38 @@ func (lvmcp *LabVirtualMachineCreationParameter) UnmarshalJSON(body []byte) erro return nil } -// LabVirtualMachineCreationParameterProperties properties for virtual machine creation. -type LabVirtualMachineCreationParameterProperties struct { - // BulkCreationParameters - The number of virtual machine instances to create. - BulkCreationParameters *BulkCreationParameters `json:"bulkCreationParameters,omitempty"` - // Notes - The notes of the virtual machine. - Notes *string `json:"notes,omitempty"` - // OwnerObjectID - The object identifier of the owner of the virtual machine. - OwnerObjectID *string `json:"ownerObjectId,omitempty"` - // OwnerUserPrincipalName - The user principal name of the virtual machine owner. - OwnerUserPrincipalName *string `json:"ownerUserPrincipalName,omitempty"` - // CreatedByUserID - The object identifier of the creator of the virtual machine. - CreatedByUserID *string `json:"createdByUserId,omitempty"` - // CreatedByUser - The email address of creator of the virtual machine. - CreatedByUser *string `json:"createdByUser,omitempty"` - // CreatedDate - The creation date of the virtual machine. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // CustomImageID - The custom image identifier of the virtual machine. - CustomImageID *string `json:"customImageId,omitempty"` - // OsType - The OS type of the virtual machine. - OsType *string `json:"osType,omitempty"` - // Size - The size of the virtual machine. - Size *string `json:"size,omitempty"` - // UserName - The user name of the virtual machine. - UserName *string `json:"userName,omitempty"` - // Password - The password of the virtual machine administrator. - Password *string `json:"password,omitempty"` - // SSHKey - The SSH key of the virtual machine administrator. - SSHKey *string `json:"sshKey,omitempty"` - // IsAuthenticationWithSSHKey - Indicates whether this virtual machine uses an SSH key for authentication. - IsAuthenticationWithSSHKey *bool `json:"isAuthenticationWithSshKey,omitempty"` - // Fqdn - The fully-qualified domain name of the virtual machine. - Fqdn *string `json:"fqdn,omitempty"` - // LabSubnetName - The lab subnet name of the virtual machine. - LabSubnetName *string `json:"labSubnetName,omitempty"` - // LabVirtualNetworkID - The lab virtual network identifier of the virtual machine. - LabVirtualNetworkID *string `json:"labVirtualNetworkId,omitempty"` - // DisallowPublicIPAddress - Indicates whether the virtual machine is to be created without a public IP address. - DisallowPublicIPAddress *bool `json:"disallowPublicIpAddress,omitempty"` - // Artifacts - The artifacts to be installed on the virtual machine. - Artifacts *[]ArtifactInstallProperties `json:"artifacts,omitempty"` - // ArtifactDeploymentStatus - The artifact deployment status for the virtual machine. - ArtifactDeploymentStatus *ArtifactDeploymentStatusProperties `json:"artifactDeploymentStatus,omitempty"` - // GalleryImageReference - The Microsoft Azure Marketplace image reference of the virtual machine. - GalleryImageReference *GalleryImageReference `json:"galleryImageReference,omitempty"` - // ComputeVM - The compute virtual machine properties. - ComputeVM *ComputeVMProperties `json:"computeVm,omitempty"` - // NetworkInterface - The network interface properties. - NetworkInterface *NetworkInterfaceProperties `json:"networkInterface,omitempty"` - // ApplicableSchedule - The applicable schedule for the virtual machine. - ApplicableSchedule *ApplicableSchedule `json:"applicableSchedule,omitempty"` - // ExpirationDate - The expiration date for VM. - ExpirationDate *date.Time `json:"expirationDate,omitempty"` - // AllowClaim - Indicates whether another user can take ownership of the virtual machine - AllowClaim *bool `json:"allowClaim,omitempty"` - // StorageType - Storage type to use for virtual machine (i.e. Standard, Premium). - StorageType *string `json:"storageType,omitempty"` - // VirtualMachineCreationSource - Tells source of creation of lab virtual machine. Output property only. Possible values include: 'FromCustomImage', 'FromGalleryImage' - VirtualMachineCreationSource VirtualMachineCreationSource `json:"virtualMachineCreationSource,omitempty"` - // EnvironmentID - The resource ID of the environment that contains this virtual machine, if any. - EnvironmentID *string `json:"environmentId,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` -} - -// LabVirtualMachineFragment a virtual machine. -type LabVirtualMachineFragment struct { - // LabVirtualMachinePropertiesFragment - The properties of the resource. - *LabVirtualMachinePropertiesFragment `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. +// LabVirtualMachineCreationParameterFragment properties for creating a virtual machine. +type LabVirtualMachineCreationParameterFragment struct { + // LabVirtualMachineCreationParameterPropertiesFragment - The properties of the resource. + *LabVirtualMachineCreationParameterPropertiesFragment `json:"properties,omitempty"` + // Name - The name of the virtual machine or environment Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. + // Location - The location of the new virtual machine or environment Location *string `json:"location,omitempty"` // Tags - The tags of the resource. Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for LabVirtualMachineFragment. -func (lvmf LabVirtualMachineFragment) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for LabVirtualMachineCreationParameterFragment. +func (lvmcpf LabVirtualMachineCreationParameterFragment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if lvmf.LabVirtualMachinePropertiesFragment != nil { - objectMap["properties"] = lvmf.LabVirtualMachinePropertiesFragment + if lvmcpf.LabVirtualMachineCreationParameterPropertiesFragment != nil { + objectMap["properties"] = lvmcpf.LabVirtualMachineCreationParameterPropertiesFragment } - if lvmf.Location != nil { - objectMap["location"] = lvmf.Location + if lvmcpf.Name != nil { + objectMap["name"] = lvmcpf.Name } - if lvmf.Tags != nil { - objectMap["tags"] = lvmf.Tags + if lvmcpf.Location != nil { + objectMap["location"] = lvmcpf.Location + } + if lvmcpf.Tags != nil { + objectMap["tags"] = lvmcpf.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for LabVirtualMachineFragment struct. -func (lvmf *LabVirtualMachineFragment) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for LabVirtualMachineCreationParameterFragment struct. +func (lvmcpf *LabVirtualMachineCreationParameterFragment) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3314,21 +5261,12 @@ func (lvmf *LabVirtualMachineFragment) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var labVirtualMachinePropertiesFragment LabVirtualMachinePropertiesFragment - err = json.Unmarshal(*v, &labVirtualMachinePropertiesFragment) - if err != nil { - return err - } - lvmf.LabVirtualMachinePropertiesFragment = &labVirtualMachinePropertiesFragment - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) + var labVirtualMachineCreationParameterPropertiesFragment LabVirtualMachineCreationParameterPropertiesFragment + err = json.Unmarshal(*v, &labVirtualMachineCreationParameterPropertiesFragment) if err != nil { return err } - lvmf.ID = &ID + lvmcpf.LabVirtualMachineCreationParameterPropertiesFragment = &labVirtualMachineCreationParameterPropertiesFragment } case "name": if v != nil { @@ -3337,16 +5275,7 @@ func (lvmf *LabVirtualMachineFragment) UnmarshalJSON(body []byte) error { if err != nil { return err } - lvmf.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - lvmf.Type = &typeVar + lvmcpf.Name = &name } case "location": if v != nil { @@ -3355,7 +5284,7 @@ func (lvmf *LabVirtualMachineFragment) UnmarshalJSON(body []byte) error { if err != nil { return err } - lvmf.Location = &location + lvmcpf.Location = &location } case "tags": if v != nil { @@ -3364,7 +5293,7 @@ func (lvmf *LabVirtualMachineFragment) UnmarshalJSON(body []byte) error { if err != nil { return err } - lvmf.Tags = tags + lvmcpf.Tags = tags } } } @@ -3372,8 +5301,10 @@ func (lvmf *LabVirtualMachineFragment) UnmarshalJSON(body []byte) error { return nil } -// LabVirtualMachineProperties properties of a virtual machine. -type LabVirtualMachineProperties struct { +// LabVirtualMachineCreationParameterProperties properties for virtual machine creation. +type LabVirtualMachineCreationParameterProperties struct { + // BulkCreationParameters - The number of virtual machine instances to create. + BulkCreationParameters *BulkCreationParameters `json:"bulkCreationParameters,omitempty"` // Notes - The notes of the virtual machine. Notes *string `json:"notes,omitempty"` // OwnerObjectID - The object identifier of the owner of the virtual machine. @@ -3386,7 +5317,7 @@ type LabVirtualMachineProperties struct { CreatedByUser *string `json:"createdByUser,omitempty"` // CreatedDate - The creation date of the virtual machine. CreatedDate *date.Time `json:"createdDate,omitempty"` - // ComputeID - READ-ONLY; The resource identifier (Microsoft.Compute) of the virtual machine. + // ComputeID - The resource identifier (Microsoft.Compute) of the virtual machine. ComputeID *string `json:"computeId,omitempty"` // CustomImageID - The custom image identifier of the virtual machine. CustomImageID *string `json:"customImageId,omitempty"` @@ -3416,126 +5347,32 @@ type LabVirtualMachineProperties struct { ArtifactDeploymentStatus *ArtifactDeploymentStatusProperties `json:"artifactDeploymentStatus,omitempty"` // GalleryImageReference - The Microsoft Azure Marketplace image reference of the virtual machine. GalleryImageReference *GalleryImageReference `json:"galleryImageReference,omitempty"` - // ComputeVM - The compute virtual machine properties. - ComputeVM *ComputeVMProperties `json:"computeVm,omitempty"` + // PlanID - The id of the plan associated with the virtual machine image + PlanID *string `json:"planId,omitempty"` // NetworkInterface - The network interface properties. NetworkInterface *NetworkInterfaceProperties `json:"networkInterface,omitempty"` - // ApplicableSchedule - The applicable schedule for the virtual machine. - ApplicableSchedule *ApplicableSchedule `json:"applicableSchedule,omitempty"` // ExpirationDate - The expiration date for VM. ExpirationDate *date.Time `json:"expirationDate,omitempty"` // AllowClaim - Indicates whether another user can take ownership of the virtual machine AllowClaim *bool `json:"allowClaim,omitempty"` // StorageType - Storage type to use for virtual machine (i.e. Standard, Premium). StorageType *string `json:"storageType,omitempty"` - // VirtualMachineCreationSource - Tells source of creation of lab virtual machine. Output property only. Possible values include: 'FromCustomImage', 'FromGalleryImage' + // VirtualMachineCreationSource - Tells source of creation of lab virtual machine. Output property only. Possible values include: 'FromCustomImage', 'FromGalleryImage', 'FromSharedGalleryImage' VirtualMachineCreationSource VirtualMachineCreationSource `json:"virtualMachineCreationSource,omitempty"` // EnvironmentID - The resource ID of the environment that contains this virtual machine, if any. EnvironmentID *string `json:"environmentId,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` + // DataDiskParameters - New or existing data disks to attach to the virtual machine after creation + DataDiskParameters *[]DataDiskProperties `json:"dataDiskParameters,omitempty"` + // ScheduleParameters - Virtual Machine schedules to be created + ScheduleParameters *[]ScheduleCreationParameter `json:"scheduleParameters,omitempty"` + // LastKnownPowerState - Last known compute power state captured in DTL + LastKnownPowerState *string `json:"lastKnownPowerState,omitempty"` } -// MarshalJSON is the custom marshaler for LabVirtualMachineProperties. -func (lvmp LabVirtualMachineProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lvmp.Notes != nil { - objectMap["notes"] = lvmp.Notes - } - if lvmp.OwnerObjectID != nil { - objectMap["ownerObjectId"] = lvmp.OwnerObjectID - } - if lvmp.OwnerUserPrincipalName != nil { - objectMap["ownerUserPrincipalName"] = lvmp.OwnerUserPrincipalName - } - if lvmp.CreatedByUserID != nil { - objectMap["createdByUserId"] = lvmp.CreatedByUserID - } - if lvmp.CreatedByUser != nil { - objectMap["createdByUser"] = lvmp.CreatedByUser - } - if lvmp.CreatedDate != nil { - objectMap["createdDate"] = lvmp.CreatedDate - } - if lvmp.CustomImageID != nil { - objectMap["customImageId"] = lvmp.CustomImageID - } - if lvmp.OsType != nil { - objectMap["osType"] = lvmp.OsType - } - if lvmp.Size != nil { - objectMap["size"] = lvmp.Size - } - if lvmp.UserName != nil { - objectMap["userName"] = lvmp.UserName - } - if lvmp.Password != nil { - objectMap["password"] = lvmp.Password - } - if lvmp.SSHKey != nil { - objectMap["sshKey"] = lvmp.SSHKey - } - if lvmp.IsAuthenticationWithSSHKey != nil { - objectMap["isAuthenticationWithSshKey"] = lvmp.IsAuthenticationWithSSHKey - } - if lvmp.Fqdn != nil { - objectMap["fqdn"] = lvmp.Fqdn - } - if lvmp.LabSubnetName != nil { - objectMap["labSubnetName"] = lvmp.LabSubnetName - } - if lvmp.LabVirtualNetworkID != nil { - objectMap["labVirtualNetworkId"] = lvmp.LabVirtualNetworkID - } - if lvmp.DisallowPublicIPAddress != nil { - objectMap["disallowPublicIpAddress"] = lvmp.DisallowPublicIPAddress - } - if lvmp.Artifacts != nil { - objectMap["artifacts"] = lvmp.Artifacts - } - if lvmp.ArtifactDeploymentStatus != nil { - objectMap["artifactDeploymentStatus"] = lvmp.ArtifactDeploymentStatus - } - if lvmp.GalleryImageReference != nil { - objectMap["galleryImageReference"] = lvmp.GalleryImageReference - } - if lvmp.ComputeVM != nil { - objectMap["computeVm"] = lvmp.ComputeVM - } - if lvmp.NetworkInterface != nil { - objectMap["networkInterface"] = lvmp.NetworkInterface - } - if lvmp.ApplicableSchedule != nil { - objectMap["applicableSchedule"] = lvmp.ApplicableSchedule - } - if lvmp.ExpirationDate != nil { - objectMap["expirationDate"] = lvmp.ExpirationDate - } - if lvmp.AllowClaim != nil { - objectMap["allowClaim"] = lvmp.AllowClaim - } - if lvmp.StorageType != nil { - objectMap["storageType"] = lvmp.StorageType - } - if lvmp.VirtualMachineCreationSource != "" { - objectMap["virtualMachineCreationSource"] = lvmp.VirtualMachineCreationSource - } - if lvmp.EnvironmentID != nil { - objectMap["environmentId"] = lvmp.EnvironmentID - } - if lvmp.ProvisioningState != nil { - objectMap["provisioningState"] = lvmp.ProvisioningState - } - if lvmp.UniqueIdentifier != nil { - objectMap["uniqueIdentifier"] = lvmp.UniqueIdentifier - } - return json.Marshal(objectMap) -} - -// LabVirtualMachinePropertiesFragment properties of a virtual machine. -type LabVirtualMachinePropertiesFragment struct { +// LabVirtualMachineCreationParameterPropertiesFragment properties for virtual machine creation. +type LabVirtualMachineCreationParameterPropertiesFragment struct { + // BulkCreationParameters - The number of virtual machine instances to create. + BulkCreationParameters *BulkCreationParametersFragment `json:"bulkCreationParameters,omitempty"` // Notes - The notes of the virtual machine. Notes *string `json:"notes,omitempty"` // OwnerObjectID - The object identifier of the owner of the virtual machine. @@ -3548,6 +5385,8 @@ type LabVirtualMachinePropertiesFragment struct { CreatedByUser *string `json:"createdByUser,omitempty"` // CreatedDate - The creation date of the virtual machine. CreatedDate *date.Time `json:"createdDate,omitempty"` + // ComputeID - The resource identifier (Microsoft.Compute) of the virtual machine. + ComputeID *string `json:"computeId,omitempty"` // CustomImageID - The custom image identifier of the virtual machine. CustomImageID *string `json:"customImageId,omitempty"` // OsType - The OS type of the virtual machine. @@ -3576,112 +5415,50 @@ type LabVirtualMachinePropertiesFragment struct { ArtifactDeploymentStatus *ArtifactDeploymentStatusPropertiesFragment `json:"artifactDeploymentStatus,omitempty"` // GalleryImageReference - The Microsoft Azure Marketplace image reference of the virtual machine. GalleryImageReference *GalleryImageReferenceFragment `json:"galleryImageReference,omitempty"` - // ComputeVM - The compute virtual machine properties. - ComputeVM *ComputeVMPropertiesFragment `json:"computeVm,omitempty"` + // PlanID - The id of the plan associated with the virtual machine image + PlanID *string `json:"planId,omitempty"` // NetworkInterface - The network interface properties. NetworkInterface *NetworkInterfacePropertiesFragment `json:"networkInterface,omitempty"` - // ApplicableSchedule - The applicable schedule for the virtual machine. - ApplicableSchedule *ApplicableScheduleFragment `json:"applicableSchedule,omitempty"` // ExpirationDate - The expiration date for VM. ExpirationDate *date.Time `json:"expirationDate,omitempty"` // AllowClaim - Indicates whether another user can take ownership of the virtual machine AllowClaim *bool `json:"allowClaim,omitempty"` // StorageType - Storage type to use for virtual machine (i.e. Standard, Premium). StorageType *string `json:"storageType,omitempty"` - // VirtualMachineCreationSource - Tells source of creation of lab virtual machine. Output property only. Possible values include: 'FromCustomImage', 'FromGalleryImage' + // VirtualMachineCreationSource - Tells source of creation of lab virtual machine. Output property only. Possible values include: 'FromCustomImage', 'FromGalleryImage', 'FromSharedGalleryImage' VirtualMachineCreationSource VirtualMachineCreationSource `json:"virtualMachineCreationSource,omitempty"` // EnvironmentID - The resource ID of the environment that contains this virtual machine, if any. EnvironmentID *string `json:"environmentId,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` -} - -// LinuxOsInfo information about a Linux OS. -type LinuxOsInfo struct { - // LinuxOsState - The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, DeprovisionApplied). Possible values include: 'NonDeprovisioned', 'DeprovisionRequested', 'DeprovisionApplied' - LinuxOsState LinuxOsState `json:"linuxOsState,omitempty"` + // DataDiskParameters - New or existing data disks to attach to the virtual machine after creation + DataDiskParameters *[]DataDiskPropertiesFragment `json:"dataDiskParameters,omitempty"` + // ScheduleParameters - Virtual Machine schedules to be created + ScheduleParameters *[]ScheduleCreationParameterFragment `json:"scheduleParameters,omitempty"` + // LastKnownPowerState - Last known compute power state captured in DTL + LastKnownPowerState *string `json:"lastKnownPowerState,omitempty"` } -// NetworkInterfaceProperties properties of a network interface. -type NetworkInterfaceProperties struct { - // VirtualNetworkID - The resource ID of the virtual network. - VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` - // SubnetID - The resource ID of the sub net. - SubnetID *string `json:"subnetId,omitempty"` - // PublicIPAddressID - The resource ID of the public IP address. - PublicIPAddressID *string `json:"publicIpAddressId,omitempty"` - // PublicIPAddress - The public IP address. - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - // PrivateIPAddress - The private IP address. - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - // DNSName - The DNS name. - DNSName *string `json:"dnsName,omitempty"` - // RdpAuthority - The RdpAuthority property is a server DNS host name or IP address followed by the service port number for RDP (Remote Desktop Protocol). - RdpAuthority *string `json:"rdpAuthority,omitempty"` - // SSHAuthority - The SshAuthority property is a server DNS host name or IP address followed by the service port number for SSH. - SSHAuthority *string `json:"sshAuthority,omitempty"` - // SharedPublicIPAddressConfiguration - The configuration for sharing a public IP address across multiple virtual machines. - SharedPublicIPAddressConfiguration *SharedPublicIPAddressConfiguration `json:"sharedPublicIpAddressConfiguration,omitempty"` -} - -// NetworkInterfacePropertiesFragment properties of a network interface. -type NetworkInterfacePropertiesFragment struct { - // VirtualNetworkID - The resource ID of the virtual network. - VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` - // SubnetID - The resource ID of the sub net. - SubnetID *string `json:"subnetId,omitempty"` - // PublicIPAddressID - The resource ID of the public IP address. - PublicIPAddressID *string `json:"publicIpAddressId,omitempty"` - // PublicIPAddress - The public IP address. - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - // PrivateIPAddress - The private IP address. - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - // DNSName - The DNS name. - DNSName *string `json:"dnsName,omitempty"` - // RdpAuthority - The RdpAuthority property is a server DNS host name or IP address followed by the service port number for RDP (Remote Desktop Protocol). - RdpAuthority *string `json:"rdpAuthority,omitempty"` - // SSHAuthority - The SshAuthority property is a server DNS host name or IP address followed by the service port number for SSH. - SSHAuthority *string `json:"sshAuthority,omitempty"` - // SharedPublicIPAddressConfiguration - The configuration for sharing a public IP address across multiple virtual machines. - SharedPublicIPAddressConfiguration *SharedPublicIPAddressConfigurationFragment `json:"sharedPublicIpAddressConfiguration,omitempty"` -} - -// NotificationChannel a notification. -type NotificationChannel struct { - autorest.Response `json:"-"` - // NotificationChannelProperties - The properties of the resource. - *NotificationChannelProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` +// LabVirtualMachineFragment a virtual machine. +type LabVirtualMachineFragment struct { + // LabVirtualMachinePropertiesFragment - The properties of the resource. + *LabVirtualMachinePropertiesFragment `json:"properties,omitempty"` // Tags - The tags of the resource. Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for NotificationChannel. -func (nc NotificationChannel) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for LabVirtualMachineFragment. +func (lvmf LabVirtualMachineFragment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if nc.NotificationChannelProperties != nil { - objectMap["properties"] = nc.NotificationChannelProperties - } - if nc.Location != nil { - objectMap["location"] = nc.Location + if lvmf.LabVirtualMachinePropertiesFragment != nil { + objectMap["properties"] = lvmf.LabVirtualMachinePropertiesFragment } - if nc.Tags != nil { - objectMap["tags"] = nc.Tags + if lvmf.Tags != nil { + objectMap["tags"] = lvmf.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for NotificationChannel struct. -func (nc *NotificationChannel) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for LabVirtualMachineFragment struct. +func (lvmf *LabVirtualMachineFragment) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3691,48 +5468,12 @@ func (nc *NotificationChannel) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var notificationChannelProperties NotificationChannelProperties - err = json.Unmarshal(*v, ¬ificationChannelProperties) - if err != nil { - return err - } - nc.NotificationChannelProperties = ¬ificationChannelProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - nc.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - nc.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - nc.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var labVirtualMachinePropertiesFragment LabVirtualMachinePropertiesFragment + err = json.Unmarshal(*v, &labVirtualMachinePropertiesFragment) if err != nil { return err } - nc.Location = &location + lvmf.LabVirtualMachinePropertiesFragment = &labVirtualMachinePropertiesFragment } case "tags": if v != nil { @@ -3741,7 +5482,7 @@ func (nc *NotificationChannel) UnmarshalJSON(body []byte) error { if err != nil { return err } - nc.Tags = tags + lvmf.Tags = tags } } } @@ -3749,2199 +5490,634 @@ func (nc *NotificationChannel) UnmarshalJSON(body []byte) error { return nil } -// NotificationChannelFragment a notification. -type NotificationChannelFragment struct { - // NotificationChannelPropertiesFragment - The properties of the resource. - *NotificationChannelPropertiesFragment `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` - // Tags - The tags of the resource. - Tags map[string]*string `json:"tags"` +// LabVirtualMachineList the response of a list operation. +type LabVirtualMachineList struct { + autorest.Response `json:"-"` + // Value - Results of the list operation. + Value *[]LabVirtualMachine `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` } -// MarshalJSON is the custom marshaler for NotificationChannelFragment. -func (ncf NotificationChannelFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ncf.NotificationChannelPropertiesFragment != nil { - objectMap["properties"] = ncf.NotificationChannelPropertiesFragment - } - if ncf.Location != nil { - objectMap["location"] = ncf.Location - } - if ncf.Tags != nil { - objectMap["tags"] = ncf.Tags - } - return json.Marshal(objectMap) +// LabVirtualMachineListIterator provides access to a complete listing of LabVirtualMachine values. +type LabVirtualMachineListIterator struct { + i int + page LabVirtualMachineListPage } -// UnmarshalJSON is the custom unmarshaler for NotificationChannelFragment struct. -func (ncf *NotificationChannelFragment) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// 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 *LabVirtualMachineListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabVirtualMachineListIterator.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 } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var notificationChannelPropertiesFragment NotificationChannelPropertiesFragment - err = json.Unmarshal(*v, ¬ificationChannelPropertiesFragment) - if err != nil { - return err - } - ncf.NotificationChannelPropertiesFragment = ¬ificationChannelPropertiesFragment - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ncf.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ncf.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ncf.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - ncf.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - ncf.Tags = tags - } - } - } - + iter.i = 0 return nil } -// NotificationChannelProperties properties of a schedule. -type NotificationChannelProperties struct { - // WebHookURL - The webhook URL to send notifications to. - WebHookURL *string `json:"webHookUrl,omitempty"` - // Description - Description of notification. - Description *string `json:"description,omitempty"` - // Events - The list of event for which this notification is enabled. - Events *[]Event `json:"events,omitempty"` - // CreatedDate - READ-ONLY; The creation date of the notification channel. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +// 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 *LabVirtualMachineListIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// MarshalJSON is the custom marshaler for NotificationChannelProperties. -func (ncp NotificationChannelProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ncp.WebHookURL != nil { - objectMap["webHookUrl"] = ncp.WebHookURL - } - if ncp.Description != nil { - objectMap["description"] = ncp.Description - } - if ncp.Events != nil { - objectMap["events"] = ncp.Events - } - if ncp.ProvisioningState != nil { - objectMap["provisioningState"] = ncp.ProvisioningState - } - if ncp.UniqueIdentifier != nil { - objectMap["uniqueIdentifier"] = ncp.UniqueIdentifier - } - return json.Marshal(objectMap) +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LabVirtualMachineListIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// NotificationChannelPropertiesFragment properties of a schedule. -type NotificationChannelPropertiesFragment struct { - // WebHookURL - The webhook URL to send notifications to. - WebHookURL *string `json:"webHookUrl,omitempty"` - // Description - Description of notification. - Description *string `json:"description,omitempty"` - // Events - The list of event for which this notification is enabled. - Events *[]EventFragment `json:"events,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +// Response returns the raw server response from the last page request. +func (iter LabVirtualMachineListIterator) Response() LabVirtualMachineList { + return iter.page.Response() } -// NotificationSettings notification settings for a schedule. -type NotificationSettings struct { - // Status - If notifications are enabled for this schedule (i.e. Enabled, Disabled). Possible values include: 'NotificationStatusDisabled', 'NotificationStatusEnabled' - Status NotificationStatus `json:"status,omitempty"` - // TimeInMinutes - Time in minutes before event at which notification will be sent. - TimeInMinutes *int32 `json:"timeInMinutes,omitempty"` - // WebhookURL - The webhook URL to which the notification will be sent. - WebhookURL *string `json:"webhookUrl,omitempty"` +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter LabVirtualMachineListIterator) Value() LabVirtualMachine { + if !iter.page.NotDone() { + return LabVirtualMachine{} + } + return iter.page.Values()[iter.i] } -// NotificationSettingsFragment notification settings for a schedule. -type NotificationSettingsFragment struct { - // Status - If notifications are enabled for this schedule (i.e. Enabled, Disabled). Possible values include: 'NotificationStatusDisabled', 'NotificationStatusEnabled' - Status NotificationStatus `json:"status,omitempty"` - // TimeInMinutes - Time in minutes before event at which notification will be sent. - TimeInMinutes *int32 `json:"timeInMinutes,omitempty"` - // WebhookURL - The webhook URL to which the notification will be sent. - WebhookURL *string `json:"webhookUrl,omitempty"` +// Creates a new instance of the LabVirtualMachineListIterator type. +func NewLabVirtualMachineListIterator(page LabVirtualMachineListPage) LabVirtualMachineListIterator { + return LabVirtualMachineListIterator{page: page} } -// NotifyParameters properties for generating a Notification. -type NotifyParameters struct { - // EventName - The type of event (i.e. AutoShutdown, Cost). Possible values include: 'AutoShutdown', 'Cost' - EventName NotificationChannelEventType `json:"eventName,omitempty"` - // JSONPayload - Properties for the notification in json format. - JSONPayload *string `json:"jsonPayload,omitempty"` +// IsEmpty returns true if the ListResult contains no values. +func (lvml LabVirtualMachineList) IsEmpty() bool { + return lvml.Value == nil || len(*lvml.Value) == 0 } -// OperationError error details for the operation in case of a failure. -type OperationError struct { - // Code - The error code of the operation error. - Code *string `json:"code,omitempty"` - // Message - The error message of the operation error. - Message *string `json:"message,omitempty"` +// hasNextLink returns true if the NextLink is not empty. +func (lvml LabVirtualMachineList) hasNextLink() bool { + return lvml.NextLink != nil && len(*lvml.NextLink) != 0 } -// OperationMetadata the REST API operation supported by DevTestLab ResourceProvider. -type OperationMetadata struct { - // Name - Operation name: {provider}/{resource}/{operation} - Name *string `json:"name,omitempty"` - // Display - The object that describes the operations - Display *OperationMetadataDisplay `json:"display,omitempty"` +// labVirtualMachineListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lvml LabVirtualMachineList) labVirtualMachineListPreparer(ctx context.Context) (*http.Request, error) { + if !lvml.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lvml.NextLink))) } -// OperationMetadataDisplay the object that describes the operations -type OperationMetadataDisplay struct { - // Provider - Friendly name of the resource provider - Provider *string `json:"provider,omitempty"` - // Resource - Resource type on which the operation is performed. - Resource *string `json:"resource,omitempty"` - // Operation - Operation type: read, write, delete, listKeys/action, etc. - Operation *string `json:"operation,omitempty"` - // Description - Friendly name of the operation - Description *string `json:"description,omitempty"` +// LabVirtualMachineListPage contains a page of LabVirtualMachine values. +type LabVirtualMachineListPage struct { + fn func(context.Context, LabVirtualMachineList) (LabVirtualMachineList, error) + lvml LabVirtualMachineList } -// OperationResult an Operation Result -type OperationResult struct { - autorest.Response `json:"-"` - // Status - The operation status. - Status *string `json:"status,omitempty"` - // StatusCode - The status code for the operation. Possible values include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', 'PartialContent', 'MultipleChoices', 'MovedPermanently', 'Redirect', 'SeeOther', 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestURITooLong', 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', 'HTTPVersionNotSupported' - StatusCode HTTPStatusCode `json:"statusCode,omitempty"` - // Error - Error details for the operation in case of a failure. - Error *OperationError `json:"error,omitempty"` +// 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 *LabVirtualMachineListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabVirtualMachineListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lvml) + if err != nil { + return err + } + page.lvml = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil } -// ParameterInfo information about an artifact's parameter. -type ParameterInfo struct { - // Name - The name of the artifact parameter. - Name *string `json:"name,omitempty"` - // Value - The value of the artifact parameter. - Value *string `json:"value,omitempty"` +// 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 *LabVirtualMachineListPage) Next() error { + return page.NextWithContext(context.Background()) } -// ParametersValueFileInfo a file containing a set of parameter values for an ARM template. -type ParametersValueFileInfo struct { - // FileName - File name. - FileName *string `json:"fileName,omitempty"` - // ParametersValueInfo - Contents of the file. - ParametersValueInfo interface{} `json:"parametersValueInfo,omitempty"` +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LabVirtualMachineListPage) NotDone() bool { + return !page.lvml.IsEmpty() } -// PercentageCostThresholdProperties properties of a percentage cost threshold. -type PercentageCostThresholdProperties struct { - // ThresholdValue - The cost threshold value. - ThresholdValue *float64 `json:"thresholdValue,omitempty"` +// Response returns the raw server response from the last page request. +func (page LabVirtualMachineListPage) Response() LabVirtualMachineList { + return page.lvml } -// Policy a Policy. -type Policy struct { - autorest.Response `json:"-"` - // PolicyProperties - The properties of the resource. - *PolicyProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` - // Tags - The tags of the resource. - Tags map[string]*string `json:"tags"` +// Values returns the slice of values for the current page or nil if there are no values. +func (page LabVirtualMachineListPage) Values() []LabVirtualMachine { + if page.lvml.IsEmpty() { + return nil + } + return *page.lvml.Value } -// MarshalJSON is the custom marshaler for Policy. -func (p Policy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if p.PolicyProperties != nil { - objectMap["properties"] = p.PolicyProperties - } - if p.Location != nil { - objectMap["location"] = p.Location - } - if p.Tags != nil { - objectMap["tags"] = p.Tags +// Creates a new instance of the LabVirtualMachineListPage type. +func NewLabVirtualMachineListPage(cur LabVirtualMachineList, getNextPage func(context.Context, LabVirtualMachineList) (LabVirtualMachineList, error)) LabVirtualMachineListPage { + return LabVirtualMachineListPage{ + fn: getNextPage, + lvml: cur, } - return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for Policy struct. -func (p *Policy) 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 policyProperties PolicyProperties - err = json.Unmarshal(*v, &policyProperties) - if err != nil { - return err - } - p.PolicyProperties = &policyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - p.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - p.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - p.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - p.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - p.Tags = tags - } - } - } - - return nil -} - -// PolicyFragment a Policy. -type PolicyFragment struct { - // PolicyPropertiesFragment - The properties of the resource. - *PolicyPropertiesFragment `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` - // Tags - The tags of the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for PolicyFragment. -func (pf PolicyFragment) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pf.PolicyPropertiesFragment != nil { - objectMap["properties"] = pf.PolicyPropertiesFragment - } - if pf.Location != nil { - objectMap["location"] = pf.Location - } - if pf.Tags != nil { - objectMap["tags"] = pf.Tags - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for PolicyFragment struct. -func (pf *PolicyFragment) 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 policyPropertiesFragment PolicyPropertiesFragment - err = json.Unmarshal(*v, &policyPropertiesFragment) - if err != nil { - return err - } - pf.PolicyPropertiesFragment = &policyPropertiesFragment - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - pf.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - pf.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - pf.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - pf.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - pf.Tags = tags - } - } - } - - return nil -} - -// PolicyProperties properties of a Policy. -type PolicyProperties struct { - // Description - The description of the policy. - Description *string `json:"description,omitempty"` - // Status - The status of the policy. Possible values include: 'PolicyStatusEnabled', 'PolicyStatusDisabled' - Status PolicyStatus `json:"status,omitempty"` - // FactName - The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc. Possible values include: 'PolicyFactNameUserOwnedLabVMCount', 'PolicyFactNameUserOwnedLabPremiumVMCount', 'PolicyFactNameLabVMCount', 'PolicyFactNameLabPremiumVMCount', 'PolicyFactNameLabVMSize', 'PolicyFactNameGalleryImage', 'PolicyFactNameUserOwnedLabVMCountInSubnet', 'PolicyFactNameLabTargetCost' - FactName PolicyFactName `json:"factName,omitempty"` - // FactData - The fact data of the policy. - FactData *string `json:"factData,omitempty"` - // Threshold - The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy). - Threshold *string `json:"threshold,omitempty"` - // EvaluatorType - The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy). Possible values include: 'AllowedValuesPolicy', 'MaxValuePolicy' - EvaluatorType PolicyEvaluatorType `json:"evaluatorType,omitempty"` - // CreatedDate - READ-ONLY; The creation date of the policy. +// LabVirtualMachineProperties properties of a virtual machine. +type LabVirtualMachineProperties struct { + // Notes - The notes of the virtual machine. + Notes *string `json:"notes,omitempty"` + // OwnerObjectID - The object identifier of the owner of the virtual machine. + OwnerObjectID *string `json:"ownerObjectId,omitempty"` + // OwnerUserPrincipalName - The user principal name of the virtual machine owner. + OwnerUserPrincipalName *string `json:"ownerUserPrincipalName,omitempty"` + // CreatedByUserID - The object identifier of the creator of the virtual machine. + CreatedByUserID *string `json:"createdByUserId,omitempty"` + // CreatedByUser - The email address of creator of the virtual machine. + CreatedByUser *string `json:"createdByUser,omitempty"` + // CreatedDate - The creation date of the virtual machine. CreatedDate *date.Time `json:"createdDate,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` -} - -// MarshalJSON is the custom marshaler for PolicyProperties. -func (pp PolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if pp.Description != nil { - objectMap["description"] = pp.Description - } - if pp.Status != "" { - objectMap["status"] = pp.Status - } - if pp.FactName != "" { - objectMap["factName"] = pp.FactName - } - if pp.FactData != nil { - objectMap["factData"] = pp.FactData - } - if pp.Threshold != nil { - objectMap["threshold"] = pp.Threshold - } - if pp.EvaluatorType != "" { - objectMap["evaluatorType"] = pp.EvaluatorType - } - if pp.ProvisioningState != nil { - objectMap["provisioningState"] = pp.ProvisioningState - } - if pp.UniqueIdentifier != nil { - objectMap["uniqueIdentifier"] = pp.UniqueIdentifier - } - return json.Marshal(objectMap) -} - -// PolicyPropertiesFragment properties of a Policy. -type PolicyPropertiesFragment struct { - // Description - The description of the policy. - Description *string `json:"description,omitempty"` - // Status - The status of the policy. Possible values include: 'PolicyStatusEnabled', 'PolicyStatusDisabled' - Status PolicyStatus `json:"status,omitempty"` - // FactName - The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc. Possible values include: 'PolicyFactNameUserOwnedLabVMCount', 'PolicyFactNameUserOwnedLabPremiumVMCount', 'PolicyFactNameLabVMCount', 'PolicyFactNameLabPremiumVMCount', 'PolicyFactNameLabVMSize', 'PolicyFactNameGalleryImage', 'PolicyFactNameUserOwnedLabVMCountInSubnet', 'PolicyFactNameLabTargetCost' - FactName PolicyFactName `json:"factName,omitempty"` - // FactData - The fact data of the policy. - FactData *string `json:"factData,omitempty"` - // Threshold - The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy). - Threshold *string `json:"threshold,omitempty"` - // EvaluatorType - The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy). Possible values include: 'AllowedValuesPolicy', 'MaxValuePolicy' - EvaluatorType PolicyEvaluatorType `json:"evaluatorType,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` -} - -// PolicySetResult result of a policy set evaluation. -type PolicySetResult struct { - // HasError - A value indicating whether this policy set evaluation has discovered violations. - HasError *bool `json:"hasError,omitempty"` - // PolicyViolations - The list of policy violations. - PolicyViolations *[]PolicyViolation `json:"policyViolations,omitempty"` -} - -// PolicyViolation policy violation. -type PolicyViolation struct { - // Code - The code of the policy violation. - Code *string `json:"code,omitempty"` - // Message - The message of the policy violation. - Message *string `json:"message,omitempty"` -} - -// Port properties of a network port. -type Port struct { - // TransportProtocol - Protocol type of the port. Possible values include: 'TCP', 'UDP' - TransportProtocol TransportProtocol `json:"transportProtocol,omitempty"` - // BackendPort - Backend port of the target virtual machine. - BackendPort *int32 `json:"backendPort,omitempty"` -} - -// PortFragment properties of a network port. -type PortFragment struct { - // TransportProtocol - Protocol type of the port. Possible values include: 'TCP', 'UDP' - TransportProtocol TransportProtocol `json:"transportProtocol,omitempty"` - // BackendPort - Backend port of the target virtual machine. - BackendPort *int32 `json:"backendPort,omitempty"` -} - -// ProviderOperationResult result of the request to list REST API operations -type ProviderOperationResult struct { - autorest.Response `json:"-"` - // Value - List of operations supported by the resource provider. - Value *[]OperationMetadata `json:"value,omitempty"` - // NextLink - READ-ONLY; URL to get the next set of operation list results if there are any. - NextLink *string `json:"nextLink,omitempty"` -} - -// MarshalJSON is the custom marshaler for ProviderOperationResult. -func (por ProviderOperationResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if por.Value != nil { - objectMap["value"] = por.Value - } - return json.Marshal(objectMap) -} - -// ProviderOperationResultIterator provides access to a complete listing of OperationMetadata values. -type ProviderOperationResultIterator struct { - i int - page ProviderOperationResultPage -} - -// 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 *ProviderOperationResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationResultIterator.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 *ProviderOperationResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ProviderOperationResultIterator) 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 ProviderOperationResultIterator) Response() ProviderOperationResult { - 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 ProviderOperationResultIterator) Value() OperationMetadata { - if !iter.page.NotDone() { - return OperationMetadata{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ProviderOperationResultIterator type. -func NewProviderOperationResultIterator(page ProviderOperationResultPage) ProviderOperationResultIterator { - return ProviderOperationResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (por ProviderOperationResult) IsEmpty() bool { - return por.Value == nil || len(*por.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (por ProviderOperationResult) hasNextLink() bool { - return por.NextLink != nil && len(*por.NextLink) != 0 -} - -// providerOperationResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (por ProviderOperationResult) providerOperationResultPreparer(ctx context.Context) (*http.Request, error) { - if !por.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(por.NextLink))) -} - -// ProviderOperationResultPage contains a page of OperationMetadata values. -type ProviderOperationResultPage struct { - fn func(context.Context, ProviderOperationResult) (ProviderOperationResult, error) - por ProviderOperationResult -} - -// 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 *ProviderOperationResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.por) - if err != nil { - return err - } - page.por = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - 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 *ProviderOperationResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ProviderOperationResultPage) NotDone() bool { - return !page.por.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ProviderOperationResultPage) Response() ProviderOperationResult { - return page.por -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ProviderOperationResultPage) Values() []OperationMetadata { - if page.por.IsEmpty() { - return nil - } - return *page.por.Value -} - -// Creates a new instance of the ProviderOperationResultPage type. -func NewProviderOperationResultPage(cur ProviderOperationResult, getNextPage func(context.Context, ProviderOperationResult) (ProviderOperationResult, error)) ProviderOperationResultPage { - return ProviderOperationResultPage{ - fn: getNextPage, - por: cur, - } -} - -// Resource an Azure resource. -type Resource struct { - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` - // Tags - The tags of the resource. - Tags map[string]*string `json:"tags"` -} - -// MarshalJSON is the custom marshaler for Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if r.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } - return json.Marshal(objectMap) -} - -// ResponseWithContinuationArmTemplate the response of a list operation. -type ResponseWithContinuationArmTemplate struct { - autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]ArmTemplate `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationArmTemplateIterator provides access to a complete listing of ArmTemplate values. -type ResponseWithContinuationArmTemplateIterator struct { - i int - page ResponseWithContinuationArmTemplatePage -} - -// 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 *ResponseWithContinuationArmTemplateIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationArmTemplateIterator.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 *ResponseWithContinuationArmTemplateIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationArmTemplateIterator) 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 ResponseWithContinuationArmTemplateIterator) Response() ResponseWithContinuationArmTemplate { - 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 ResponseWithContinuationArmTemplateIterator) Value() ArmTemplate { - if !iter.page.NotDone() { - return ArmTemplate{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResponseWithContinuationArmTemplateIterator type. -func NewResponseWithContinuationArmTemplateIterator(page ResponseWithContinuationArmTemplatePage) ResponseWithContinuationArmTemplateIterator { - return ResponseWithContinuationArmTemplateIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rwcAt ResponseWithContinuationArmTemplate) IsEmpty() bool { - return rwcAt.Value == nil || len(*rwcAt.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rwcAt ResponseWithContinuationArmTemplate) hasNextLink() bool { - return rwcAt.NextLink != nil && len(*rwcAt.NextLink) != 0 -} - -// responseWithContinuationArmTemplatePreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rwcAt ResponseWithContinuationArmTemplate) responseWithContinuationArmTemplatePreparer(ctx context.Context) (*http.Request, error) { - if !rwcAt.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcAt.NextLink))) -} - -// ResponseWithContinuationArmTemplatePage contains a page of ArmTemplate values. -type ResponseWithContinuationArmTemplatePage struct { - fn func(context.Context, ResponseWithContinuationArmTemplate) (ResponseWithContinuationArmTemplate, error) - rwcat ResponseWithContinuationArmTemplate -} - -// 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 *ResponseWithContinuationArmTemplatePage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationArmTemplatePage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rwcat) - if err != nil { - return err - } - page.rwcat = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - 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 *ResponseWithContinuationArmTemplatePage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationArmTemplatePage) NotDone() bool { - return !page.rwcat.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationArmTemplatePage) Response() ResponseWithContinuationArmTemplate { - return page.rwcat -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationArmTemplatePage) Values() []ArmTemplate { - if page.rwcat.IsEmpty() { - return nil - } - return *page.rwcat.Value -} - -// Creates a new instance of the ResponseWithContinuationArmTemplatePage type. -func NewResponseWithContinuationArmTemplatePage(cur ResponseWithContinuationArmTemplate, getNextPage func(context.Context, ResponseWithContinuationArmTemplate) (ResponseWithContinuationArmTemplate, error)) ResponseWithContinuationArmTemplatePage { - return ResponseWithContinuationArmTemplatePage{ - fn: getNextPage, - rwcat: cur, - } -} - -// ResponseWithContinuationArtifact the response of a list operation. -type ResponseWithContinuationArtifact struct { - autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]Artifact `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationArtifactIterator provides access to a complete listing of Artifact values. -type ResponseWithContinuationArtifactIterator struct { - i int - page ResponseWithContinuationArtifactPage -} - -// 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 *ResponseWithContinuationArtifactIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationArtifactIterator.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 *ResponseWithContinuationArtifactIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationArtifactIterator) 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 ResponseWithContinuationArtifactIterator) Response() ResponseWithContinuationArtifact { - 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 ResponseWithContinuationArtifactIterator) Value() Artifact { - if !iter.page.NotDone() { - return Artifact{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResponseWithContinuationArtifactIterator type. -func NewResponseWithContinuationArtifactIterator(page ResponseWithContinuationArtifactPage) ResponseWithContinuationArtifactIterator { - return ResponseWithContinuationArtifactIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rwcA ResponseWithContinuationArtifact) IsEmpty() bool { - return rwcA.Value == nil || len(*rwcA.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rwcA ResponseWithContinuationArtifact) hasNextLink() bool { - return rwcA.NextLink != nil && len(*rwcA.NextLink) != 0 -} - -// responseWithContinuationArtifactPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rwcA ResponseWithContinuationArtifact) responseWithContinuationArtifactPreparer(ctx context.Context) (*http.Request, error) { - if !rwcA.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcA.NextLink))) -} - -// ResponseWithContinuationArtifactPage contains a page of Artifact values. -type ResponseWithContinuationArtifactPage struct { - fn func(context.Context, ResponseWithContinuationArtifact) (ResponseWithContinuationArtifact, error) - rwca ResponseWithContinuationArtifact -} - -// 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 *ResponseWithContinuationArtifactPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationArtifactPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rwca) - if err != nil { - return err - } - page.rwca = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - 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 *ResponseWithContinuationArtifactPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationArtifactPage) NotDone() bool { - return !page.rwca.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationArtifactPage) Response() ResponseWithContinuationArtifact { - return page.rwca -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationArtifactPage) Values() []Artifact { - if page.rwca.IsEmpty() { - return nil - } - return *page.rwca.Value -} - -// Creates a new instance of the ResponseWithContinuationArtifactPage type. -func NewResponseWithContinuationArtifactPage(cur ResponseWithContinuationArtifact, getNextPage func(context.Context, ResponseWithContinuationArtifact) (ResponseWithContinuationArtifact, error)) ResponseWithContinuationArtifactPage { - return ResponseWithContinuationArtifactPage{ - fn: getNextPage, - rwca: cur, - } -} - -// ResponseWithContinuationArtifactSource the response of a list operation. -type ResponseWithContinuationArtifactSource struct { - autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]ArtifactSource `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationArtifactSourceIterator provides access to a complete listing of ArtifactSource -// values. -type ResponseWithContinuationArtifactSourceIterator struct { - i int - page ResponseWithContinuationArtifactSourcePage -} - -// 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 *ResponseWithContinuationArtifactSourceIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationArtifactSourceIterator.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 *ResponseWithContinuationArtifactSourceIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationArtifactSourceIterator) 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 ResponseWithContinuationArtifactSourceIterator) Response() ResponseWithContinuationArtifactSource { - 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 ResponseWithContinuationArtifactSourceIterator) Value() ArtifactSource { - if !iter.page.NotDone() { - return ArtifactSource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResponseWithContinuationArtifactSourceIterator type. -func NewResponseWithContinuationArtifactSourceIterator(page ResponseWithContinuationArtifactSourcePage) ResponseWithContinuationArtifactSourceIterator { - return ResponseWithContinuationArtifactSourceIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rwcAs ResponseWithContinuationArtifactSource) IsEmpty() bool { - return rwcAs.Value == nil || len(*rwcAs.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rwcAs ResponseWithContinuationArtifactSource) hasNextLink() bool { - return rwcAs.NextLink != nil && len(*rwcAs.NextLink) != 0 -} - -// responseWithContinuationArtifactSourcePreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rwcAs ResponseWithContinuationArtifactSource) responseWithContinuationArtifactSourcePreparer(ctx context.Context) (*http.Request, error) { - if !rwcAs.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcAs.NextLink))) -} - -// ResponseWithContinuationArtifactSourcePage contains a page of ArtifactSource values. -type ResponseWithContinuationArtifactSourcePage struct { - fn func(context.Context, ResponseWithContinuationArtifactSource) (ResponseWithContinuationArtifactSource, error) - rwcas ResponseWithContinuationArtifactSource -} - -// 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 *ResponseWithContinuationArtifactSourcePage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationArtifactSourcePage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rwcas) - if err != nil { - return err - } - page.rwcas = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - 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 *ResponseWithContinuationArtifactSourcePage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationArtifactSourcePage) NotDone() bool { - return !page.rwcas.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationArtifactSourcePage) Response() ResponseWithContinuationArtifactSource { - return page.rwcas -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationArtifactSourcePage) Values() []ArtifactSource { - if page.rwcas.IsEmpty() { - return nil - } - return *page.rwcas.Value -} - -// Creates a new instance of the ResponseWithContinuationArtifactSourcePage type. -func NewResponseWithContinuationArtifactSourcePage(cur ResponseWithContinuationArtifactSource, getNextPage func(context.Context, ResponseWithContinuationArtifactSource) (ResponseWithContinuationArtifactSource, error)) ResponseWithContinuationArtifactSourcePage { - return ResponseWithContinuationArtifactSourcePage{ - fn: getNextPage, - rwcas: cur, - } -} - -// ResponseWithContinuationCustomImage the response of a list operation. -type ResponseWithContinuationCustomImage struct { - autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]CustomImage `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationCustomImageIterator provides access to a complete listing of CustomImage values. -type ResponseWithContinuationCustomImageIterator struct { - i int - page ResponseWithContinuationCustomImagePage -} - -// 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 *ResponseWithContinuationCustomImageIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationCustomImageIterator.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 *ResponseWithContinuationCustomImageIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationCustomImageIterator) 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 ResponseWithContinuationCustomImageIterator) Response() ResponseWithContinuationCustomImage { - 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 ResponseWithContinuationCustomImageIterator) Value() CustomImage { - if !iter.page.NotDone() { - return CustomImage{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResponseWithContinuationCustomImageIterator type. -func NewResponseWithContinuationCustomImageIterator(page ResponseWithContinuationCustomImagePage) ResponseWithContinuationCustomImageIterator { - return ResponseWithContinuationCustomImageIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rwcCi ResponseWithContinuationCustomImage) IsEmpty() bool { - return rwcCi.Value == nil || len(*rwcCi.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rwcCi ResponseWithContinuationCustomImage) hasNextLink() bool { - return rwcCi.NextLink != nil && len(*rwcCi.NextLink) != 0 -} - -// responseWithContinuationCustomImagePreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rwcCi ResponseWithContinuationCustomImage) responseWithContinuationCustomImagePreparer(ctx context.Context) (*http.Request, error) { - if !rwcCi.hasNextLink() { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcCi.NextLink))) -} - -// ResponseWithContinuationCustomImagePage contains a page of CustomImage values. -type ResponseWithContinuationCustomImagePage struct { - fn func(context.Context, ResponseWithContinuationCustomImage) (ResponseWithContinuationCustomImage, error) - rwcci ResponseWithContinuationCustomImage -} - -// 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 *ResponseWithContinuationCustomImagePage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationCustomImagePage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rwcci) - if err != nil { - return err - } - page.rwcci = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - 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 *ResponseWithContinuationCustomImagePage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationCustomImagePage) NotDone() bool { - return !page.rwcci.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationCustomImagePage) Response() ResponseWithContinuationCustomImage { - return page.rwcci -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationCustomImagePage) Values() []CustomImage { - if page.rwcci.IsEmpty() { - return nil - } - return *page.rwcci.Value -} - -// Creates a new instance of the ResponseWithContinuationCustomImagePage type. -func NewResponseWithContinuationCustomImagePage(cur ResponseWithContinuationCustomImage, getNextPage func(context.Context, ResponseWithContinuationCustomImage) (ResponseWithContinuationCustomImage, error)) ResponseWithContinuationCustomImagePage { - return ResponseWithContinuationCustomImagePage{ - fn: getNextPage, - rwcci: cur, - } -} - -// ResponseWithContinuationDisk the response of a list operation. -type ResponseWithContinuationDisk struct { - autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]Disk `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationDiskIterator provides access to a complete listing of Disk values. -type ResponseWithContinuationDiskIterator struct { - i int - page ResponseWithContinuationDiskPage -} - -// 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 *ResponseWithContinuationDiskIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationDiskIterator.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 *ResponseWithContinuationDiskIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationDiskIterator) 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 ResponseWithContinuationDiskIterator) Response() ResponseWithContinuationDisk { - return iter.page.Response() + // ComputeID - The resource identifier (Microsoft.Compute) of the virtual machine. + ComputeID *string `json:"computeId,omitempty"` + // CustomImageID - The custom image identifier of the virtual machine. + CustomImageID *string `json:"customImageId,omitempty"` + // OsType - The OS type of the virtual machine. + OsType *string `json:"osType,omitempty"` + // Size - The size of the virtual machine. + Size *string `json:"size,omitempty"` + // UserName - The user name of the virtual machine. + UserName *string `json:"userName,omitempty"` + // Password - The password of the virtual machine administrator. + Password *string `json:"password,omitempty"` + // SSHKey - The SSH key of the virtual machine administrator. + SSHKey *string `json:"sshKey,omitempty"` + // IsAuthenticationWithSSHKey - Indicates whether this virtual machine uses an SSH key for authentication. + IsAuthenticationWithSSHKey *bool `json:"isAuthenticationWithSshKey,omitempty"` + // Fqdn - The fully-qualified domain name of the virtual machine. + Fqdn *string `json:"fqdn,omitempty"` + // LabSubnetName - The lab subnet name of the virtual machine. + LabSubnetName *string `json:"labSubnetName,omitempty"` + // LabVirtualNetworkID - The lab virtual network identifier of the virtual machine. + LabVirtualNetworkID *string `json:"labVirtualNetworkId,omitempty"` + // DisallowPublicIPAddress - Indicates whether the virtual machine is to be created without a public IP address. + DisallowPublicIPAddress *bool `json:"disallowPublicIpAddress,omitempty"` + // Artifacts - The artifacts to be installed on the virtual machine. + Artifacts *[]ArtifactInstallProperties `json:"artifacts,omitempty"` + // ArtifactDeploymentStatus - The artifact deployment status for the virtual machine. + ArtifactDeploymentStatus *ArtifactDeploymentStatusProperties `json:"artifactDeploymentStatus,omitempty"` + // GalleryImageReference - The Microsoft Azure Marketplace image reference of the virtual machine. + GalleryImageReference *GalleryImageReference `json:"galleryImageReference,omitempty"` + // PlanID - The id of the plan associated with the virtual machine image + PlanID *string `json:"planId,omitempty"` + // ComputeVM - READ-ONLY; The compute virtual machine properties. + ComputeVM *ComputeVMProperties `json:"computeVm,omitempty"` + // NetworkInterface - The network interface properties. + NetworkInterface *NetworkInterfaceProperties `json:"networkInterface,omitempty"` + // ApplicableSchedule - READ-ONLY; The applicable schedule for the virtual machine. + ApplicableSchedule *ApplicableSchedule `json:"applicableSchedule,omitempty"` + // ExpirationDate - The expiration date for VM. + ExpirationDate *date.Time `json:"expirationDate,omitempty"` + // AllowClaim - Indicates whether another user can take ownership of the virtual machine + AllowClaim *bool `json:"allowClaim,omitempty"` + // StorageType - Storage type to use for virtual machine (i.e. Standard, Premium). + StorageType *string `json:"storageType,omitempty"` + // VirtualMachineCreationSource - Tells source of creation of lab virtual machine. Output property only. Possible values include: 'FromCustomImage', 'FromGalleryImage', 'FromSharedGalleryImage' + VirtualMachineCreationSource VirtualMachineCreationSource `json:"virtualMachineCreationSource,omitempty"` + // EnvironmentID - The resource ID of the environment that contains this virtual machine, if any. + EnvironmentID *string `json:"environmentId,omitempty"` + // DataDiskParameters - New or existing data disks to attach to the virtual machine after creation + DataDiskParameters *[]DataDiskProperties `json:"dataDiskParameters,omitempty"` + // ScheduleParameters - Virtual Machine schedules to be created + ScheduleParameters *[]ScheduleCreationParameter `json:"scheduleParameters,omitempty"` + // LastKnownPowerState - Last known compute power state captured in DTL + LastKnownPowerState *string `json:"lastKnownPowerState,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty"` + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ResponseWithContinuationDiskIterator) Value() Disk { - if !iter.page.NotDone() { - return Disk{} +// MarshalJSON is the custom marshaler for LabVirtualMachineProperties. +func (lvmp LabVirtualMachineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lvmp.Notes != nil { + objectMap["notes"] = lvmp.Notes } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResponseWithContinuationDiskIterator type. -func NewResponseWithContinuationDiskIterator(page ResponseWithContinuationDiskPage) ResponseWithContinuationDiskIterator { - return ResponseWithContinuationDiskIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rwcD ResponseWithContinuationDisk) IsEmpty() bool { - return rwcD.Value == nil || len(*rwcD.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rwcD ResponseWithContinuationDisk) hasNextLink() bool { - return rwcD.NextLink != nil && len(*rwcD.NextLink) != 0 -} - -// responseWithContinuationDiskPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rwcD ResponseWithContinuationDisk) responseWithContinuationDiskPreparer(ctx context.Context) (*http.Request, error) { - if !rwcD.hasNextLink() { - return nil, nil + if lvmp.OwnerObjectID != nil { + objectMap["ownerObjectId"] = lvmp.OwnerObjectID } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcD.NextLink))) -} - -// ResponseWithContinuationDiskPage contains a page of Disk values. -type ResponseWithContinuationDiskPage struct { - fn func(context.Context, ResponseWithContinuationDisk) (ResponseWithContinuationDisk, error) - rwcd ResponseWithContinuationDisk -} - -// 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 *ResponseWithContinuationDiskPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationDiskPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() + if lvmp.OwnerUserPrincipalName != nil { + objectMap["ownerUserPrincipalName"] = lvmp.OwnerUserPrincipalName } - for { - next, err := page.fn(ctx, page.rwcd) - if err != nil { - return err - } - page.rwcd = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } + if lvmp.CreatedByUserID != nil { + objectMap["createdByUserId"] = lvmp.CreatedByUserID } - 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 *ResponseWithContinuationDiskPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationDiskPage) NotDone() bool { - return !page.rwcd.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationDiskPage) Response() ResponseWithContinuationDisk { - return page.rwcd -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationDiskPage) Values() []Disk { - if page.rwcd.IsEmpty() { - return nil + if lvmp.CreatedByUser != nil { + objectMap["createdByUser"] = lvmp.CreatedByUser } - return *page.rwcd.Value -} - -// Creates a new instance of the ResponseWithContinuationDiskPage type. -func NewResponseWithContinuationDiskPage(cur ResponseWithContinuationDisk, getNextPage func(context.Context, ResponseWithContinuationDisk) (ResponseWithContinuationDisk, error)) ResponseWithContinuationDiskPage { - return ResponseWithContinuationDiskPage{ - fn: getNextPage, - rwcd: cur, + if lvmp.CreatedDate != nil { + objectMap["createdDate"] = lvmp.CreatedDate } -} - -// ResponseWithContinuationDtlEnvironment the response of a list operation. -type ResponseWithContinuationDtlEnvironment struct { - autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]Environment `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationDtlEnvironmentIterator provides access to a complete listing of Environment -// values. -type ResponseWithContinuationDtlEnvironmentIterator struct { - i int - page ResponseWithContinuationDtlEnvironmentPage -} - -// 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 *ResponseWithContinuationDtlEnvironmentIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationDtlEnvironmentIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() + if lvmp.ComputeID != nil { + objectMap["computeId"] = lvmp.ComputeID } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil + if lvmp.CustomImageID != nil { + objectMap["customImageId"] = lvmp.CustomImageID } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err + if lvmp.OsType != nil { + objectMap["osType"] = lvmp.OsType } - 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 *ResponseWithContinuationDtlEnvironmentIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationDtlEnvironmentIterator) 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 ResponseWithContinuationDtlEnvironmentIterator) Response() ResponseWithContinuationDtlEnvironment { - 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 ResponseWithContinuationDtlEnvironmentIterator) Value() Environment { - if !iter.page.NotDone() { - return Environment{} + if lvmp.Size != nil { + objectMap["size"] = lvmp.Size } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResponseWithContinuationDtlEnvironmentIterator type. -func NewResponseWithContinuationDtlEnvironmentIterator(page ResponseWithContinuationDtlEnvironmentPage) ResponseWithContinuationDtlEnvironmentIterator { - return ResponseWithContinuationDtlEnvironmentIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rwcDe ResponseWithContinuationDtlEnvironment) IsEmpty() bool { - return rwcDe.Value == nil || len(*rwcDe.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rwcDe ResponseWithContinuationDtlEnvironment) hasNextLink() bool { - return rwcDe.NextLink != nil && len(*rwcDe.NextLink) != 0 -} - -// responseWithContinuationDtlEnvironmentPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rwcDe ResponseWithContinuationDtlEnvironment) responseWithContinuationDtlEnvironmentPreparer(ctx context.Context) (*http.Request, error) { - if !rwcDe.hasNextLink() { - return nil, nil + if lvmp.UserName != nil { + objectMap["userName"] = lvmp.UserName } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcDe.NextLink))) -} - -// ResponseWithContinuationDtlEnvironmentPage contains a page of Environment values. -type ResponseWithContinuationDtlEnvironmentPage struct { - fn func(context.Context, ResponseWithContinuationDtlEnvironment) (ResponseWithContinuationDtlEnvironment, error) - rwcde ResponseWithContinuationDtlEnvironment -} - -// 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 *ResponseWithContinuationDtlEnvironmentPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationDtlEnvironmentPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() + if lvmp.Password != nil { + objectMap["password"] = lvmp.Password } - for { - next, err := page.fn(ctx, page.rwcde) - if err != nil { - return err - } - page.rwcde = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } + if lvmp.SSHKey != nil { + objectMap["sshKey"] = lvmp.SSHKey } - 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 *ResponseWithContinuationDtlEnvironmentPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationDtlEnvironmentPage) NotDone() bool { - return !page.rwcde.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationDtlEnvironmentPage) Response() ResponseWithContinuationDtlEnvironment { - return page.rwcde -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationDtlEnvironmentPage) Values() []Environment { - if page.rwcde.IsEmpty() { - return nil + if lvmp.IsAuthenticationWithSSHKey != nil { + objectMap["isAuthenticationWithSshKey"] = lvmp.IsAuthenticationWithSSHKey } - return *page.rwcde.Value -} - -// Creates a new instance of the ResponseWithContinuationDtlEnvironmentPage type. -func NewResponseWithContinuationDtlEnvironmentPage(cur ResponseWithContinuationDtlEnvironment, getNextPage func(context.Context, ResponseWithContinuationDtlEnvironment) (ResponseWithContinuationDtlEnvironment, error)) ResponseWithContinuationDtlEnvironmentPage { - return ResponseWithContinuationDtlEnvironmentPage{ - fn: getNextPage, - rwcde: cur, + if lvmp.Fqdn != nil { + objectMap["fqdn"] = lvmp.Fqdn } -} - -// ResponseWithContinuationFormula the response of a list operation. -type ResponseWithContinuationFormula struct { - autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]Formula `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationFormulaIterator provides access to a complete listing of Formula values. -type ResponseWithContinuationFormulaIterator struct { - i int - page ResponseWithContinuationFormulaPage -} - -// 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 *ResponseWithContinuationFormulaIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationFormulaIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() + if lvmp.LabSubnetName != nil { + objectMap["labSubnetName"] = lvmp.LabSubnetName } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil + if lvmp.LabVirtualNetworkID != nil { + objectMap["labVirtualNetworkId"] = lvmp.LabVirtualNetworkID } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err + if lvmp.DisallowPublicIPAddress != nil { + objectMap["disallowPublicIpAddress"] = lvmp.DisallowPublicIPAddress } - 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 *ResponseWithContinuationFormulaIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationFormulaIterator) 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 ResponseWithContinuationFormulaIterator) Response() ResponseWithContinuationFormula { - 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 ResponseWithContinuationFormulaIterator) Value() Formula { - if !iter.page.NotDone() { - return Formula{} + if lvmp.Artifacts != nil { + objectMap["artifacts"] = lvmp.Artifacts } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResponseWithContinuationFormulaIterator type. -func NewResponseWithContinuationFormulaIterator(page ResponseWithContinuationFormulaPage) ResponseWithContinuationFormulaIterator { - return ResponseWithContinuationFormulaIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rwcF ResponseWithContinuationFormula) IsEmpty() bool { - return rwcF.Value == nil || len(*rwcF.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rwcF ResponseWithContinuationFormula) hasNextLink() bool { - return rwcF.NextLink != nil && len(*rwcF.NextLink) != 0 -} - -// responseWithContinuationFormulaPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rwcF ResponseWithContinuationFormula) responseWithContinuationFormulaPreparer(ctx context.Context) (*http.Request, error) { - if !rwcF.hasNextLink() { - return nil, nil + if lvmp.ArtifactDeploymentStatus != nil { + objectMap["artifactDeploymentStatus"] = lvmp.ArtifactDeploymentStatus } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcF.NextLink))) -} - -// ResponseWithContinuationFormulaPage contains a page of Formula values. -type ResponseWithContinuationFormulaPage struct { - fn func(context.Context, ResponseWithContinuationFormula) (ResponseWithContinuationFormula, error) - rwcf ResponseWithContinuationFormula -} - -// 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 *ResponseWithContinuationFormulaPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationFormulaPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() + if lvmp.GalleryImageReference != nil { + objectMap["galleryImageReference"] = lvmp.GalleryImageReference } - for { - next, err := page.fn(ctx, page.rwcf) - if err != nil { - return err - } - page.rwcf = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } + if lvmp.PlanID != nil { + objectMap["planId"] = lvmp.PlanID } - 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 *ResponseWithContinuationFormulaPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationFormulaPage) NotDone() bool { - return !page.rwcf.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationFormulaPage) Response() ResponseWithContinuationFormula { - return page.rwcf -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationFormulaPage) Values() []Formula { - if page.rwcf.IsEmpty() { - return nil + if lvmp.NetworkInterface != nil { + objectMap["networkInterface"] = lvmp.NetworkInterface } - return *page.rwcf.Value -} - -// Creates a new instance of the ResponseWithContinuationFormulaPage type. -func NewResponseWithContinuationFormulaPage(cur ResponseWithContinuationFormula, getNextPage func(context.Context, ResponseWithContinuationFormula) (ResponseWithContinuationFormula, error)) ResponseWithContinuationFormulaPage { - return ResponseWithContinuationFormulaPage{ - fn: getNextPage, - rwcf: cur, + if lvmp.ExpirationDate != nil { + objectMap["expirationDate"] = lvmp.ExpirationDate } -} - -// ResponseWithContinuationGalleryImage the response of a list operation. -type ResponseWithContinuationGalleryImage struct { - autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]GalleryImage `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationGalleryImageIterator provides access to a complete listing of GalleryImage -// values. -type ResponseWithContinuationGalleryImageIterator struct { - i int - page ResponseWithContinuationGalleryImagePage -} - -// 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 *ResponseWithContinuationGalleryImageIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationGalleryImageIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() + if lvmp.AllowClaim != nil { + objectMap["allowClaim"] = lvmp.AllowClaim } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil + if lvmp.StorageType != nil { + objectMap["storageType"] = lvmp.StorageType } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err + if lvmp.VirtualMachineCreationSource != "" { + objectMap["virtualMachineCreationSource"] = lvmp.VirtualMachineCreationSource } - 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 *ResponseWithContinuationGalleryImageIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationGalleryImageIterator) 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 ResponseWithContinuationGalleryImageIterator) Response() ResponseWithContinuationGalleryImage { - 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 ResponseWithContinuationGalleryImageIterator) Value() GalleryImage { - if !iter.page.NotDone() { - return GalleryImage{} + if lvmp.EnvironmentID != nil { + objectMap["environmentId"] = lvmp.EnvironmentID } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResponseWithContinuationGalleryImageIterator type. -func NewResponseWithContinuationGalleryImageIterator(page ResponseWithContinuationGalleryImagePage) ResponseWithContinuationGalleryImageIterator { - return ResponseWithContinuationGalleryImageIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rwcGi ResponseWithContinuationGalleryImage) IsEmpty() bool { - return rwcGi.Value == nil || len(*rwcGi.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rwcGi ResponseWithContinuationGalleryImage) hasNextLink() bool { - return rwcGi.NextLink != nil && len(*rwcGi.NextLink) != 0 -} - -// responseWithContinuationGalleryImagePreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rwcGi ResponseWithContinuationGalleryImage) responseWithContinuationGalleryImagePreparer(ctx context.Context) (*http.Request, error) { - if !rwcGi.hasNextLink() { - return nil, nil + if lvmp.DataDiskParameters != nil { + objectMap["dataDiskParameters"] = lvmp.DataDiskParameters } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcGi.NextLink))) -} - -// ResponseWithContinuationGalleryImagePage contains a page of GalleryImage values. -type ResponseWithContinuationGalleryImagePage struct { - fn func(context.Context, ResponseWithContinuationGalleryImage) (ResponseWithContinuationGalleryImage, error) - rwcgi ResponseWithContinuationGalleryImage -} - -// 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 *ResponseWithContinuationGalleryImagePage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationGalleryImagePage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() + if lvmp.ScheduleParameters != nil { + objectMap["scheduleParameters"] = lvmp.ScheduleParameters } - for { - next, err := page.fn(ctx, page.rwcgi) - if err != nil { - return err - } - page.rwcgi = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } + if lvmp.LastKnownPowerState != nil { + objectMap["lastKnownPowerState"] = lvmp.LastKnownPowerState } - return nil + return json.Marshal(objectMap) } -// 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 *ResponseWithContinuationGalleryImagePage) Next() error { - return page.NextWithContext(context.Background()) +// LabVirtualMachinePropertiesFragment properties of a virtual machine. +type LabVirtualMachinePropertiesFragment struct { + // Notes - The notes of the virtual machine. + Notes *string `json:"notes,omitempty"` + // OwnerObjectID - The object identifier of the owner of the virtual machine. + OwnerObjectID *string `json:"ownerObjectId,omitempty"` + // OwnerUserPrincipalName - The user principal name of the virtual machine owner. + OwnerUserPrincipalName *string `json:"ownerUserPrincipalName,omitempty"` + // CreatedByUserID - The object identifier of the creator of the virtual machine. + CreatedByUserID *string `json:"createdByUserId,omitempty"` + // CreatedByUser - The email address of creator of the virtual machine. + CreatedByUser *string `json:"createdByUser,omitempty"` + // CreatedDate - The creation date of the virtual machine. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // ComputeID - The resource identifier (Microsoft.Compute) of the virtual machine. + ComputeID *string `json:"computeId,omitempty"` + // CustomImageID - The custom image identifier of the virtual machine. + CustomImageID *string `json:"customImageId,omitempty"` + // OsType - The OS type of the virtual machine. + OsType *string `json:"osType,omitempty"` + // Size - The size of the virtual machine. + Size *string `json:"size,omitempty"` + // UserName - The user name of the virtual machine. + UserName *string `json:"userName,omitempty"` + // Password - The password of the virtual machine administrator. + Password *string `json:"password,omitempty"` + // SSHKey - The SSH key of the virtual machine administrator. + SSHKey *string `json:"sshKey,omitempty"` + // IsAuthenticationWithSSHKey - Indicates whether this virtual machine uses an SSH key for authentication. + IsAuthenticationWithSSHKey *bool `json:"isAuthenticationWithSshKey,omitempty"` + // Fqdn - The fully-qualified domain name of the virtual machine. + Fqdn *string `json:"fqdn,omitempty"` + // LabSubnetName - The lab subnet name of the virtual machine. + LabSubnetName *string `json:"labSubnetName,omitempty"` + // LabVirtualNetworkID - The lab virtual network identifier of the virtual machine. + LabVirtualNetworkID *string `json:"labVirtualNetworkId,omitempty"` + // DisallowPublicIPAddress - Indicates whether the virtual machine is to be created without a public IP address. + DisallowPublicIPAddress *bool `json:"disallowPublicIpAddress,omitempty"` + // Artifacts - The artifacts to be installed on the virtual machine. + Artifacts *[]ArtifactInstallPropertiesFragment `json:"artifacts,omitempty"` + // ArtifactDeploymentStatus - The artifact deployment status for the virtual machine. + ArtifactDeploymentStatus *ArtifactDeploymentStatusPropertiesFragment `json:"artifactDeploymentStatus,omitempty"` + // GalleryImageReference - The Microsoft Azure Marketplace image reference of the virtual machine. + GalleryImageReference *GalleryImageReferenceFragment `json:"galleryImageReference,omitempty"` + // PlanID - The id of the plan associated with the virtual machine image + PlanID *string `json:"planId,omitempty"` + // NetworkInterface - The network interface properties. + NetworkInterface *NetworkInterfacePropertiesFragment `json:"networkInterface,omitempty"` + // ExpirationDate - The expiration date for VM. + ExpirationDate *date.Time `json:"expirationDate,omitempty"` + // AllowClaim - Indicates whether another user can take ownership of the virtual machine + AllowClaim *bool `json:"allowClaim,omitempty"` + // StorageType - Storage type to use for virtual machine (i.e. Standard, Premium). + StorageType *string `json:"storageType,omitempty"` + // VirtualMachineCreationSource - Tells source of creation of lab virtual machine. Output property only. Possible values include: 'FromCustomImage', 'FromGalleryImage', 'FromSharedGalleryImage' + VirtualMachineCreationSource VirtualMachineCreationSource `json:"virtualMachineCreationSource,omitempty"` + // EnvironmentID - The resource ID of the environment that contains this virtual machine, if any. + EnvironmentID *string `json:"environmentId,omitempty"` + // DataDiskParameters - New or existing data disks to attach to the virtual machine after creation + DataDiskParameters *[]DataDiskPropertiesFragment `json:"dataDiskParameters,omitempty"` + // ScheduleParameters - Virtual Machine schedules to be created + ScheduleParameters *[]ScheduleCreationParameterFragment `json:"scheduleParameters,omitempty"` + // LastKnownPowerState - Last known compute power state captured in DTL + LastKnownPowerState *string `json:"lastKnownPowerState,omitempty"` } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationGalleryImagePage) NotDone() bool { - return !page.rwcgi.IsEmpty() +// LinuxOsInfo information about a Linux OS. +type LinuxOsInfo struct { + // LinuxOsState - The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, DeprovisionApplied). Possible values include: 'NonDeprovisioned', 'DeprovisionRequested', 'DeprovisionApplied' + LinuxOsState LinuxOsState `json:"linuxOsState,omitempty"` } -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationGalleryImagePage) Response() ResponseWithContinuationGalleryImage { - return page.rwcgi +// LinuxOsInfoFragment information about a Linux OS. +type LinuxOsInfoFragment struct { + // LinuxOsState - The state of the Linux OS (i.e. NonDeprovisioned, DeprovisionRequested, DeprovisionApplied). Possible values include: 'NonDeprovisioned', 'DeprovisionRequested', 'DeprovisionApplied' + LinuxOsState LinuxOsState `json:"linuxOsState,omitempty"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationGalleryImagePage) Values() []GalleryImage { - if page.rwcgi.IsEmpty() { - return nil - } - return *page.rwcgi.Value +// NetworkInterfaceProperties properties of a network interface. +type NetworkInterfaceProperties struct { + // VirtualNetworkID - The resource ID of the virtual network. + VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` + // SubnetID - The resource ID of the sub net. + SubnetID *string `json:"subnetId,omitempty"` + // PublicIPAddressID - The resource ID of the public IP address. + PublicIPAddressID *string `json:"publicIpAddressId,omitempty"` + // PublicIPAddress - The public IP address. + PublicIPAddress *string `json:"publicIpAddress,omitempty"` + // PrivateIPAddress - The private IP address. + PrivateIPAddress *string `json:"privateIpAddress,omitempty"` + // DNSName - The DNS name. + DNSName *string `json:"dnsName,omitempty"` + // RdpAuthority - The RdpAuthority property is a server DNS host name or IP address followed by the service port number for RDP (Remote Desktop Protocol). + RdpAuthority *string `json:"rdpAuthority,omitempty"` + // SSHAuthority - The SshAuthority property is a server DNS host name or IP address followed by the service port number for SSH. + SSHAuthority *string `json:"sshAuthority,omitempty"` + // SharedPublicIPAddressConfiguration - The configuration for sharing a public IP address across multiple virtual machines. + SharedPublicIPAddressConfiguration *SharedPublicIPAddressConfiguration `json:"sharedPublicIpAddressConfiguration,omitempty"` } -// Creates a new instance of the ResponseWithContinuationGalleryImagePage type. -func NewResponseWithContinuationGalleryImagePage(cur ResponseWithContinuationGalleryImage, getNextPage func(context.Context, ResponseWithContinuationGalleryImage) (ResponseWithContinuationGalleryImage, error)) ResponseWithContinuationGalleryImagePage { - return ResponseWithContinuationGalleryImagePage{ - fn: getNextPage, - rwcgi: cur, - } +// NetworkInterfacePropertiesFragment properties of a network interface. +type NetworkInterfacePropertiesFragment struct { + // VirtualNetworkID - The resource ID of the virtual network. + VirtualNetworkID *string `json:"virtualNetworkId,omitempty"` + // SubnetID - The resource ID of the sub net. + SubnetID *string `json:"subnetId,omitempty"` + // PublicIPAddressID - The resource ID of the public IP address. + PublicIPAddressID *string `json:"publicIpAddressId,omitempty"` + // PublicIPAddress - The public IP address. + PublicIPAddress *string `json:"publicIpAddress,omitempty"` + // PrivateIPAddress - The private IP address. + PrivateIPAddress *string `json:"privateIpAddress,omitempty"` + // DNSName - The DNS name. + DNSName *string `json:"dnsName,omitempty"` + // RdpAuthority - The RdpAuthority property is a server DNS host name or IP address followed by the service port number for RDP (Remote Desktop Protocol). + RdpAuthority *string `json:"rdpAuthority,omitempty"` + // SSHAuthority - The SshAuthority property is a server DNS host name or IP address followed by the service port number for SSH. + SSHAuthority *string `json:"sshAuthority,omitempty"` + // SharedPublicIPAddressConfiguration - The configuration for sharing a public IP address across multiple virtual machines. + SharedPublicIPAddressConfiguration *SharedPublicIPAddressConfigurationFragment `json:"sharedPublicIpAddressConfiguration,omitempty"` } -// ResponseWithContinuationLab the response of a list operation. -type ResponseWithContinuationLab struct { +// NotificationChannel a notification. +type NotificationChannel struct { autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]Lab `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationLabIterator provides access to a complete listing of Lab values. -type ResponseWithContinuationLabIterator struct { - i int - page ResponseWithContinuationLabPage + // NotificationChannelProperties - The properties of the resource. + *NotificationChannelProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The identifier of the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` } -// 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 *ResponseWithContinuationLabIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationLabIterator.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 +// MarshalJSON is the custom marshaler for NotificationChannel. +func (nc NotificationChannel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nc.NotificationChannelProperties != nil { + objectMap["properties"] = nc.NotificationChannelProperties } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err + if nc.Location != nil { + objectMap["location"] = nc.Location } - 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 *ResponseWithContinuationLabIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationLabIterator) 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 ResponseWithContinuationLabIterator) Response() ResponseWithContinuationLab { - 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 ResponseWithContinuationLabIterator) Value() Lab { - if !iter.page.NotDone() { - return Lab{} + if nc.Tags != nil { + objectMap["tags"] = nc.Tags } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResponseWithContinuationLabIterator type. -func NewResponseWithContinuationLabIterator(page ResponseWithContinuationLabPage) ResponseWithContinuationLabIterator { - return ResponseWithContinuationLabIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rwcL ResponseWithContinuationLab) IsEmpty() bool { - return rwcL.Value == nil || len(*rwcL.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rwcL ResponseWithContinuationLab) hasNextLink() bool { - return rwcL.NextLink != nil && len(*rwcL.NextLink) != 0 + return json.Marshal(objectMap) } -// responseWithContinuationLabPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rwcL ResponseWithContinuationLab) responseWithContinuationLabPreparer(ctx context.Context) (*http.Request, error) { - if !rwcL.hasNextLink() { - return nil, nil +// UnmarshalJSON is the custom unmarshaler for NotificationChannel struct. +func (nc *NotificationChannel) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcL.NextLink))) -} - -// ResponseWithContinuationLabPage contains a page of Lab values. -type ResponseWithContinuationLabPage struct { - fn func(context.Context, ResponseWithContinuationLab) (ResponseWithContinuationLab, error) - rwcl ResponseWithContinuationLab -} - -// 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 *ResponseWithContinuationLabPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationLabPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode + for k, v := range m { + switch k { + case "properties": + if v != nil { + var notificationChannelProperties NotificationChannelProperties + err = json.Unmarshal(*v, ¬ificationChannelProperties) + if err != nil { + return err + } + nc.NotificationChannelProperties = ¬ificationChannelProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + nc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + nc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + nc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + nc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + nc.Tags = tags } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rwcl) - if err != nil { - return err - } - page.rwcl = next - if !next.hasNextLink() || !next.IsEmpty() { - break } } - 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 *ResponseWithContinuationLabPage) Next() error { - return page.NextWithContext(context.Background()) + return nil } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationLabPage) NotDone() bool { - return !page.rwcl.IsEmpty() +// NotificationChannelFragment a notification. +type NotificationChannelFragment struct { + // NotificationChannelPropertiesFragment - The properties of the resource. + *NotificationChannelPropertiesFragment `json:"properties,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` } -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationLabPage) Response() ResponseWithContinuationLab { - return page.rwcl +// MarshalJSON is the custom marshaler for NotificationChannelFragment. +func (ncf NotificationChannelFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ncf.NotificationChannelPropertiesFragment != nil { + objectMap["properties"] = ncf.NotificationChannelPropertiesFragment + } + if ncf.Tags != nil { + objectMap["tags"] = ncf.Tags + } + return json.Marshal(objectMap) } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationLabPage) Values() []Lab { - if page.rwcl.IsEmpty() { - return nil +// UnmarshalJSON is the custom unmarshaler for NotificationChannelFragment struct. +func (ncf *NotificationChannelFragment) 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 notificationChannelPropertiesFragment NotificationChannelPropertiesFragment + err = json.Unmarshal(*v, ¬ificationChannelPropertiesFragment) + if err != nil { + return err + } + ncf.NotificationChannelPropertiesFragment = ¬ificationChannelPropertiesFragment + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ncf.Tags = tags + } + } } - return *page.rwcl.Value -} -// Creates a new instance of the ResponseWithContinuationLabPage type. -func NewResponseWithContinuationLabPage(cur ResponseWithContinuationLab, getNextPage func(context.Context, ResponseWithContinuationLab) (ResponseWithContinuationLab, error)) ResponseWithContinuationLabPage { - return ResponseWithContinuationLabPage{ - fn: getNextPage, - rwcl: cur, - } + return nil } -// ResponseWithContinuationLabVhd the response of a list operation. -type ResponseWithContinuationLabVhd struct { +// NotificationChannelList the response of a list operation. +type NotificationChannelList struct { autorest.Response `json:"-"` // Value - Results of the list operation. - Value *[]LabVhd `json:"value,omitempty"` + Value *[]NotificationChannel `json:"value,omitempty"` // NextLink - Link for next set of results. NextLink *string `json:"nextLink,omitempty"` } -// ResponseWithContinuationLabVhdIterator provides access to a complete listing of LabVhd values. -type ResponseWithContinuationLabVhdIterator struct { +// NotificationChannelListIterator provides access to a complete listing of NotificationChannel values. +type NotificationChannelListIterator struct { i int - page ResponseWithContinuationLabVhdPage + page NotificationChannelListPage } // 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 *ResponseWithContinuationLabVhdIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *NotificationChannelListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationLabVhdIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/NotificationChannelListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -5966,67 +6142,67 @@ func (iter *ResponseWithContinuationLabVhdIterator) NextWithContext(ctx 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 *ResponseWithContinuationLabVhdIterator) Next() error { +func (iter *NotificationChannelListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationLabVhdIterator) NotDone() bool { +func (iter NotificationChannelListIterator) 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 ResponseWithContinuationLabVhdIterator) Response() ResponseWithContinuationLabVhd { +func (iter NotificationChannelListIterator) Response() NotificationChannelList { 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 ResponseWithContinuationLabVhdIterator) Value() LabVhd { +func (iter NotificationChannelListIterator) Value() NotificationChannel { if !iter.page.NotDone() { - return LabVhd{} + return NotificationChannel{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ResponseWithContinuationLabVhdIterator type. -func NewResponseWithContinuationLabVhdIterator(page ResponseWithContinuationLabVhdPage) ResponseWithContinuationLabVhdIterator { - return ResponseWithContinuationLabVhdIterator{page: page} +// Creates a new instance of the NotificationChannelListIterator type. +func NewNotificationChannelListIterator(page NotificationChannelListPage) NotificationChannelListIterator { + return NotificationChannelListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (rwcLv ResponseWithContinuationLabVhd) IsEmpty() bool { - return rwcLv.Value == nil || len(*rwcLv.Value) == 0 +func (ncl NotificationChannelList) IsEmpty() bool { + return ncl.Value == nil || len(*ncl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (rwcLv ResponseWithContinuationLabVhd) hasNextLink() bool { - return rwcLv.NextLink != nil && len(*rwcLv.NextLink) != 0 +func (ncl NotificationChannelList) hasNextLink() bool { + return ncl.NextLink != nil && len(*ncl.NextLink) != 0 } -// responseWithContinuationLabVhdPreparer prepares a request to retrieve the next set of results. +// notificationChannelListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (rwcLv ResponseWithContinuationLabVhd) responseWithContinuationLabVhdPreparer(ctx context.Context) (*http.Request, error) { - if !rwcLv.hasNextLink() { +func (ncl NotificationChannelList) notificationChannelListPreparer(ctx context.Context) (*http.Request, error) { + if !ncl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcLv.NextLink))) + autorest.WithBaseURL(to.String(ncl.NextLink))) } -// ResponseWithContinuationLabVhdPage contains a page of LabVhd values. -type ResponseWithContinuationLabVhdPage struct { - fn func(context.Context, ResponseWithContinuationLabVhd) (ResponseWithContinuationLabVhd, error) - rwclv ResponseWithContinuationLabVhd +// NotificationChannelListPage contains a page of NotificationChannel values. +type NotificationChannelListPage struct { + fn func(context.Context, NotificationChannelList) (NotificationChannelList, error) + ncl NotificationChannelList } // 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 *ResponseWithContinuationLabVhdPage) NextWithContext(ctx context.Context) (err error) { +func (page *NotificationChannelListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationLabVhdPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/NotificationChannelListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -6036,11 +6212,11 @@ func (page *ResponseWithContinuationLabVhdPage) NextWithContext(ctx context.Cont }() } for { - next, err := page.fn(ctx, page.rwclv) + next, err := page.fn(ctx, page.ncl) if err != nil { return err } - page.rwclv = next + page.ncl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -6051,217 +6227,362 @@ func (page *ResponseWithContinuationLabVhdPage) NextWithContext(ctx context.Cont // 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 *ResponseWithContinuationLabVhdPage) Next() error { +func (page *NotificationChannelListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationLabVhdPage) NotDone() bool { - return !page.rwclv.IsEmpty() +func (page NotificationChannelListPage) NotDone() bool { + return !page.ncl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ResponseWithContinuationLabVhdPage) Response() ResponseWithContinuationLabVhd { - return page.rwclv +func (page NotificationChannelListPage) Response() NotificationChannelList { + return page.ncl } // Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationLabVhdPage) Values() []LabVhd { - if page.rwclv.IsEmpty() { +func (page NotificationChannelListPage) Values() []NotificationChannel { + if page.ncl.IsEmpty() { return nil } - return *page.rwclv.Value + return *page.ncl.Value } -// Creates a new instance of the ResponseWithContinuationLabVhdPage type. -func NewResponseWithContinuationLabVhdPage(cur ResponseWithContinuationLabVhd, getNextPage func(context.Context, ResponseWithContinuationLabVhd) (ResponseWithContinuationLabVhd, error)) ResponseWithContinuationLabVhdPage { - return ResponseWithContinuationLabVhdPage{ - fn: getNextPage, - rwclv: cur, +// Creates a new instance of the NotificationChannelListPage type. +func NewNotificationChannelListPage(cur NotificationChannelList, getNextPage func(context.Context, NotificationChannelList) (NotificationChannelList, error)) NotificationChannelListPage { + return NotificationChannelListPage{ + fn: getNextPage, + ncl: cur, } } -// ResponseWithContinuationLabVirtualMachine the response of a list operation. -type ResponseWithContinuationLabVirtualMachine struct { - autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]LabVirtualMachine `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationLabVirtualMachineIterator provides access to a complete listing of -// LabVirtualMachine values. -type ResponseWithContinuationLabVirtualMachineIterator struct { - i int - page ResponseWithContinuationLabVirtualMachinePage +// NotificationChannelProperties properties of a schedule. +type NotificationChannelProperties struct { + // WebHookURL - The webhook URL to send notifications to. + WebHookURL *string `json:"webHookUrl,omitempty"` + // EmailRecipient - The email recipient to send notifications to (can be a list of semi-colon separated email addresses). + EmailRecipient *string `json:"emailRecipient,omitempty"` + // NotificationLocale - The locale to use when sending a notification (fallback for unsupported languages is EN). + NotificationLocale *string `json:"notificationLocale,omitempty"` + // Description - Description of notification. + Description *string `json:"description,omitempty"` + // Events - The list of event for which this notification is enabled. + Events *[]Event `json:"events,omitempty"` + // CreatedDate - READ-ONLY; The creation date of the notification channel. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty"` + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` } -// 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 *ResponseWithContinuationLabVirtualMachineIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationLabVirtualMachineIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// MarshalJSON is the custom marshaler for NotificationChannelProperties. +func (ncp NotificationChannelProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ncp.WebHookURL != nil { + objectMap["webHookUrl"] = ncp.WebHookURL } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil + if ncp.EmailRecipient != nil { + objectMap["emailRecipient"] = ncp.EmailRecipient } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err + if ncp.NotificationLocale != nil { + objectMap["notificationLocale"] = ncp.NotificationLocale } - iter.i = 0 - return nil + if ncp.Description != nil { + objectMap["description"] = ncp.Description + } + if ncp.Events != nil { + objectMap["events"] = ncp.Events + } + return json.Marshal(objectMap) } -// 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 *ResponseWithContinuationLabVirtualMachineIterator) Next() error { - return iter.NextWithContext(context.Background()) +// NotificationChannelPropertiesFragment properties of a schedule. +type NotificationChannelPropertiesFragment struct { + // WebHookURL - The webhook URL to send notifications to. + WebHookURL *string `json:"webHookUrl,omitempty"` + // EmailRecipient - The email recipient to send notifications to (can be a list of semi-colon separated email addresses). + EmailRecipient *string `json:"emailRecipient,omitempty"` + // NotificationLocale - The locale to use when sending a notification (fallback for unsupported languages is EN). + NotificationLocale *string `json:"notificationLocale,omitempty"` + // Description - Description of notification. + Description *string `json:"description,omitempty"` + // Events - The list of event for which this notification is enabled. + Events *[]EventFragment `json:"events,omitempty"` } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationLabVirtualMachineIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// NotificationSettings notification settings for a schedule. +type NotificationSettings struct { + // Status - If notifications are enabled for this schedule (i.e. Enabled, Disabled). Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' + Status EnableStatus `json:"status,omitempty"` + // TimeInMinutes - Time in minutes before event at which notification will be sent. + TimeInMinutes *int32 `json:"timeInMinutes,omitempty"` + // WebhookURL - The webhook URL to which the notification will be sent. + WebhookURL *string `json:"webhookUrl,omitempty"` + // EmailRecipient - The email recipient to send notifications to (can be a list of semi-colon separated email addresses). + EmailRecipient *string `json:"emailRecipient,omitempty"` + // NotificationLocale - The locale to use when sending a notification (fallback for unsupported languages is EN). + NotificationLocale *string `json:"notificationLocale,omitempty"` } -// Response returns the raw server response from the last page request. -func (iter ResponseWithContinuationLabVirtualMachineIterator) Response() ResponseWithContinuationLabVirtualMachine { - return iter.page.Response() +// NotificationSettingsFragment notification settings for a schedule. +type NotificationSettingsFragment struct { + // Status - If notifications are enabled for this schedule (i.e. Enabled, Disabled). Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' + Status EnableStatus `json:"status,omitempty"` + // TimeInMinutes - Time in minutes before event at which notification will be sent. + TimeInMinutes *int32 `json:"timeInMinutes,omitempty"` + // WebhookURL - The webhook URL to which the notification will be sent. + WebhookURL *string `json:"webhookUrl,omitempty"` + // EmailRecipient - The email recipient to send notifications to (can be a list of semi-colon separated email addresses). + EmailRecipient *string `json:"emailRecipient,omitempty"` + // NotificationLocale - The locale to use when sending a notification (fallback for unsupported languages is EN). + NotificationLocale *string `json:"notificationLocale,omitempty"` } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ResponseWithContinuationLabVirtualMachineIterator) Value() LabVirtualMachine { - if !iter.page.NotDone() { - return LabVirtualMachine{} +// NotifyParameters properties for generating a Notification. +type NotifyParameters struct { + // EventName - The type of event (i.e. AutoShutdown, Cost). Possible values include: 'AutoShutdown', 'Cost' + EventName NotificationChannelEventType `json:"eventName,omitempty"` + // JSONPayload - Properties for the notification in json format. + JSONPayload *string `json:"jsonPayload,omitempty"` +} + +// OperationError error details for the operation in case of a failure. +type OperationError struct { + // Code - The error code of the operation error. + Code *string `json:"code,omitempty"` + // Message - The error message of the operation error. + Message *string `json:"message,omitempty"` +} + +// OperationMetadata the REST API operation supported by DevTestLab ResourceProvider. +type OperationMetadata struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - The object that describes the operations + Display *OperationMetadataDisplay `json:"display,omitempty"` +} + +// OperationMetadataDisplay the object that describes the operations +type OperationMetadataDisplay struct { + // Provider - Friendly name of the resource provider + Provider *string `json:"provider,omitempty"` + // Resource - Resource type on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - Operation type: read, write, delete, listKeys/action, etc. + Operation *string `json:"operation,omitempty"` + // Description - Friendly name of the operation + Description *string `json:"description,omitempty"` +} + +// OperationResult an Operation Result +type OperationResult struct { + autorest.Response `json:"-"` + // Status - The operation status. + Status *string `json:"status,omitempty"` + // StatusCode - The status code for the operation. Possible values include: 'Continue', 'SwitchingProtocols', 'OK', 'Created', 'Accepted', 'NonAuthoritativeInformation', 'NoContent', 'ResetContent', 'PartialContent', 'MultipleChoices', 'MovedPermanently', 'Redirect', 'SeeOther', 'NotModified', 'UseProxy', 'Unused', 'TemporaryRedirect', 'BadRequest', 'Unauthorized', 'PaymentRequired', 'Forbidden', 'NotFound', 'MethodNotAllowed', 'NotAcceptable', 'ProxyAuthenticationRequired', 'RequestTimeout', 'Conflict', 'Gone', 'LengthRequired', 'PreconditionFailed', 'RequestEntityTooLarge', 'RequestURITooLong', 'UnsupportedMediaType', 'RequestedRangeNotSatisfiable', 'ExpectationFailed', 'UpgradeRequired', 'InternalServerError', 'NotImplemented', 'BadGateway', 'ServiceUnavailable', 'GatewayTimeout', 'HTTPVersionNotSupported' + StatusCode HTTPStatusCode `json:"statusCode,omitempty"` + // Error - Error details for the operation in case of a failure. + Error *OperationError `json:"error,omitempty"` +} + +// ParameterInfo information about an artifact's parameter. +type ParameterInfo struct { + // Name - The name of the artifact parameter. + Name *string `json:"name,omitempty"` + // Value - The value of the artifact parameter. + Value *string `json:"value,omitempty"` +} + +// ParametersValueFileInfo a file containing a set of parameter values for an ARM template. +type ParametersValueFileInfo struct { + // FileName - File name. + FileName *string `json:"fileName,omitempty"` + // ParametersValueInfo - Contents of the file. + ParametersValueInfo interface{} `json:"parametersValueInfo,omitempty"` +} + +// PercentageCostThresholdProperties properties of a percentage cost threshold. +type PercentageCostThresholdProperties struct { + // ThresholdValue - The cost threshold value. + ThresholdValue *float64 `json:"thresholdValue,omitempty"` +} + +// Policy a Policy. +type Policy struct { + autorest.Response `json:"-"` + // PolicyProperties - The properties of the resource. + *PolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The identifier of the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Policy. +func (p Policy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.PolicyProperties != nil { + objectMap["properties"] = p.PolicyProperties + } + if p.Location != nil { + objectMap["location"] = p.Location + } + if p.Tags != nil { + objectMap["tags"] = p.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Policy struct. +func (p *Policy) 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 policyProperties PolicyProperties + err = json.Unmarshal(*v, &policyProperties) + if err != nil { + return err + } + p.PolicyProperties = &policyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + p.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + p.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + p.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + p.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + p.Tags = tags + } + } } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResponseWithContinuationLabVirtualMachineIterator type. -func NewResponseWithContinuationLabVirtualMachineIterator(page ResponseWithContinuationLabVirtualMachinePage) ResponseWithContinuationLabVirtualMachineIterator { - return ResponseWithContinuationLabVirtualMachineIterator{page: page} -} -// IsEmpty returns true if the ListResult contains no values. -func (rwcLvm ResponseWithContinuationLabVirtualMachine) IsEmpty() bool { - return rwcLvm.Value == nil || len(*rwcLvm.Value) == 0 + return nil } -// hasNextLink returns true if the NextLink is not empty. -func (rwcLvm ResponseWithContinuationLabVirtualMachine) hasNextLink() bool { - return rwcLvm.NextLink != nil && len(*rwcLvm.NextLink) != 0 +// PolicyFragment a Policy. +type PolicyFragment struct { + // PolicyPropertiesFragment - The properties of the resource. + *PolicyPropertiesFragment `json:"properties,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` } -// responseWithContinuationLabVirtualMachinePreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rwcLvm ResponseWithContinuationLabVirtualMachine) responseWithContinuationLabVirtualMachinePreparer(ctx context.Context) (*http.Request, error) { - if !rwcLvm.hasNextLink() { - return nil, nil +// MarshalJSON is the custom marshaler for PolicyFragment. +func (pf PolicyFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pf.PolicyPropertiesFragment != nil { + objectMap["properties"] = pf.PolicyPropertiesFragment } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcLvm.NextLink))) -} - -// ResponseWithContinuationLabVirtualMachinePage contains a page of LabVirtualMachine values. -type ResponseWithContinuationLabVirtualMachinePage struct { - fn func(context.Context, ResponseWithContinuationLabVirtualMachine) (ResponseWithContinuationLabVirtualMachine, error) - rwclvm ResponseWithContinuationLabVirtualMachine + if pf.Tags != nil { + objectMap["tags"] = pf.Tags + } + return json.Marshal(objectMap) } -// 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 *ResponseWithContinuationLabVirtualMachinePage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationLabVirtualMachinePage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// UnmarshalJSON is the custom unmarshaler for PolicyFragment struct. +func (pf *PolicyFragment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - for { - next, err := page.fn(ctx, page.rwclvm) - if err != nil { - return err - } - page.rwclvm = next - if !next.hasNextLink() || !next.IsEmpty() { - break + for k, v := range m { + switch k { + case "properties": + if v != nil { + var policyPropertiesFragment PolicyPropertiesFragment + err = json.Unmarshal(*v, &policyPropertiesFragment) + if err != nil { + return err + } + pf.PolicyPropertiesFragment = &policyPropertiesFragment + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pf.Tags = tags + } } } - 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 *ResponseWithContinuationLabVirtualMachinePage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationLabVirtualMachinePage) NotDone() bool { - return !page.rwclvm.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationLabVirtualMachinePage) Response() ResponseWithContinuationLabVirtualMachine { - return page.rwclvm -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationLabVirtualMachinePage) Values() []LabVirtualMachine { - if page.rwclvm.IsEmpty() { - return nil - } - return *page.rwclvm.Value -} -// Creates a new instance of the ResponseWithContinuationLabVirtualMachinePage type. -func NewResponseWithContinuationLabVirtualMachinePage(cur ResponseWithContinuationLabVirtualMachine, getNextPage func(context.Context, ResponseWithContinuationLabVirtualMachine) (ResponseWithContinuationLabVirtualMachine, error)) ResponseWithContinuationLabVirtualMachinePage { - return ResponseWithContinuationLabVirtualMachinePage{ - fn: getNextPage, - rwclvm: cur, - } + return nil } -// ResponseWithContinuationNotificationChannel the response of a list operation. -type ResponseWithContinuationNotificationChannel struct { +// PolicyList the response of a list operation. +type PolicyList struct { autorest.Response `json:"-"` // Value - Results of the list operation. - Value *[]NotificationChannel `json:"value,omitempty"` + Value *[]Policy `json:"value,omitempty"` // NextLink - Link for next set of results. NextLink *string `json:"nextLink,omitempty"` } -// ResponseWithContinuationNotificationChannelIterator provides access to a complete listing of -// NotificationChannel values. -type ResponseWithContinuationNotificationChannelIterator struct { +// PolicyListIterator provides access to a complete listing of Policy values. +type PolicyListIterator struct { i int - page ResponseWithContinuationNotificationChannelPage + page PolicyListPage } // 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 *ResponseWithContinuationNotificationChannelIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *PolicyListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationNotificationChannelIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -6286,67 +6607,67 @@ func (iter *ResponseWithContinuationNotificationChannelIterator) NextWithContext // 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 *ResponseWithContinuationNotificationChannelIterator) Next() error { +func (iter *PolicyListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationNotificationChannelIterator) NotDone() bool { +func (iter PolicyListIterator) 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 ResponseWithContinuationNotificationChannelIterator) Response() ResponseWithContinuationNotificationChannel { +func (iter PolicyListIterator) Response() PolicyList { 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 ResponseWithContinuationNotificationChannelIterator) Value() NotificationChannel { +func (iter PolicyListIterator) Value() Policy { if !iter.page.NotDone() { - return NotificationChannel{} + return Policy{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ResponseWithContinuationNotificationChannelIterator type. -func NewResponseWithContinuationNotificationChannelIterator(page ResponseWithContinuationNotificationChannelPage) ResponseWithContinuationNotificationChannelIterator { - return ResponseWithContinuationNotificationChannelIterator{page: page} +// Creates a new instance of the PolicyListIterator type. +func NewPolicyListIterator(page PolicyListPage) PolicyListIterator { + return PolicyListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (rwcNc ResponseWithContinuationNotificationChannel) IsEmpty() bool { - return rwcNc.Value == nil || len(*rwcNc.Value) == 0 +func (pl PolicyList) IsEmpty() bool { + return pl.Value == nil || len(*pl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (rwcNc ResponseWithContinuationNotificationChannel) hasNextLink() bool { - return rwcNc.NextLink != nil && len(*rwcNc.NextLink) != 0 +func (pl PolicyList) hasNextLink() bool { + return pl.NextLink != nil && len(*pl.NextLink) != 0 } -// responseWithContinuationNotificationChannelPreparer prepares a request to retrieve the next set of results. +// policyListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (rwcNc ResponseWithContinuationNotificationChannel) responseWithContinuationNotificationChannelPreparer(ctx context.Context) (*http.Request, error) { - if !rwcNc.hasNextLink() { +func (pl PolicyList) policyListPreparer(ctx context.Context) (*http.Request, error) { + if !pl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcNc.NextLink))) + autorest.WithBaseURL(to.String(pl.NextLink))) } -// ResponseWithContinuationNotificationChannelPage contains a page of NotificationChannel values. -type ResponseWithContinuationNotificationChannelPage struct { - fn func(context.Context, ResponseWithContinuationNotificationChannel) (ResponseWithContinuationNotificationChannel, error) - rwcnc ResponseWithContinuationNotificationChannel +// PolicyListPage contains a page of Policy values. +type PolicyListPage struct { + fn func(context.Context, PolicyList) (PolicyList, error) + pl PolicyList } // 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 *ResponseWithContinuationNotificationChannelPage) NextWithContext(ctx context.Context) (err error) { +func (page *PolicyListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationNotificationChannelPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -6356,11 +6677,11 @@ func (page *ResponseWithContinuationNotificationChannelPage) NextWithContext(ctx }() } for { - next, err := page.fn(ctx, page.rwcnc) + next, err := page.fn(ctx, page.pl) if err != nil { return err } - page.rwcnc = next + page.pl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -6371,215 +6692,159 @@ func (page *ResponseWithContinuationNotificationChannelPage) NextWithContext(ctx // 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 *ResponseWithContinuationNotificationChannelPage) Next() error { +func (page *PolicyListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationNotificationChannelPage) NotDone() bool { - return !page.rwcnc.IsEmpty() +func (page PolicyListPage) NotDone() bool { + return !page.pl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ResponseWithContinuationNotificationChannelPage) Response() ResponseWithContinuationNotificationChannel { - return page.rwcnc +func (page PolicyListPage) Response() PolicyList { + return page.pl } // Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationNotificationChannelPage) Values() []NotificationChannel { - if page.rwcnc.IsEmpty() { +func (page PolicyListPage) Values() []Policy { + if page.pl.IsEmpty() { return nil } - return *page.rwcnc.Value + return *page.pl.Value } -// Creates a new instance of the ResponseWithContinuationNotificationChannelPage type. -func NewResponseWithContinuationNotificationChannelPage(cur ResponseWithContinuationNotificationChannel, getNextPage func(context.Context, ResponseWithContinuationNotificationChannel) (ResponseWithContinuationNotificationChannel, error)) ResponseWithContinuationNotificationChannelPage { - return ResponseWithContinuationNotificationChannelPage{ - fn: getNextPage, - rwcnc: cur, +// Creates a new instance of the PolicyListPage type. +func NewPolicyListPage(cur PolicyList, getNextPage func(context.Context, PolicyList) (PolicyList, error)) PolicyListPage { + return PolicyListPage{ + fn: getNextPage, + pl: cur, } } -// ResponseWithContinuationPolicy the response of a list operation. -type ResponseWithContinuationPolicy struct { - autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]Policy `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationPolicyIterator provides access to a complete listing of Policy values. -type ResponseWithContinuationPolicyIterator struct { - i int - page ResponseWithContinuationPolicyPage +// PolicyProperties properties of a Policy. +type PolicyProperties struct { + // Description - The description of the policy. + Description *string `json:"description,omitempty"` + // Status - The status of the policy. Possible values include: 'PolicyStatusEnabled', 'PolicyStatusDisabled' + Status PolicyStatus `json:"status,omitempty"` + // FactName - The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc. Possible values include: 'PolicyFactNameUserOwnedLabVMCount', 'PolicyFactNameUserOwnedLabPremiumVMCount', 'PolicyFactNameLabVMCount', 'PolicyFactNameLabPremiumVMCount', 'PolicyFactNameLabVMSize', 'PolicyFactNameGalleryImage', 'PolicyFactNameUserOwnedLabVMCountInSubnet', 'PolicyFactNameLabTargetCost', 'PolicyFactNameEnvironmentTemplate', 'PolicyFactNameScheduleEditPermission' + FactName PolicyFactName `json:"factName,omitempty"` + // FactData - The fact data of the policy. + FactData *string `json:"factData,omitempty"` + // Threshold - The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy). + Threshold *string `json:"threshold,omitempty"` + // EvaluatorType - The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy). Possible values include: 'AllowedValuesPolicy', 'MaxValuePolicy' + EvaluatorType PolicyEvaluatorType `json:"evaluatorType,omitempty"` + // CreatedDate - READ-ONLY; The creation date of the policy. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty"` + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` } -// 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 *ResponseWithContinuationPolicyIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationPolicyIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// MarshalJSON is the custom marshaler for PolicyProperties. +func (pp PolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pp.Description != nil { + objectMap["description"] = pp.Description } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil + if pp.Status != "" { + objectMap["status"] = pp.Status } - err = iter.page.NextWithContext(ctx) - if err != nil { - iter.i-- - return err + if pp.FactName != "" { + objectMap["factName"] = pp.FactName } - 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 *ResponseWithContinuationPolicyIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationPolicyIterator) 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 ResponseWithContinuationPolicyIterator) Response() ResponseWithContinuationPolicy { - 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 ResponseWithContinuationPolicyIterator) Value() Policy { - if !iter.page.NotDone() { - return Policy{} + if pp.FactData != nil { + objectMap["factData"] = pp.FactData } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResponseWithContinuationPolicyIterator type. -func NewResponseWithContinuationPolicyIterator(page ResponseWithContinuationPolicyPage) ResponseWithContinuationPolicyIterator { - return ResponseWithContinuationPolicyIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (rwcP ResponseWithContinuationPolicy) IsEmpty() bool { - return rwcP.Value == nil || len(*rwcP.Value) == 0 -} - -// hasNextLink returns true if the NextLink is not empty. -func (rwcP ResponseWithContinuationPolicy) hasNextLink() bool { - return rwcP.NextLink != nil && len(*rwcP.NextLink) != 0 -} - -// responseWithContinuationPolicyPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rwcP ResponseWithContinuationPolicy) responseWithContinuationPolicyPreparer(ctx context.Context) (*http.Request, error) { - if !rwcP.hasNextLink() { - return nil, nil + if pp.Threshold != nil { + objectMap["threshold"] = pp.Threshold } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcP.NextLink))) + if pp.EvaluatorType != "" { + objectMap["evaluatorType"] = pp.EvaluatorType + } + return json.Marshal(objectMap) } -// ResponseWithContinuationPolicyPage contains a page of Policy values. -type ResponseWithContinuationPolicyPage struct { - fn func(context.Context, ResponseWithContinuationPolicy) (ResponseWithContinuationPolicy, error) - rwcp ResponseWithContinuationPolicy +// PolicyPropertiesFragment properties of a Policy. +type PolicyPropertiesFragment struct { + // Description - The description of the policy. + Description *string `json:"description,omitempty"` + // Status - The status of the policy. Possible values include: 'PolicyStatusEnabled', 'PolicyStatusDisabled' + Status PolicyStatus `json:"status,omitempty"` + // FactName - The fact name of the policy (e.g. LabVmCount, LabVmSize, MaxVmsAllowedPerLab, etc. Possible values include: 'PolicyFactNameUserOwnedLabVMCount', 'PolicyFactNameUserOwnedLabPremiumVMCount', 'PolicyFactNameLabVMCount', 'PolicyFactNameLabPremiumVMCount', 'PolicyFactNameLabVMSize', 'PolicyFactNameGalleryImage', 'PolicyFactNameUserOwnedLabVMCountInSubnet', 'PolicyFactNameLabTargetCost', 'PolicyFactNameEnvironmentTemplate', 'PolicyFactNameScheduleEditPermission' + FactName PolicyFactName `json:"factName,omitempty"` + // FactData - The fact data of the policy. + FactData *string `json:"factData,omitempty"` + // Threshold - The threshold of the policy (i.e. a number for MaxValuePolicy, and a JSON array of values for AllowedValuesPolicy). + Threshold *string `json:"threshold,omitempty"` + // EvaluatorType - The evaluator type of the policy (i.e. AllowedValuesPolicy, MaxValuePolicy). Possible values include: 'AllowedValuesPolicy', 'MaxValuePolicy' + EvaluatorType PolicyEvaluatorType `json:"evaluatorType,omitempty"` } -// 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 *ResponseWithContinuationPolicyPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationPolicyPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rwcp) - if err != nil { - return err - } - page.rwcp = next - if !next.hasNextLink() || !next.IsEmpty() { - break - } - } - return nil +// PolicySetResult result of a policy set evaluation. +type PolicySetResult struct { + // HasError - A value indicating whether this policy set evaluation has discovered violations. + HasError *bool `json:"hasError,omitempty"` + // PolicyViolations - The list of policy violations. + PolicyViolations *[]PolicyViolation `json:"policyViolations,omitempty"` } -// 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 *ResponseWithContinuationPolicyPage) Next() error { - return page.NextWithContext(context.Background()) +// PolicyViolation policy violation. +type PolicyViolation struct { + // Code - The code of the policy violation. + Code *string `json:"code,omitempty"` + // Message - The message of the policy violation. + Message *string `json:"message,omitempty"` } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationPolicyPage) NotDone() bool { - return !page.rwcp.IsEmpty() +// Port properties of a network port. +type Port struct { + // TransportProtocol - Protocol type of the port. Possible values include: 'TCP', 'UDP' + TransportProtocol TransportProtocol `json:"transportProtocol,omitempty"` + // BackendPort - Backend port of the target virtual machine. + BackendPort *int32 `json:"backendPort,omitempty"` } -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationPolicyPage) Response() ResponseWithContinuationPolicy { - return page.rwcp +// PortFragment properties of a network port. +type PortFragment struct { + // TransportProtocol - Protocol type of the port. Possible values include: 'TCP', 'UDP' + TransportProtocol TransportProtocol `json:"transportProtocol,omitempty"` + // BackendPort - Backend port of the target virtual machine. + BackendPort *int32 `json:"backendPort,omitempty"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationPolicyPage) Values() []Policy { - if page.rwcp.IsEmpty() { - return nil - } - return *page.rwcp.Value +// ProviderOperationResult result of the request to list REST API operations +type ProviderOperationResult struct { + autorest.Response `json:"-"` + // Value - List of operations supported by the resource provider. + Value *[]OperationMetadata `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` } -// Creates a new instance of the ResponseWithContinuationPolicyPage type. -func NewResponseWithContinuationPolicyPage(cur ResponseWithContinuationPolicy, getNextPage func(context.Context, ResponseWithContinuationPolicy) (ResponseWithContinuationPolicy, error)) ResponseWithContinuationPolicyPage { - return ResponseWithContinuationPolicyPage{ - fn: getNextPage, - rwcp: cur, +// MarshalJSON is the custom marshaler for ProviderOperationResult. +func (por ProviderOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if por.Value != nil { + objectMap["value"] = por.Value } + return json.Marshal(objectMap) } -// ResponseWithContinuationSchedule the response of a list operation. -type ResponseWithContinuationSchedule struct { - autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]Schedule `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationScheduleIterator provides access to a complete listing of Schedule values. -type ResponseWithContinuationScheduleIterator struct { +// ProviderOperationResultIterator provides access to a complete listing of OperationMetadata values. +type ProviderOperationResultIterator struct { i int - page ResponseWithContinuationSchedulePage + page ProviderOperationResultPage } // 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 *ResponseWithContinuationScheduleIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ProviderOperationResultIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationScheduleIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationResultIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -6604,67 +6869,67 @@ func (iter *ResponseWithContinuationScheduleIterator) NextWithContext(ctx contex // 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 *ResponseWithContinuationScheduleIterator) Next() error { +func (iter *ProviderOperationResultIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationScheduleIterator) NotDone() bool { +func (iter ProviderOperationResultIterator) 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 ResponseWithContinuationScheduleIterator) Response() ResponseWithContinuationSchedule { +func (iter ProviderOperationResultIterator) Response() ProviderOperationResult { 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 ResponseWithContinuationScheduleIterator) Value() Schedule { +func (iter ProviderOperationResultIterator) Value() OperationMetadata { if !iter.page.NotDone() { - return Schedule{} + return OperationMetadata{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ResponseWithContinuationScheduleIterator type. -func NewResponseWithContinuationScheduleIterator(page ResponseWithContinuationSchedulePage) ResponseWithContinuationScheduleIterator { - return ResponseWithContinuationScheduleIterator{page: page} +// Creates a new instance of the ProviderOperationResultIterator type. +func NewProviderOperationResultIterator(page ProviderOperationResultPage) ProviderOperationResultIterator { + return ProviderOperationResultIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (rwcS ResponseWithContinuationSchedule) IsEmpty() bool { - return rwcS.Value == nil || len(*rwcS.Value) == 0 +func (por ProviderOperationResult) IsEmpty() bool { + return por.Value == nil || len(*por.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (rwcS ResponseWithContinuationSchedule) hasNextLink() bool { - return rwcS.NextLink != nil && len(*rwcS.NextLink) != 0 +func (por ProviderOperationResult) hasNextLink() bool { + return por.NextLink != nil && len(*por.NextLink) != 0 } -// responseWithContinuationSchedulePreparer prepares a request to retrieve the next set of results. +// providerOperationResultPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (rwcS ResponseWithContinuationSchedule) responseWithContinuationSchedulePreparer(ctx context.Context) (*http.Request, error) { - if !rwcS.hasNextLink() { +func (por ProviderOperationResult) providerOperationResultPreparer(ctx context.Context) (*http.Request, error) { + if !por.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcS.NextLink))) + autorest.WithBaseURL(to.String(por.NextLink))) } -// ResponseWithContinuationSchedulePage contains a page of Schedule values. -type ResponseWithContinuationSchedulePage struct { - fn func(context.Context, ResponseWithContinuationSchedule) (ResponseWithContinuationSchedule, error) - rwcs ResponseWithContinuationSchedule +// ProviderOperationResultPage contains a page of OperationMetadata values. +type ProviderOperationResultPage struct { + fn func(context.Context, ProviderOperationResult) (ProviderOperationResult, error) + por ProviderOperationResult } // 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 *ResponseWithContinuationSchedulePage) NextWithContext(ctx context.Context) (err error) { +func (page *ProviderOperationResultPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationSchedulePage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderOperationResultPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -6674,11 +6939,11 @@ func (page *ResponseWithContinuationSchedulePage) NextWithContext(ctx context.Co }() } for { - next, err := page.fn(ctx, page.rwcs) + next, err := page.fn(ctx, page.por) if err != nil { return err } - page.rwcs = next + page.por = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -6689,375 +6954,459 @@ func (page *ResponseWithContinuationSchedulePage) NextWithContext(ctx context.Co // 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 *ResponseWithContinuationSchedulePage) Next() error { +func (page *ProviderOperationResultPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationSchedulePage) NotDone() bool { - return !page.rwcs.IsEmpty() +func (page ProviderOperationResultPage) NotDone() bool { + return !page.por.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ResponseWithContinuationSchedulePage) Response() ResponseWithContinuationSchedule { - return page.rwcs +func (page ProviderOperationResultPage) Response() ProviderOperationResult { + return page.por } // Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationSchedulePage) Values() []Schedule { - if page.rwcs.IsEmpty() { +func (page ProviderOperationResultPage) Values() []OperationMetadata { + if page.por.IsEmpty() { return nil } - return *page.rwcs.Value + return *page.por.Value } -// Creates a new instance of the ResponseWithContinuationSchedulePage type. -func NewResponseWithContinuationSchedulePage(cur ResponseWithContinuationSchedule, getNextPage func(context.Context, ResponseWithContinuationSchedule) (ResponseWithContinuationSchedule, error)) ResponseWithContinuationSchedulePage { - return ResponseWithContinuationSchedulePage{ - fn: getNextPage, - rwcs: cur, +// Creates a new instance of the ProviderOperationResultPage type. +func NewProviderOperationResultPage(cur ProviderOperationResult, getNextPage func(context.Context, ProviderOperationResult) (ProviderOperationResult, error)) ProviderOperationResultPage { + return ProviderOperationResultPage{ + fn: getNextPage, + por: cur, } } -// ResponseWithContinuationSecret the response of a list operation. -type ResponseWithContinuationSecret struct { +// RdpConnection represents a .rdp file +type RdpConnection struct { autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]Secret `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationSecretIterator provides access to a complete listing of Secret values. -type ResponseWithContinuationSecretIterator struct { - i int - page ResponseWithContinuationSecretPage -} - -// 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 *ResponseWithContinuationSecretIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationSecretIterator.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 *ResponseWithContinuationSecretIterator) Next() error { - return iter.NextWithContext(context.Background()) + // Contents - The contents of the .rdp file + Contents *string `json:"contents,omitempty"` } -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationSecretIterator) NotDone() bool { - return iter.page.NotDone() && iter.i < len(iter.page.Values()) +// ResizeLabVirtualMachineProperties request body for resizing a virtual machine. +type ResizeLabVirtualMachineProperties struct { + // Size - Specifies the size of the virtual machine. + Size *string `json:"size,omitempty"` } -// Response returns the raw server response from the last page request. -func (iter ResponseWithContinuationSecretIterator) Response() ResponseWithContinuationSecret { - return iter.page.Response() +// Resource an Azure resource. +type Resource struct { + // ID - READ-ONLY; The identifier of the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` } -// Value returns the current value or a zero-initialized value if the -// iterator has advanced beyond the end of the collection. -func (iter ResponseWithContinuationSecretIterator) Value() Secret { - if !iter.page.NotDone() { - return Secret{} +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResponseWithContinuationSecretIterator type. -func NewResponseWithContinuationSecretIterator(page ResponseWithContinuationSecretPage) ResponseWithContinuationSecretIterator { - return ResponseWithContinuationSecretIterator{page: page} + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) } -// IsEmpty returns true if the ListResult contains no values. -func (rwcS ResponseWithContinuationSecret) IsEmpty() bool { - return rwcS.Value == nil || len(*rwcS.Value) == 0 +// RetargetScheduleProperties properties for retargeting a virtual machine schedule. +type RetargetScheduleProperties struct { + // CurrentResourceID - The resource Id of the virtual machine on which the schedule operates + CurrentResourceID *string `json:"currentResourceId,omitempty"` + // TargetResourceID - The resource Id of the virtual machine that the schedule should be retargeted to + TargetResourceID *string `json:"targetResourceId,omitempty"` } -// hasNextLink returns true if the NextLink is not empty. -func (rwcS ResponseWithContinuationSecret) hasNextLink() bool { - return rwcS.NextLink != nil && len(*rwcS.NextLink) != 0 +// Schedule a schedule. +type Schedule struct { + autorest.Response `json:"-"` + // ScheduleProperties - The properties of the resource. + *ScheduleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The identifier of the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` } -// responseWithContinuationSecretPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rwcS ResponseWithContinuationSecret) responseWithContinuationSecretPreparer(ctx context.Context) (*http.Request, error) { - if !rwcS.hasNextLink() { - return nil, nil +// MarshalJSON is the custom marshaler for Schedule. +func (s Schedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ScheduleProperties != nil { + objectMap["properties"] = s.ScheduleProperties } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcS.NextLink))) -} - -// ResponseWithContinuationSecretPage contains a page of Secret values. -type ResponseWithContinuationSecretPage struct { - fn func(context.Context, ResponseWithContinuationSecret) (ResponseWithContinuationSecret, error) - rwcs ResponseWithContinuationSecret + if s.Location != nil { + objectMap["location"] = s.Location + } + if s.Tags != nil { + objectMap["tags"] = s.Tags + } + return json.Marshal(objectMap) } -// 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 *ResponseWithContinuationSecretPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationSecretPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode +// UnmarshalJSON is the custom unmarshaler for Schedule struct. +func (s *Schedule) 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 scheduleProperties ScheduleProperties + err = json.Unmarshal(*v, &scheduleProperties) + if err != nil { + return err + } + s.ScheduleProperties = &scheduleProperties + } + 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 + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags } - tracing.EndSpan(ctx, sc, err) - }() - } - for { - next, err := page.fn(ctx, page.rwcs) - if err != nil { - return err - } - page.rwcs = next - if !next.hasNextLink() || !next.IsEmpty() { - break } } - 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 *ResponseWithContinuationSecretPage) Next() error { - return page.NextWithContext(context.Background()) -} -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationSecretPage) NotDone() bool { - return !page.rwcs.IsEmpty() + return nil } -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationSecretPage) Response() ResponseWithContinuationSecret { - return page.rwcs +// ScheduleCreationParameter properties for creating a schedule. +type ScheduleCreationParameter struct { + // ScheduleCreationParameterProperties - The properties of the schedule. + *ScheduleCreationParameterProperties `json:"properties,omitempty"` + // Name - The name of the virtual machine or environment + Name *string `json:"name,omitempty"` + // Location - The location of the new virtual machine or environment + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationSecretPage) Values() []Secret { - if page.rwcs.IsEmpty() { - return nil +// MarshalJSON is the custom marshaler for ScheduleCreationParameter. +func (scp ScheduleCreationParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scp.ScheduleCreationParameterProperties != nil { + objectMap["properties"] = scp.ScheduleCreationParameterProperties } - return *page.rwcs.Value -} - -// Creates a new instance of the ResponseWithContinuationSecretPage type. -func NewResponseWithContinuationSecretPage(cur ResponseWithContinuationSecret, getNextPage func(context.Context, ResponseWithContinuationSecret) (ResponseWithContinuationSecret, error)) ResponseWithContinuationSecretPage { - return ResponseWithContinuationSecretPage{ - fn: getNextPage, - rwcs: cur, + if scp.Name != nil { + objectMap["name"] = scp.Name } -} - -// ResponseWithContinuationServiceRunner the response of a list operation. -type ResponseWithContinuationServiceRunner struct { - autorest.Response `json:"-"` - // Value - Results of the list operation. - Value *[]ServiceRunner `json:"value,omitempty"` - // NextLink - Link for next set of results. - NextLink *string `json:"nextLink,omitempty"` -} - -// ResponseWithContinuationServiceRunnerIterator provides access to a complete listing of ServiceRunner -// values. -type ResponseWithContinuationServiceRunnerIterator struct { - i int - page ResponseWithContinuationServiceRunnerPage -} - -// 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 *ResponseWithContinuationServiceRunnerIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationServiceRunnerIterator.NextWithContext") - defer func() { - sc := -1 - if iter.Response().Response.Response != nil { - sc = iter.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() + if scp.Location != nil { + objectMap["location"] = scp.Location } - iter.i++ - if iter.i < len(iter.page.Values()) { - return nil + if scp.Tags != nil { + objectMap["tags"] = scp.Tags } - err = iter.page.NextWithContext(ctx) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ScheduleCreationParameter struct. +func (scp *ScheduleCreationParameter) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) 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 *ResponseWithContinuationServiceRunnerIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationServiceRunnerIterator) 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 ResponseWithContinuationServiceRunnerIterator) Response() ResponseWithContinuationServiceRunner { - 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 ResponseWithContinuationServiceRunnerIterator) Value() ServiceRunner { - if !iter.page.NotDone() { - return ServiceRunner{} + for k, v := range m { + switch k { + case "properties": + if v != nil { + var scheduleCreationParameterProperties ScheduleCreationParameterProperties + err = json.Unmarshal(*v, &scheduleCreationParameterProperties) + if err != nil { + return err + } + scp.ScheduleCreationParameterProperties = &scheduleCreationParameterProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scp.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + scp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + scp.Tags = tags + } + } } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the ResponseWithContinuationServiceRunnerIterator type. -func NewResponseWithContinuationServiceRunnerIterator(page ResponseWithContinuationServiceRunnerPage) ResponseWithContinuationServiceRunnerIterator { - return ResponseWithContinuationServiceRunnerIterator{page: page} -} -// IsEmpty returns true if the ListResult contains no values. -func (rwcSr ResponseWithContinuationServiceRunner) IsEmpty() bool { - return rwcSr.Value == nil || len(*rwcSr.Value) == 0 + return nil } -// hasNextLink returns true if the NextLink is not empty. -func (rwcSr ResponseWithContinuationServiceRunner) hasNextLink() bool { - return rwcSr.NextLink != nil && len(*rwcSr.NextLink) != 0 +// ScheduleCreationParameterFragment properties for creating a schedule. +type ScheduleCreationParameterFragment struct { + // ScheduleCreationParameterPropertiesFragment - The properties of the schedule. + *ScheduleCreationParameterPropertiesFragment `json:"properties,omitempty"` + // Name - The name of the virtual machine or environment + Name *string `json:"name,omitempty"` + // Location - The location of the new virtual machine or environment + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` } -// responseWithContinuationServiceRunnerPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (rwcSr ResponseWithContinuationServiceRunner) responseWithContinuationServiceRunnerPreparer(ctx context.Context) (*http.Request, error) { - if !rwcSr.hasNextLink() { - return nil, nil +// MarshalJSON is the custom marshaler for ScheduleCreationParameterFragment. +func (scpf ScheduleCreationParameterFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scpf.ScheduleCreationParameterPropertiesFragment != nil { + objectMap["properties"] = scpf.ScheduleCreationParameterPropertiesFragment } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcSr.NextLink))) -} - -// ResponseWithContinuationServiceRunnerPage contains a page of ServiceRunner values. -type ResponseWithContinuationServiceRunnerPage struct { - fn func(context.Context, ResponseWithContinuationServiceRunner) (ResponseWithContinuationServiceRunner, error) - rwcsr ResponseWithContinuationServiceRunner + if scpf.Name != nil { + objectMap["name"] = scpf.Name + } + if scpf.Location != nil { + objectMap["location"] = scpf.Location + } + if scpf.Tags != nil { + objectMap["tags"] = scpf.Tags + } + return json.Marshal(objectMap) } -// 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 *ResponseWithContinuationServiceRunnerPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationServiceRunnerPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() +// UnmarshalJSON is the custom unmarshaler for ScheduleCreationParameterFragment struct. +func (scpf *ScheduleCreationParameterFragment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err } - for { - next, err := page.fn(ctx, page.rwcsr) - if err != nil { - return err - } - page.rwcsr = next - if !next.hasNextLink() || !next.IsEmpty() { - break + for k, v := range m { + switch k { + case "properties": + if v != nil { + var scheduleCreationParameterPropertiesFragment ScheduleCreationParameterPropertiesFragment + err = json.Unmarshal(*v, &scheduleCreationParameterPropertiesFragment) + if err != nil { + return err + } + scpf.ScheduleCreationParameterPropertiesFragment = &scheduleCreationParameterPropertiesFragment + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scpf.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + scpf.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + scpf.Tags = tags + } } } + 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 *ResponseWithContinuationServiceRunnerPage) Next() error { - return page.NextWithContext(context.Background()) +// ScheduleCreationParameterProperties properties for schedule creation. +type ScheduleCreationParameterProperties struct { + // Status - The status of the schedule (i.e. Enabled, Disabled). Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' + Status EnableStatus `json:"status,omitempty"` + // TaskType - The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + TaskType *string `json:"taskType,omitempty"` + // WeeklyRecurrence - If the schedule will occur only some days of the week, specify the weekly recurrence. + WeeklyRecurrence *WeekDetails `json:"weeklyRecurrence,omitempty"` + // DailyRecurrence - If the schedule will occur once each day of the week, specify the daily recurrence. + DailyRecurrence *DayDetails `json:"dailyRecurrence,omitempty"` + // HourlyRecurrence - If the schedule will occur multiple times a day, specify the hourly recurrence. + HourlyRecurrence *HourDetails `json:"hourlyRecurrence,omitempty"` + // TimeZoneID - The time zone ID (e.g. Pacific Standard time). + TimeZoneID *string `json:"timeZoneId,omitempty"` + // NotificationSettings - Notification settings. + NotificationSettings *NotificationSettings `json:"notificationSettings,omitempty"` + // TargetResourceID - The resource ID to which the schedule belongs + TargetResourceID *string `json:"targetResourceId,omitempty"` } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationServiceRunnerPage) NotDone() bool { - return !page.rwcsr.IsEmpty() +// ScheduleCreationParameterPropertiesFragment properties for schedule creation. +type ScheduleCreationParameterPropertiesFragment struct { + // Status - The status of the schedule (i.e. Enabled, Disabled). Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' + Status EnableStatus `json:"status,omitempty"` + // TaskType - The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + TaskType *string `json:"taskType,omitempty"` + // WeeklyRecurrence - If the schedule will occur only some days of the week, specify the weekly recurrence. + WeeklyRecurrence *WeekDetailsFragment `json:"weeklyRecurrence,omitempty"` + // DailyRecurrence - If the schedule will occur once each day of the week, specify the daily recurrence. + DailyRecurrence *DayDetailsFragment `json:"dailyRecurrence,omitempty"` + // HourlyRecurrence - If the schedule will occur multiple times a day, specify the hourly recurrence. + HourlyRecurrence *HourDetailsFragment `json:"hourlyRecurrence,omitempty"` + // TimeZoneID - The time zone ID (e.g. Pacific Standard time). + TimeZoneID *string `json:"timeZoneId,omitempty"` + // NotificationSettings - Notification settings. + NotificationSettings *NotificationSettingsFragment `json:"notificationSettings,omitempty"` + // TargetResourceID - The resource ID to which the schedule belongs + TargetResourceID *string `json:"targetResourceId,omitempty"` } -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationServiceRunnerPage) Response() ResponseWithContinuationServiceRunner { - return page.rwcsr +// ScheduleFragment a schedule. +type ScheduleFragment struct { + // SchedulePropertiesFragment - The properties of the resource. + *SchedulePropertiesFragment `json:"properties,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationServiceRunnerPage) Values() []ServiceRunner { - if page.rwcsr.IsEmpty() { - return nil +// MarshalJSON is the custom marshaler for ScheduleFragment. +func (sf ScheduleFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sf.SchedulePropertiesFragment != nil { + objectMap["properties"] = sf.SchedulePropertiesFragment + } + if sf.Tags != nil { + objectMap["tags"] = sf.Tags } - return *page.rwcsr.Value + return json.Marshal(objectMap) } -// Creates a new instance of the ResponseWithContinuationServiceRunnerPage type. -func NewResponseWithContinuationServiceRunnerPage(cur ResponseWithContinuationServiceRunner, getNextPage func(context.Context, ResponseWithContinuationServiceRunner) (ResponseWithContinuationServiceRunner, error)) ResponseWithContinuationServiceRunnerPage { - return ResponseWithContinuationServiceRunnerPage{ - fn: getNextPage, - rwcsr: cur, +// UnmarshalJSON is the custom unmarshaler for ScheduleFragment struct. +func (sf *ScheduleFragment) 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 schedulePropertiesFragment SchedulePropertiesFragment + err = json.Unmarshal(*v, &schedulePropertiesFragment) + if err != nil { + return err + } + sf.SchedulePropertiesFragment = &schedulePropertiesFragment + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sf.Tags = tags + } + } } + + return nil } -// ResponseWithContinuationUser the response of a list operation. -type ResponseWithContinuationUser struct { +// ScheduleList the response of a list operation. +type ScheduleList struct { autorest.Response `json:"-"` // Value - Results of the list operation. - Value *[]User `json:"value,omitempty"` + Value *[]Schedule `json:"value,omitempty"` // NextLink - Link for next set of results. NextLink *string `json:"nextLink,omitempty"` } -// ResponseWithContinuationUserIterator provides access to a complete listing of User values. -type ResponseWithContinuationUserIterator struct { +// ScheduleListIterator provides access to a complete listing of Schedule values. +type ScheduleListIterator struct { i int - page ResponseWithContinuationUserPage + page ScheduleListPage } // 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 *ResponseWithContinuationUserIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *ScheduleListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationUserIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -7082,67 +7431,67 @@ func (iter *ResponseWithContinuationUserIterator) NextWithContext(ctx context.Co // 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 *ResponseWithContinuationUserIterator) Next() error { +func (iter *ScheduleListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationUserIterator) NotDone() bool { +func (iter ScheduleListIterator) 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 ResponseWithContinuationUserIterator) Response() ResponseWithContinuationUser { +func (iter ScheduleListIterator) Response() ScheduleList { 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 ResponseWithContinuationUserIterator) Value() User { +func (iter ScheduleListIterator) Value() Schedule { if !iter.page.NotDone() { - return User{} + return Schedule{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ResponseWithContinuationUserIterator type. -func NewResponseWithContinuationUserIterator(page ResponseWithContinuationUserPage) ResponseWithContinuationUserIterator { - return ResponseWithContinuationUserIterator{page: page} +// Creates a new instance of the ScheduleListIterator type. +func NewScheduleListIterator(page ScheduleListPage) ScheduleListIterator { + return ScheduleListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (rwcU ResponseWithContinuationUser) IsEmpty() bool { - return rwcU.Value == nil || len(*rwcU.Value) == 0 +func (sl ScheduleList) IsEmpty() bool { + return sl.Value == nil || len(*sl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (rwcU ResponseWithContinuationUser) hasNextLink() bool { - return rwcU.NextLink != nil && len(*rwcU.NextLink) != 0 +func (sl ScheduleList) hasNextLink() bool { + return sl.NextLink != nil && len(*sl.NextLink) != 0 } -// responseWithContinuationUserPreparer prepares a request to retrieve the next set of results. +// scheduleListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (rwcU ResponseWithContinuationUser) responseWithContinuationUserPreparer(ctx context.Context) (*http.Request, error) { - if !rwcU.hasNextLink() { +func (sl ScheduleList) scheduleListPreparer(ctx context.Context) (*http.Request, error) { + if !sl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcU.NextLink))) + autorest.WithBaseURL(to.String(sl.NextLink))) } -// ResponseWithContinuationUserPage contains a page of User values. -type ResponseWithContinuationUserPage struct { - fn func(context.Context, ResponseWithContinuationUser) (ResponseWithContinuationUser, error) - rwcu ResponseWithContinuationUser +// ScheduleListPage contains a page of Schedule values. +type ScheduleListPage struct { + fn func(context.Context, ScheduleList) (ScheduleList, error) + sl ScheduleList } // 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 *ResponseWithContinuationUserPage) NextWithContext(ctx context.Context) (err error) { +func (page *ScheduleListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationUserPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/ScheduleListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -7152,11 +7501,11 @@ func (page *ResponseWithContinuationUserPage) NextWithContext(ctx context.Contex }() } for { - next, err := page.fn(ctx, page.rwcu) + next, err := page.fn(ctx, page.sl) if err != nil { return err } - page.rwcu = next + page.sl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -7167,57 +7516,323 @@ func (page *ResponseWithContinuationUserPage) NextWithContext(ctx context.Contex // 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 *ResponseWithContinuationUserPage) Next() error { +func (page *ScheduleListPage) Next() error { return page.NextWithContext(context.Background()) } -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationUserPage) NotDone() bool { - return !page.rwcu.IsEmpty() +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ScheduleListPage) NotDone() bool { + return !page.sl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ScheduleListPage) Response() ScheduleList { + return page.sl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ScheduleListPage) Values() []Schedule { + if page.sl.IsEmpty() { + return nil + } + return *page.sl.Value +} + +// Creates a new instance of the ScheduleListPage type. +func NewScheduleListPage(cur ScheduleList, getNextPage func(context.Context, ScheduleList) (ScheduleList, error)) ScheduleListPage { + return ScheduleListPage{ + fn: getNextPage, + sl: cur, + } +} + +// ScheduleProperties properties of a schedule. +type ScheduleProperties struct { + // Status - The status of the schedule (i.e. Enabled, Disabled). Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' + Status EnableStatus `json:"status,omitempty"` + // TaskType - The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + TaskType *string `json:"taskType,omitempty"` + // WeeklyRecurrence - If the schedule will occur only some days of the week, specify the weekly recurrence. + WeeklyRecurrence *WeekDetails `json:"weeklyRecurrence,omitempty"` + // DailyRecurrence - If the schedule will occur once each day of the week, specify the daily recurrence. + DailyRecurrence *DayDetails `json:"dailyRecurrence,omitempty"` + // HourlyRecurrence - If the schedule will occur multiple times a day, specify the hourly recurrence. + HourlyRecurrence *HourDetails `json:"hourlyRecurrence,omitempty"` + // TimeZoneID - The time zone ID (e.g. Pacific Standard time). + TimeZoneID *string `json:"timeZoneId,omitempty"` + // NotificationSettings - Notification settings. + NotificationSettings *NotificationSettings `json:"notificationSettings,omitempty"` + // CreatedDate - READ-ONLY; The creation date of the schedule. + CreatedDate *date.Time `json:"createdDate,omitempty"` + // TargetResourceID - The resource ID to which the schedule belongs + TargetResourceID *string `json:"targetResourceId,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty"` + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduleProperties. +func (sp ScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.Status != "" { + objectMap["status"] = sp.Status + } + if sp.TaskType != nil { + objectMap["taskType"] = sp.TaskType + } + if sp.WeeklyRecurrence != nil { + objectMap["weeklyRecurrence"] = sp.WeeklyRecurrence + } + if sp.DailyRecurrence != nil { + objectMap["dailyRecurrence"] = sp.DailyRecurrence + } + if sp.HourlyRecurrence != nil { + objectMap["hourlyRecurrence"] = sp.HourlyRecurrence + } + if sp.TimeZoneID != nil { + objectMap["timeZoneId"] = sp.TimeZoneID + } + if sp.NotificationSettings != nil { + objectMap["notificationSettings"] = sp.NotificationSettings + } + if sp.TargetResourceID != nil { + objectMap["targetResourceId"] = sp.TargetResourceID + } + return json.Marshal(objectMap) +} + +// SchedulePropertiesFragment properties of a schedule. +type SchedulePropertiesFragment struct { + // Status - The status of the schedule (i.e. Enabled, Disabled). Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' + Status EnableStatus `json:"status,omitempty"` + // TaskType - The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). + TaskType *string `json:"taskType,omitempty"` + // WeeklyRecurrence - If the schedule will occur only some days of the week, specify the weekly recurrence. + WeeklyRecurrence *WeekDetailsFragment `json:"weeklyRecurrence,omitempty"` + // DailyRecurrence - If the schedule will occur once each day of the week, specify the daily recurrence. + DailyRecurrence *DayDetailsFragment `json:"dailyRecurrence,omitempty"` + // HourlyRecurrence - If the schedule will occur multiple times a day, specify the hourly recurrence. + HourlyRecurrence *HourDetailsFragment `json:"hourlyRecurrence,omitempty"` + // TimeZoneID - The time zone ID (e.g. Pacific Standard time). + TimeZoneID *string `json:"timeZoneId,omitempty"` + // NotificationSettings - Notification settings. + NotificationSettings *NotificationSettingsFragment `json:"notificationSettings,omitempty"` + // TargetResourceID - The resource ID to which the schedule belongs + TargetResourceID *string `json:"targetResourceId,omitempty"` +} + +// SchedulesExecuteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SchedulesExecuteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SchedulesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SchedulesExecuteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SchedulesExecuteFuture.Result. +func (future *SchedulesExecuteFuture) result(client SchedulesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.SchedulesExecuteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.SchedulesExecuteFuture") + return + } + ar.Response = future.Response() + return +} + +// Secret a secret. +type Secret struct { + autorest.Response `json:"-"` + // SecretProperties - The properties of the resource. + *SecretProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The identifier of the resource. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Secret. +func (s Secret) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.SecretProperties != nil { + objectMap["properties"] = s.SecretProperties + } + if s.Location != nil { + objectMap["location"] = s.Location + } + if s.Tags != nil { + objectMap["tags"] = s.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Secret struct. +func (s *Secret) 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 secretProperties SecretProperties + err = json.Unmarshal(*v, &secretProperties) + if err != nil { + return err + } + s.SecretProperties = &secretProperties + } + 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 + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } + } + } + + return nil } -// Response returns the raw server response from the last page request. -func (page ResponseWithContinuationUserPage) Response() ResponseWithContinuationUser { - return page.rwcu +// SecretFragment a secret. +type SecretFragment struct { + // SecretPropertiesFragment - The properties of the resource. + *SecretPropertiesFragment `json:"properties,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` } -// Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationUserPage) Values() []User { - if page.rwcu.IsEmpty() { - return nil +// MarshalJSON is the custom marshaler for SecretFragment. +func (sf SecretFragment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sf.SecretPropertiesFragment != nil { + objectMap["properties"] = sf.SecretPropertiesFragment + } + if sf.Tags != nil { + objectMap["tags"] = sf.Tags } - return *page.rwcu.Value + return json.Marshal(objectMap) } -// Creates a new instance of the ResponseWithContinuationUserPage type. -func NewResponseWithContinuationUserPage(cur ResponseWithContinuationUser, getNextPage func(context.Context, ResponseWithContinuationUser) (ResponseWithContinuationUser, error)) ResponseWithContinuationUserPage { - return ResponseWithContinuationUserPage{ - fn: getNextPage, - rwcu: cur, +// UnmarshalJSON is the custom unmarshaler for SecretFragment struct. +func (sf *SecretFragment) 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 secretPropertiesFragment SecretPropertiesFragment + err = json.Unmarshal(*v, &secretPropertiesFragment) + if err != nil { + return err + } + sf.SecretPropertiesFragment = &secretPropertiesFragment + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sf.Tags = tags + } + } } + + return nil } -// ResponseWithContinuationVirtualNetwork the response of a list operation. -type ResponseWithContinuationVirtualNetwork struct { +// SecretList the response of a list operation. +type SecretList struct { autorest.Response `json:"-"` // Value - Results of the list operation. - Value *[]VirtualNetwork `json:"value,omitempty"` + Value *[]Secret `json:"value,omitempty"` // NextLink - Link for next set of results. NextLink *string `json:"nextLink,omitempty"` } -// ResponseWithContinuationVirtualNetworkIterator provides access to a complete listing of VirtualNetwork -// values. -type ResponseWithContinuationVirtualNetworkIterator struct { +// SecretListIterator provides access to a complete listing of Secret values. +type SecretListIterator struct { i int - page ResponseWithContinuationVirtualNetworkPage + page SecretListPage } // 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 *ResponseWithContinuationVirtualNetworkIterator) NextWithContext(ctx context.Context) (err error) { +func (iter *SecretListIterator) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationVirtualNetworkIterator.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SecretListIterator.NextWithContext") defer func() { sc := -1 if iter.Response().Response.Response != nil { @@ -7242,67 +7857,67 @@ func (iter *ResponseWithContinuationVirtualNetworkIterator) NextWithContext(ctx // 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 *ResponseWithContinuationVirtualNetworkIterator) Next() error { +func (iter *SecretListIterator) Next() error { return iter.NextWithContext(context.Background()) } // NotDone returns true if the enumeration should be started or is not yet complete. -func (iter ResponseWithContinuationVirtualNetworkIterator) NotDone() bool { +func (iter SecretListIterator) 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 ResponseWithContinuationVirtualNetworkIterator) Response() ResponseWithContinuationVirtualNetwork { +func (iter SecretListIterator) Response() SecretList { 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 ResponseWithContinuationVirtualNetworkIterator) Value() VirtualNetwork { +func (iter SecretListIterator) Value() Secret { if !iter.page.NotDone() { - return VirtualNetwork{} + return Secret{} } return iter.page.Values()[iter.i] } -// Creates a new instance of the ResponseWithContinuationVirtualNetworkIterator type. -func NewResponseWithContinuationVirtualNetworkIterator(page ResponseWithContinuationVirtualNetworkPage) ResponseWithContinuationVirtualNetworkIterator { - return ResponseWithContinuationVirtualNetworkIterator{page: page} +// Creates a new instance of the SecretListIterator type. +func NewSecretListIterator(page SecretListPage) SecretListIterator { + return SecretListIterator{page: page} } // IsEmpty returns true if the ListResult contains no values. -func (rwcVn ResponseWithContinuationVirtualNetwork) IsEmpty() bool { - return rwcVn.Value == nil || len(*rwcVn.Value) == 0 +func (sl SecretList) IsEmpty() bool { + return sl.Value == nil || len(*sl.Value) == 0 } // hasNextLink returns true if the NextLink is not empty. -func (rwcVn ResponseWithContinuationVirtualNetwork) hasNextLink() bool { - return rwcVn.NextLink != nil && len(*rwcVn.NextLink) != 0 +func (sl SecretList) hasNextLink() bool { + return sl.NextLink != nil && len(*sl.NextLink) != 0 } -// responseWithContinuationVirtualNetworkPreparer prepares a request to retrieve the next set of results. +// secretListPreparer prepares a request to retrieve the next set of results. // It returns nil if no more results exist. -func (rwcVn ResponseWithContinuationVirtualNetwork) responseWithContinuationVirtualNetworkPreparer(ctx context.Context) (*http.Request, error) { - if !rwcVn.hasNextLink() { +func (sl SecretList) secretListPreparer(ctx context.Context) (*http.Request, error) { + if !sl.hasNextLink() { return nil, nil } return autorest.Prepare((&http.Request{}).WithContext(ctx), autorest.AsJSON(), autorest.AsGet(), - autorest.WithBaseURL(to.String(rwcVn.NextLink))) + autorest.WithBaseURL(to.String(sl.NextLink))) } -// ResponseWithContinuationVirtualNetworkPage contains a page of VirtualNetwork values. -type ResponseWithContinuationVirtualNetworkPage struct { - fn func(context.Context, ResponseWithContinuationVirtualNetwork) (ResponseWithContinuationVirtualNetwork, error) - rwcvn ResponseWithContinuationVirtualNetwork +// SecretListPage contains a page of Secret values. +type SecretListPage struct { + fn func(context.Context, SecretList) (SecretList, error) + sl SecretList } // 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 *ResponseWithContinuationVirtualNetworkPage) NextWithContext(ctx context.Context) (err error) { +func (page *SecretListPage) NextWithContext(ctx context.Context) (err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ResponseWithContinuationVirtualNetworkPage.NextWithContext") + ctx = tracing.StartSpan(ctx, fqdn+"/SecretListPage.NextWithContext") defer func() { sc := -1 if page.Response().Response.Response != nil { @@ -7312,11 +7927,11 @@ func (page *ResponseWithContinuationVirtualNetworkPage) NextWithContext(ctx cont }() } for { - next, err := page.fn(ctx, page.rwcvn) + next, err := page.fn(ctx, page.sl) if err != nil { return err } - page.rwcvn = next + page.sl = next if !next.hasNextLink() || !next.IsEmpty() { break } @@ -7327,49 +7942,109 @@ func (page *ResponseWithContinuationVirtualNetworkPage) NextWithContext(ctx cont // 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 *ResponseWithContinuationVirtualNetworkPage) Next() error { +func (page *SecretListPage) Next() error { return page.NextWithContext(context.Background()) } // NotDone returns true if the page enumeration should be started or is not yet complete. -func (page ResponseWithContinuationVirtualNetworkPage) NotDone() bool { - return !page.rwcvn.IsEmpty() +func (page SecretListPage) NotDone() bool { + return !page.sl.IsEmpty() } // Response returns the raw server response from the last page request. -func (page ResponseWithContinuationVirtualNetworkPage) Response() ResponseWithContinuationVirtualNetwork { - return page.rwcvn +func (page SecretListPage) Response() SecretList { + return page.sl } // Values returns the slice of values for the current page or nil if there are no values. -func (page ResponseWithContinuationVirtualNetworkPage) Values() []VirtualNetwork { - if page.rwcvn.IsEmpty() { +func (page SecretListPage) Values() []Secret { + if page.sl.IsEmpty() { return nil } - return *page.rwcvn.Value + return *page.sl.Value } -// Creates a new instance of the ResponseWithContinuationVirtualNetworkPage type. -func NewResponseWithContinuationVirtualNetworkPage(cur ResponseWithContinuationVirtualNetwork, getNextPage func(context.Context, ResponseWithContinuationVirtualNetwork) (ResponseWithContinuationVirtualNetwork, error)) ResponseWithContinuationVirtualNetworkPage { - return ResponseWithContinuationVirtualNetworkPage{ - fn: getNextPage, - rwcvn: cur, +// Creates a new instance of the SecretListPage type. +func NewSecretListPage(cur SecretList, getNextPage func(context.Context, SecretList) (SecretList, error)) SecretListPage { + return SecretListPage{ + fn: getNextPage, + sl: cur, } } -// RetargetScheduleProperties properties for retargeting a virtual machine schedule. -type RetargetScheduleProperties struct { - // CurrentResourceID - The resource Id of the virtual machine on which the schedule operates - CurrentResourceID *string `json:"currentResourceId,omitempty"` - // TargetResourceID - The resource Id of the virtual machine that the schedule should be retargeted to - TargetResourceID *string `json:"targetResourceId,omitempty"` +// SecretProperties properties of a secret. +type SecretProperties struct { + // Value - The value of the secret for secret creation. + Value *string `json:"value,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning status of the resource. + ProvisioningState *string `json:"provisioningState,omitempty"` + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). + UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` } -// Schedule a schedule. -type Schedule struct { +// MarshalJSON is the custom marshaler for SecretProperties. +func (sp SecretProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.Value != nil { + objectMap["value"] = sp.Value + } + return json.Marshal(objectMap) +} + +// SecretPropertiesFragment properties of a secret. +type SecretPropertiesFragment struct { + // Value - The value of the secret for secret creation. + Value *string `json:"value,omitempty"` +} + +// SecretsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SecretsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SecretsClient) (Secret, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SecretsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SecretsCreateOrUpdateFuture.Result. +func (future *SecretsCreateOrUpdateFuture) result(client SecretsClient) (s Secret, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.SecretsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.SecretsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.CreateOrUpdateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.SecretsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// ServiceFabric a Service Fabric. +type ServiceFabric struct { autorest.Response `json:"-"` - // ScheduleProperties - The properties of the resource. - *ScheduleProperties `json:"properties,omitempty"` + // ServiceFabricProperties - The properties of the resource. + *ServiceFabricProperties `json:"properties,omitempty"` // ID - READ-ONLY; The identifier of the resource. ID *string `json:"id,omitempty"` // Name - READ-ONLY; The name of the resource. @@ -7382,23 +8057,23 @@ type Schedule struct { Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for Schedule. -func (s Schedule) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServiceFabric. +func (sf ServiceFabric) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if s.ScheduleProperties != nil { - objectMap["properties"] = s.ScheduleProperties + if sf.ServiceFabricProperties != nil { + objectMap["properties"] = sf.ServiceFabricProperties } - if s.Location != nil { - objectMap["location"] = s.Location + if sf.Location != nil { + objectMap["location"] = sf.Location } - if s.Tags != nil { - objectMap["tags"] = s.Tags + if sf.Tags != nil { + objectMap["tags"] = sf.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for Schedule struct. -func (s *Schedule) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ServiceFabric struct. +func (sf *ServiceFabric) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -7408,12 +8083,12 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var scheduleProperties ScheduleProperties - err = json.Unmarshal(*v, &scheduleProperties) + var serviceFabricProperties ServiceFabricProperties + err = json.Unmarshal(*v, &serviceFabricProperties) if err != nil { return err } - s.ScheduleProperties = &scheduleProperties + sf.ServiceFabricProperties = &serviceFabricProperties } case "id": if v != nil { @@ -7422,7 +8097,7 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { if err != nil { return err } - s.ID = &ID + sf.ID = &ID } case "name": if v != nil { @@ -7431,7 +8106,7 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { if err != nil { return err } - s.Name = &name + sf.Name = &name } case "type": if v != nil { @@ -7440,7 +8115,7 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { if err != nil { return err } - s.Type = &typeVar + sf.Type = &typeVar } case "location": if v != nil { @@ -7449,7 +8124,7 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { if err != nil { return err } - s.Location = &location + sf.Location = &location } case "tags": if v != nil { @@ -7458,7 +8133,7 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { if err != nil { return err } - s.Tags = tags + sf.Tags = tags } } } @@ -7466,39 +8141,28 @@ func (s *Schedule) UnmarshalJSON(body []byte) error { return nil } -// ScheduleFragment a schedule. -type ScheduleFragment struct { - // SchedulePropertiesFragment - The properties of the resource. - *SchedulePropertiesFragment `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` +// ServiceFabricFragment a Service Fabric. +type ServiceFabricFragment struct { + // ServiceFabricPropertiesFragment - The properties of the resource. + *ServiceFabricPropertiesFragment `json:"properties,omitempty"` // Tags - The tags of the resource. Tags map[string]*string `json:"tags"` } -// MarshalJSON is the custom marshaler for ScheduleFragment. -func (sf ScheduleFragment) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServiceFabricFragment. +func (sff ServiceFabricFragment) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if sf.SchedulePropertiesFragment != nil { - objectMap["properties"] = sf.SchedulePropertiesFragment + if sff.ServiceFabricPropertiesFragment != nil { + objectMap["properties"] = sff.ServiceFabricPropertiesFragment } - if sf.Location != nil { - objectMap["location"] = sf.Location - } - if sf.Tags != nil { - objectMap["tags"] = sf.Tags + if sff.Tags != nil { + objectMap["tags"] = sff.Tags } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ScheduleFragment struct. -func (sf *ScheduleFragment) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ServiceFabricFragment struct. +func (sff *ServiceFabricFragment) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -7508,48 +8172,12 @@ func (sf *ScheduleFragment) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var schedulePropertiesFragment SchedulePropertiesFragment - err = json.Unmarshal(*v, &schedulePropertiesFragment) - if err != nil { - return err - } - sf.SchedulePropertiesFragment = &schedulePropertiesFragment - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - sf.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - sf.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - sf.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) + var serviceFabricPropertiesFragment ServiceFabricPropertiesFragment + err = json.Unmarshal(*v, &serviceFabricPropertiesFragment) if err != nil { return err } - sf.Location = &location + sff.ServiceFabricPropertiesFragment = &serviceFabricPropertiesFragment } case "tags": if v != nil { @@ -7558,111 +8186,218 @@ func (sf *ScheduleFragment) UnmarshalJSON(body []byte) error { if err != nil { return err } - sf.Tags = tags + sff.Tags = tags + } + } + } + + return nil +} + +// ServiceFabricList the response of a list operation. +type ServiceFabricList struct { + autorest.Response `json:"-"` + // Value - Results of the list operation. + Value *[]ServiceFabric `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ServiceFabricListIterator provides access to a complete listing of ServiceFabric values. +type ServiceFabricListIterator struct { + i int + page ServiceFabricListPage +} + +// 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 *ServiceFabricListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricListIterator.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 *ServiceFabricListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServiceFabricListIterator) 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 ServiceFabricListIterator) Response() ServiceFabricList { + 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 ServiceFabricListIterator) Value() ServiceFabric { + if !iter.page.NotDone() { + return ServiceFabric{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServiceFabricListIterator type. +func NewServiceFabricListIterator(page ServiceFabricListPage) ServiceFabricListIterator { + return ServiceFabricListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sfl ServiceFabricList) IsEmpty() bool { + return sfl.Value == nil || len(*sfl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sfl ServiceFabricList) hasNextLink() bool { + return sfl.NextLink != nil && len(*sfl.NextLink) != 0 +} + +// serviceFabricListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sfl ServiceFabricList) serviceFabricListPreparer(ctx context.Context) (*http.Request, error) { + if !sfl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sfl.NextLink))) +} + +// ServiceFabricListPage contains a page of ServiceFabric values. +type ServiceFabricListPage struct { + fn func(context.Context, ServiceFabricList) (ServiceFabricList, error) + sfl ServiceFabricList +} + +// 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 *ServiceFabricListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sfl) + if err != nil { + return err + } + page.sfl = next + if !next.hasNextLink() || !next.IsEmpty() { + break } } - return nil } -// ScheduleProperties properties of a schedule. -type ScheduleProperties struct { - // Status - The status of the schedule (i.e. Enabled, Disabled). Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' - Status EnableStatus `json:"status,omitempty"` - // TaskType - The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). - TaskType *string `json:"taskType,omitempty"` - // WeeklyRecurrence - If the schedule will occur only some days of the week, specify the weekly recurrence. - WeeklyRecurrence *WeekDetails `json:"weeklyRecurrence,omitempty"` - // DailyRecurrence - If the schedule will occur once each day of the week, specify the daily recurrence. - DailyRecurrence *DayDetails `json:"dailyRecurrence,omitempty"` - // HourlyRecurrence - If the schedule will occur multiple times a day, specify the hourly recurrence. - HourlyRecurrence *HourDetails `json:"hourlyRecurrence,omitempty"` - // TimeZoneID - The time zone ID (e.g. Pacific Standard time). - TimeZoneID *string `json:"timeZoneId,omitempty"` - // NotificationSettings - Notification settings. - NotificationSettings *NotificationSettings `json:"notificationSettings,omitempty"` - // CreatedDate - READ-ONLY; The creation date of the schedule. - CreatedDate *date.Time `json:"createdDate,omitempty"` - // TargetResourceID - The resource ID to which the schedule belongs - TargetResourceID *string `json:"targetResourceId,omitempty"` - // ProvisioningState - The provisioning status of the resource. +// 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 *ServiceFabricListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServiceFabricListPage) NotDone() bool { + return !page.sfl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServiceFabricListPage) Response() ServiceFabricList { + return page.sfl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServiceFabricListPage) Values() []ServiceFabric { + if page.sfl.IsEmpty() { + return nil + } + return *page.sfl.Value +} + +// Creates a new instance of the ServiceFabricListPage type. +func NewServiceFabricListPage(cur ServiceFabricList, getNextPage func(context.Context, ServiceFabricList) (ServiceFabricList, error)) ServiceFabricListPage { + return ServiceFabricListPage{ + fn: getNextPage, + sfl: cur, + } +} + +// ServiceFabricProperties properties of a service fabric. +type ServiceFabricProperties struct { + // ExternalServiceFabricID - The backing service fabric resource's id + ExternalServiceFabricID *string `json:"externalServiceFabricId,omitempty"` + // EnvironmentID - The resource id of the environment under which the service fabric resource is present + EnvironmentID *string `json:"environmentId,omitempty"` + // ApplicableSchedule - READ-ONLY; The applicable schedule for the virtual machine. + ApplicableSchedule *ApplicableSchedule `json:"applicableSchedule,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning status of the resource. ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` } -// MarshalJSON is the custom marshaler for ScheduleProperties. -func (sp ScheduleProperties) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ServiceFabricProperties. +func (sfp ServiceFabricProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if sp.Status != "" { - objectMap["status"] = sp.Status - } - if sp.TaskType != nil { - objectMap["taskType"] = sp.TaskType - } - if sp.WeeklyRecurrence != nil { - objectMap["weeklyRecurrence"] = sp.WeeklyRecurrence - } - if sp.DailyRecurrence != nil { - objectMap["dailyRecurrence"] = sp.DailyRecurrence - } - if sp.HourlyRecurrence != nil { - objectMap["hourlyRecurrence"] = sp.HourlyRecurrence - } - if sp.TimeZoneID != nil { - objectMap["timeZoneId"] = sp.TimeZoneID - } - if sp.NotificationSettings != nil { - objectMap["notificationSettings"] = sp.NotificationSettings + if sfp.ExternalServiceFabricID != nil { + objectMap["externalServiceFabricId"] = sfp.ExternalServiceFabricID } - if sp.TargetResourceID != nil { - objectMap["targetResourceId"] = sp.TargetResourceID - } - if sp.ProvisioningState != nil { - objectMap["provisioningState"] = sp.ProvisioningState - } - if sp.UniqueIdentifier != nil { - objectMap["uniqueIdentifier"] = sp.UniqueIdentifier + if sfp.EnvironmentID != nil { + objectMap["environmentId"] = sfp.EnvironmentID } return json.Marshal(objectMap) } -// SchedulePropertiesFragment properties of a schedule. -type SchedulePropertiesFragment struct { - // Status - The status of the schedule (i.e. Enabled, Disabled). Possible values include: 'EnableStatusEnabled', 'EnableStatusDisabled' - Status EnableStatus `json:"status,omitempty"` - // TaskType - The task type of the schedule (e.g. LabVmsShutdownTask, LabVmAutoStart). - TaskType *string `json:"taskType,omitempty"` - // WeeklyRecurrence - If the schedule will occur only some days of the week, specify the weekly recurrence. - WeeklyRecurrence *WeekDetailsFragment `json:"weeklyRecurrence,omitempty"` - // DailyRecurrence - If the schedule will occur once each day of the week, specify the daily recurrence. - DailyRecurrence *DayDetailsFragment `json:"dailyRecurrence,omitempty"` - // HourlyRecurrence - If the schedule will occur multiple times a day, specify the hourly recurrence. - HourlyRecurrence *HourDetailsFragment `json:"hourlyRecurrence,omitempty"` - // TimeZoneID - The time zone ID (e.g. Pacific Standard time). - TimeZoneID *string `json:"timeZoneId,omitempty"` - // NotificationSettings - Notification settings. - NotificationSettings *NotificationSettingsFragment `json:"notificationSettings,omitempty"` - // TargetResourceID - The resource ID to which the schedule belongs - TargetResourceID *string `json:"targetResourceId,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +// ServiceFabricPropertiesFragment properties of a service fabric. +type ServiceFabricPropertiesFragment struct { + // ExternalServiceFabricID - The backing service fabric resource's id + ExternalServiceFabricID *string `json:"externalServiceFabricId,omitempty"` + // EnvironmentID - The resource id of the environment under which the service fabric resource is present + EnvironmentID *string `json:"environmentId,omitempty"` } -// SchedulesExecuteFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type SchedulesExecuteFuture struct { +// ServiceFabricSchedulesExecuteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ServiceFabricSchedulesExecuteFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. - Result func(SchedulesClient) (autorest.Response, error) + Result func(ServiceFabricSchedulesClient) (autorest.Response, error) } // UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *SchedulesExecuteFuture) UnmarshalJSON(body []byte) error { +func (future *ServiceFabricSchedulesExecuteFuture) UnmarshalJSON(body []byte) error { var azFuture azure.Future if err := json.Unmarshal(body, &azFuture); err != nil { return err @@ -7672,132 +8407,175 @@ func (future *SchedulesExecuteFuture) UnmarshalJSON(body []byte) error { return nil } -// result is the default implementation for SchedulesExecuteFuture.Result. -func (future *SchedulesExecuteFuture) result(client SchedulesClient) (ar autorest.Response, err error) { +// result is the default implementation for ServiceFabricSchedulesExecuteFuture.Result. +func (future *ServiceFabricSchedulesExecuteFuture) result(client ServiceFabricSchedulesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "dtl.SchedulesExecuteFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesExecuteFuture", "Result", future.Response(), "Polling failure") return } if !done { ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("dtl.SchedulesExecuteFuture") + err = azure.NewAsyncOpIncompleteError("dtl.ServiceFabricSchedulesExecuteFuture") return } ar.Response = future.Response() return } -// Secret a secret. -type Secret struct { - autorest.Response `json:"-"` - // SecretProperties - The properties of the resource. - *SecretProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` - // Tags - The tags of the resource. - Tags map[string]*string `json:"tags"` +// ServiceFabricsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ServiceFabricsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServiceFabricsClient) (ServiceFabric, error) } -// MarshalJSON is the custom marshaler for Secret. -func (s Secret) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if s.SecretProperties != nil { - objectMap["properties"] = s.SecretProperties +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServiceFabricsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err } - if s.Location != nil { - objectMap["location"] = s.Location + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServiceFabricsCreateOrUpdateFuture.Result. +func (future *ServiceFabricsCreateOrUpdateFuture) result(client ServiceFabricsClient) (sf ServiceFabric, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return } - if s.Tags != nil { - objectMap["tags"] = s.Tags + if !done { + sf.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.ServiceFabricsCreateOrUpdateFuture") + return } - return json.Marshal(objectMap) + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sf.Response.Response, err = future.GetResult(sender); err == nil && sf.Response.Response.StatusCode != http.StatusNoContent { + sf, err = client.CreateOrUpdateResponder(sf.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsCreateOrUpdateFuture", "Result", sf.Response.Response, "Failure responding to request") + } + } + return } -// UnmarshalJSON is the custom unmarshaler for Secret struct. -func (s *Secret) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) - if err != nil { +// ServiceFabricsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServiceFabricsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServiceFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServiceFabricsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { return err } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var secretProperties SecretProperties - err = json.Unmarshal(*v, &secretProperties) - if err != nil { - return err - } - s.SecretProperties = &secretProperties - } - 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 - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - s.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - s.Tags = tags - } - } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServiceFabricsDeleteFuture.Result. +func (future *ServiceFabricsDeleteFuture) result(client ServiceFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.ServiceFabricsDeleteFuture") + return } + ar.Response = future.Response() + return +} + +// ServiceFabricsStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServiceFabricsStartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServiceFabricsClient) (autorest.Response, error) +} +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServiceFabricsStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result return nil } -// SecretProperties properties of a secret. -type SecretProperties struct { - // Value - The value of the secret for secret creation. - Value *string `json:"value,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +// result is the default implementation for ServiceFabricsStartFuture.Result. +func (future *ServiceFabricsStartFuture) result(client ServiceFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.ServiceFabricsStartFuture") + return + } + ar.Response = future.Response() + return +} + +// ServiceFabricsStopFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ServiceFabricsStopFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ServiceFabricsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ServiceFabricsStopFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ServiceFabricsStopFuture.Result. +func (future *ServiceFabricsStopFuture) result(client ServiceFabricsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsStopFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.ServiceFabricsStopFuture") + return + } + ar.Response = future.Response() + return } // ServiceRunner a container for a managed identity to execute DevTest lab services. @@ -7861,6 +8639,10 @@ type ShutdownNotificationContent struct { GUID *string `json:"guid,omitempty"` // Owner - The owner of the virtual machine. Owner *string `json:"owner,omitempty"` + // VMURL - The URL of the virtual machine. + VMURL *string `json:"vmUrl,omitempty"` + // MinutesUntilShutdown - Minutes remaining until shutdown + MinutesUntilShutdown *string `json:"minutesUntilShutdown,omitempty"` // EventType - The event for which a notification will be sent. EventType *string `json:"eventType,omitempty"` // Text - The text for the notification. @@ -7953,6 +8735,21 @@ type TargetCostProperties struct { CycleType ReportingCycleType `json:"cycleType,omitempty"` } +// UpdateResource represents an update resource +type UpdateResource struct { + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for UpdateResource. +func (ur UpdateResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ur.Tags != nil { + objectMap["tags"] = ur.Tags + } + return json.Marshal(objectMap) +} + // User profile of a lab user. type User struct { autorest.Response `json:"-"` @@ -8058,14 +8855,6 @@ func (u *User) UnmarshalJSON(body []byte) error { type UserFragment struct { // UserPropertiesFragment - The properties of the resource. *UserPropertiesFragment `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` // Tags - The tags of the resource. Tags map[string]*string `json:"tags"` } @@ -8076,9 +8865,6 @@ func (uf UserFragment) MarshalJSON() ([]byte, error) { if uf.UserPropertiesFragment != nil { objectMap["properties"] = uf.UserPropertiesFragment } - if uf.Location != nil { - objectMap["location"] = uf.Location - } if uf.Tags != nil { objectMap["tags"] = uf.Tags } @@ -8103,42 +8889,6 @@ func (uf *UserFragment) UnmarshalJSON(body []byte) error { } uf.UserPropertiesFragment = &userPropertiesFragment } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - uf.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - uf.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - uf.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - uf.Location = &location - } case "tags": if v != nil { var tags map[string]*string @@ -8151,35 +8901,194 @@ func (uf *UserFragment) UnmarshalJSON(body []byte) error { } } - return nil + return nil +} + +// UserIdentity identity attributes of a lab user. +type UserIdentity struct { + // PrincipalName - Set to the principal name / UPN of the client JWT making the request. + PrincipalName *string `json:"principalName,omitempty"` + // PrincipalID - Set to the principal Id of the client JWT making the request. Service principal will not have the principal Id. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - Set to the tenant ID of the client JWT making the request. + TenantID *string `json:"tenantId,omitempty"` + // ObjectID - Set to the object Id of the client JWT making the request. Not all users have object Id. For CSP (reseller) scenarios for example, object Id is not available. + ObjectID *string `json:"objectId,omitempty"` + // AppID - Set to the app Id of the client JWT making the request. + AppID *string `json:"appId,omitempty"` +} + +// UserIdentityFragment identity attributes of a lab user. +type UserIdentityFragment struct { + // PrincipalName - Set to the principal name / UPN of the client JWT making the request. + PrincipalName *string `json:"principalName,omitempty"` + // PrincipalID - Set to the principal Id of the client JWT making the request. Service principal will not have the principal Id. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - Set to the tenant ID of the client JWT making the request. + TenantID *string `json:"tenantId,omitempty"` + // ObjectID - Set to the object Id of the client JWT making the request. Not all users have object Id. For CSP (reseller) scenarios for example, object Id is not available. + ObjectID *string `json:"objectId,omitempty"` + // AppID - Set to the app Id of the client JWT making the request. + AppID *string `json:"appId,omitempty"` +} + +// UserList the response of a list operation. +type UserList struct { + autorest.Response `json:"-"` + // Value - Results of the list operation. + Value *[]User `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// UserListIterator provides access to a complete listing of User values. +type UserListIterator struct { + i int + page UserListPage +} + +// 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 *UserListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserListIterator.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 *UserListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter UserListIterator) 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 UserListIterator) Response() UserList { + 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 UserListIterator) Value() User { + if !iter.page.NotDone() { + return User{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the UserListIterator type. +func NewUserListIterator(page UserListPage) UserListIterator { + return UserListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ul UserList) IsEmpty() bool { + return ul.Value == nil || len(*ul.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ul UserList) hasNextLink() bool { + return ul.NextLink != nil && len(*ul.NextLink) != 0 +} + +// userListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ul UserList) userListPreparer(ctx context.Context) (*http.Request, error) { + if !ul.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ul.NextLink))) +} + +// UserListPage contains a page of User values. +type UserListPage struct { + fn func(context.Context, UserList) (UserList, error) + ul UserList +} + +// 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 *UserListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ul) + if err != nil { + return err + } + page.ul = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *UserListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page UserListPage) NotDone() bool { + return !page.ul.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page UserListPage) Response() UserList { + return page.ul } -// UserIdentity identity attributes of a lab user. -type UserIdentity struct { - // PrincipalName - Set to the principal name / UPN of the client JWT making the request. - PrincipalName *string `json:"principalName,omitempty"` - // PrincipalID - Set to the principal Id of the client JWT making the request. Service principal will not have the principal Id. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - Set to the tenant ID of the client JWT making the request. - TenantID *string `json:"tenantId,omitempty"` - // ObjectID - Set to the object Id of the client JWT making the request. Not all users have object Id. For CSP (reseller) scenarios for example, object Id is not available. - ObjectID *string `json:"objectId,omitempty"` - // AppID - Set to the app Id of the client JWT making the request. - AppID *string `json:"appId,omitempty"` +// Values returns the slice of values for the current page or nil if there are no values. +func (page UserListPage) Values() []User { + if page.ul.IsEmpty() { + return nil + } + return *page.ul.Value } -// UserIdentityFragment identity attributes of a lab user. -type UserIdentityFragment struct { - // PrincipalName - Set to the principal name / UPN of the client JWT making the request. - PrincipalName *string `json:"principalName,omitempty"` - // PrincipalID - Set to the principal Id of the client JWT making the request. Service principal will not have the principal Id. - PrincipalID *string `json:"principalId,omitempty"` - // TenantID - Set to the tenant ID of the client JWT making the request. - TenantID *string `json:"tenantId,omitempty"` - // ObjectID - Set to the object Id of the client JWT making the request. Not all users have object Id. For CSP (reseller) scenarios for example, object Id is not available. - ObjectID *string `json:"objectId,omitempty"` - // AppID - Set to the app Id of the client JWT making the request. - AppID *string `json:"appId,omitempty"` +// Creates a new instance of the UserListPage type. +func NewUserListPage(cur UserList, getNextPage func(context.Context, UserList) (UserList, error)) UserListPage { + return UserListPage{ + fn: getNextPage, + ul: cur, + } } // UserProperties properties of a lab user profile. @@ -8190,9 +9099,9 @@ type UserProperties struct { SecretStore *UserSecretStore `json:"secretStore,omitempty"` // CreatedDate - READ-ONLY; The creation date of the user profile. CreatedDate *date.Time `json:"createdDate,omitempty"` - // ProvisioningState - The provisioning status of the resource. + // ProvisioningState - READ-ONLY; The provisioning status of the resource. ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` } @@ -8205,12 +9114,6 @@ func (up UserProperties) MarshalJSON() ([]byte, error) { if up.SecretStore != nil { objectMap["secretStore"] = up.SecretStore } - if up.ProvisioningState != nil { - objectMap["provisioningState"] = up.ProvisioningState - } - if up.UniqueIdentifier != nil { - objectMap["uniqueIdentifier"] = up.UniqueIdentifier - } return json.Marshal(objectMap) } @@ -8220,10 +9123,49 @@ type UserPropertiesFragment struct { Identity *UserIdentityFragment `json:"identity,omitempty"` // SecretStore - The secret store of the user. SecretStore *UserSecretStoreFragment `json:"secretStore,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` +} + +// UsersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type UsersCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(UsersClient) (User, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *UsersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for UsersCreateOrUpdateFuture.Result. +func (future *UsersCreateOrUpdateFuture) result(client UsersClient) (u User, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.UsersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + u.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.UsersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if u.Response.Response, err = future.GetResult(sender); err == nil && u.Response.Response.StatusCode != http.StatusNoContent { + u, err = client.CreateOrUpdateResponder(u.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.UsersCreateOrUpdateFuture", "Result", u.Response.Response, "Failure responding to request") + } + } + return } // UsersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. @@ -8340,29 +9282,220 @@ func (future *VirtualMachinesApplyArtifactsFuture) result(client VirtualMachines var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesApplyArtifactsFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesApplyArtifactsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesApplyArtifactsFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachineSchedulesExecuteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachineSchedulesExecuteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachineSchedulesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachineSchedulesExecuteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachineSchedulesExecuteFuture.Result. +func (future *VirtualMachineSchedulesExecuteFuture) result(client VirtualMachineSchedulesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachineSchedulesExecuteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachineSchedulesExecuteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesClaimFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesClaimFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesClaimFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesClaimFuture.Result. +func (future *VirtualMachinesClaimFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClaimFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesClaimFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (LabVirtualMachine, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. +func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (lvm LabVirtualMachine, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + lvm.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if lvm.Response.Response, err = future.GetResult(sender); err == nil && lvm.Response.Response.StatusCode != http.StatusNoContent { + lvm, err = client.CreateOrUpdateResponder(lvm.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesCreateOrUpdateFuture", "Result", lvm.Response.Response, "Failure responding to request") + } + } + return +} + +// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesDeleteFuture.Result. +func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesDetachDataDiskFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesDetachDataDiskFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesDetachDataDiskFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesDetachDataDiskFuture.Result. +func (future *VirtualMachinesDetachDataDiskFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesDetachDataDiskFuture", "Result", future.Response(), "Polling failure") return } if !done { ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesApplyArtifactsFuture") + err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesDetachDataDiskFuture") return } ar.Response = future.Response() return } -// VirtualMachineSchedulesExecuteFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachineSchedulesExecuteFuture struct { +// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesRedeployFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. - Result func(VirtualMachineSchedulesClient) (autorest.Response, error) + Result func(VirtualMachinesClient) (autorest.Response, error) } // UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachineSchedulesExecuteFuture) UnmarshalJSON(body []byte) error { +func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { var azFuture azure.Future if err := json.Unmarshal(body, &azFuture); err != nil { return err @@ -8372,26 +9505,26 @@ func (future *VirtualMachineSchedulesExecuteFuture) UnmarshalJSON(body []byte) e return nil } -// result is the default implementation for VirtualMachineSchedulesExecuteFuture.Result. -func (future *VirtualMachineSchedulesExecuteFuture) result(client VirtualMachineSchedulesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesRedeployFuture.Result. +func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "dtl.VirtualMachineSchedulesExecuteFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") return } if !done { ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachineSchedulesExecuteFuture") + err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesRedeployFuture") return } ar.Response = future.Response() return } -// VirtualMachinesClaimFuture an abstraction for monitoring and retrieving the results of a long-running +// VirtualMachinesResizeFuture an abstraction for monitoring and retrieving the results of a long-running // operation. -type VirtualMachinesClaimFuture struct { +type VirtualMachinesResizeFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. @@ -8399,7 +9532,7 @@ type VirtualMachinesClaimFuture struct { } // UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesClaimFuture) UnmarshalJSON(body []byte) error { +func (future *VirtualMachinesResizeFuture) UnmarshalJSON(body []byte) error { var azFuture azure.Future if err := json.Unmarshal(body, &azFuture); err != nil { return err @@ -8409,34 +9542,34 @@ func (future *VirtualMachinesClaimFuture) UnmarshalJSON(body []byte) error { return nil } -// result is the default implementation for VirtualMachinesClaimFuture.Result. -func (future *VirtualMachinesClaimFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesResizeFuture.Result. +func (future *VirtualMachinesResizeFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClaimFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesResizeFuture", "Result", future.Response(), "Polling failure") return } if !done { ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesClaimFuture") + err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesResizeFuture") return } ar.Response = future.Response() return } -// VirtualMachinesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesCreateOrUpdateFuture struct { +// VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesRestartFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. - Result func(VirtualMachinesClient) (LabVirtualMachine, error) + Result func(VirtualMachinesClient) (autorest.Response, error) } // UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { +func (future *VirtualMachinesRestartFuture) UnmarshalJSON(body []byte) error { var azFuture azure.Future if err := json.Unmarshal(body, &azFuture); err != nil { return err @@ -8446,32 +9579,26 @@ func (future *VirtualMachinesCreateOrUpdateFuture) UnmarshalJSON(body []byte) er return nil } -// result is the default implementation for VirtualMachinesCreateOrUpdateFuture.Result. -func (future *VirtualMachinesCreateOrUpdateFuture) result(client VirtualMachinesClient) (lvm LabVirtualMachine, err error) { +// result is the default implementation for VirtualMachinesRestartFuture.Result. +func (future *VirtualMachinesRestartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesRestartFuture", "Result", future.Response(), "Polling failure") return } if !done { - lvm.Response.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesCreateOrUpdateFuture") + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesRestartFuture") return } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if lvm.Response.Response, err = future.GetResult(sender); err == nil && lvm.Response.Response.StatusCode != http.StatusNoContent { - lvm, err = client.CreateOrUpdateResponder(lvm.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesCreateOrUpdateFuture", "Result", lvm.Response.Response, "Failure responding to request") - } - } + ar.Response = future.Response() return } -// VirtualMachinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running // operation. -type VirtualMachinesDeleteFuture struct { +type VirtualMachinesStartFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. @@ -8479,7 +9606,7 @@ type VirtualMachinesDeleteFuture struct { } // UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { +func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { var azFuture azure.Future if err := json.Unmarshal(body, &azFuture); err != nil { return err @@ -8489,26 +9616,26 @@ func (future *VirtualMachinesDeleteFuture) UnmarshalJSON(body []byte) error { return nil } -// result is the default implementation for VirtualMachinesDeleteFuture.Result. -func (future *VirtualMachinesDeleteFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesStartFuture.Result. +func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesDeleteFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") return } if !done { ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesDeleteFuture") + err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesStartFuture") return } ar.Response = future.Response() return } -// VirtualMachinesDetachDataDiskFuture an abstraction for monitoring and retrieving the results of a -// long-running operation. -type VirtualMachinesDetachDataDiskFuture struct { +// VirtualMachinesStopFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesStopFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. @@ -8516,7 +9643,7 @@ type VirtualMachinesDetachDataDiskFuture struct { } // UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesDetachDataDiskFuture) UnmarshalJSON(body []byte) error { +func (future *VirtualMachinesStopFuture) UnmarshalJSON(body []byte) error { var azFuture azure.Future if err := json.Unmarshal(body, &azFuture); err != nil { return err @@ -8526,26 +9653,26 @@ func (future *VirtualMachinesDetachDataDiskFuture) UnmarshalJSON(body []byte) er return nil } -// result is the default implementation for VirtualMachinesDetachDataDiskFuture.Result. -func (future *VirtualMachinesDetachDataDiskFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesStopFuture.Result. +func (future *VirtualMachinesStopFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesDetachDataDiskFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesStopFuture", "Result", future.Response(), "Polling failure") return } if !done { ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesDetachDataDiskFuture") + err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesStopFuture") return } ar.Response = future.Response() return } -// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type VirtualMachinesStartFuture struct { +// VirtualMachinesTransferDisksFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesTransferDisksFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. @@ -8553,7 +9680,7 @@ type VirtualMachinesStartFuture struct { } // UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { +func (future *VirtualMachinesTransferDisksFuture) UnmarshalJSON(body []byte) error { var azFuture azure.Future if err := json.Unmarshal(body, &azFuture); err != nil { return err @@ -8563,26 +9690,26 @@ func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { return nil } -// result is the default implementation for VirtualMachinesStartFuture.Result. -func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesTransferDisksFuture.Result. +func (future *VirtualMachinesTransferDisksFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesTransferDisksFuture", "Result", future.Response(), "Polling failure") return } if !done { ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesStartFuture") + err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesTransferDisksFuture") return } ar.Response = future.Response() return } -// VirtualMachinesStopFuture an abstraction for monitoring and retrieving the results of a long-running +// VirtualMachinesUnClaimFuture an abstraction for monitoring and retrieving the results of a long-running // operation. -type VirtualMachinesStopFuture struct { +type VirtualMachinesUnClaimFuture struct { azure.FutureAPI // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. @@ -8590,7 +9717,7 @@ type VirtualMachinesStopFuture struct { } // UnmarshalJSON is the custom unmarshaller for CreateFuture. -func (future *VirtualMachinesStopFuture) UnmarshalJSON(body []byte) error { +func (future *VirtualMachinesUnClaimFuture) UnmarshalJSON(body []byte) error { var azFuture azure.Future if err := json.Unmarshal(body, &azFuture); err != nil { return err @@ -8600,17 +9727,17 @@ func (future *VirtualMachinesStopFuture) UnmarshalJSON(body []byte) error { return nil } -// result is the default implementation for VirtualMachinesStopFuture.Result. -func (future *VirtualMachinesStopFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { +// result is the default implementation for VirtualMachinesUnClaimFuture.Result. +func (future *VirtualMachinesUnClaimFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesStopFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesUnClaimFuture", "Result", future.Response(), "Polling failure") return } if !done { ar.Response = future.Response() - err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesStopFuture") + err = azure.NewAsyncOpIncompleteError("dtl.VirtualMachinesUnClaimFuture") return } ar.Response = future.Response() @@ -8722,14 +9849,6 @@ func (vn *VirtualNetwork) UnmarshalJSON(body []byte) error { type VirtualNetworkFragment struct { // VirtualNetworkPropertiesFragment - The properties of the resource. *VirtualNetworkPropertiesFragment `json:"properties,omitempty"` - // ID - READ-ONLY; The identifier of the resource. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; The name of the resource. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The type of the resource. - Type *string `json:"type,omitempty"` - // Location - The location of the resource. - Location *string `json:"location,omitempty"` // Tags - The tags of the resource. Tags map[string]*string `json:"tags"` } @@ -8740,9 +9859,6 @@ func (vnf VirtualNetworkFragment) MarshalJSON() ([]byte, error) { if vnf.VirtualNetworkPropertiesFragment != nil { objectMap["properties"] = vnf.VirtualNetworkPropertiesFragment } - if vnf.Location != nil { - objectMap["location"] = vnf.Location - } if vnf.Tags != nil { objectMap["tags"] = vnf.Tags } @@ -8767,42 +9883,6 @@ func (vnf *VirtualNetworkFragment) UnmarshalJSON(body []byte) error { } vnf.VirtualNetworkPropertiesFragment = &virtualNetworkPropertiesFragment } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - vnf.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - vnf.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - vnf.Type = &typeVar - } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - vnf.Location = &location - } case "tags": if v != nil { var tags map[string]*string @@ -8818,6 +9898,165 @@ func (vnf *VirtualNetworkFragment) UnmarshalJSON(body []byte) error { return nil } +// VirtualNetworkList the response of a list operation. +type VirtualNetworkList struct { + autorest.Response `json:"-"` + // Value - Results of the list operation. + Value *[]VirtualNetwork `json:"value,omitempty"` + // NextLink - Link for next set of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualNetworkListIterator provides access to a complete listing of VirtualNetwork values. +type VirtualNetworkListIterator struct { + i int + page VirtualNetworkListPage +} + +// 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 *VirtualNetworkListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListIterator.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 *VirtualNetworkListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter VirtualNetworkListIterator) 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 VirtualNetworkListIterator) Response() VirtualNetworkList { + 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 VirtualNetworkListIterator) Value() VirtualNetwork { + if !iter.page.NotDone() { + return VirtualNetwork{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the VirtualNetworkListIterator type. +func NewVirtualNetworkListIterator(page VirtualNetworkListPage) VirtualNetworkListIterator { + return VirtualNetworkListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (vnl VirtualNetworkList) IsEmpty() bool { + return vnl.Value == nil || len(*vnl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (vnl VirtualNetworkList) hasNextLink() bool { + return vnl.NextLink != nil && len(*vnl.NextLink) != 0 +} + +// virtualNetworkListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (vnl VirtualNetworkList) virtualNetworkListPreparer(ctx context.Context) (*http.Request, error) { + if !vnl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(vnl.NextLink))) +} + +// VirtualNetworkListPage contains a page of VirtualNetwork values. +type VirtualNetworkListPage struct { + fn func(context.Context, VirtualNetworkList) (VirtualNetworkList, error) + vnl VirtualNetworkList +} + +// 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 *VirtualNetworkListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworkListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.vnl) + if err != nil { + return err + } + page.vnl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + 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 *VirtualNetworkListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page VirtualNetworkListPage) NotDone() bool { + return !page.vnl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page VirtualNetworkListPage) Response() VirtualNetworkList { + return page.vnl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page VirtualNetworkListPage) Values() []VirtualNetwork { + if page.vnl.IsEmpty() { + return nil + } + return *page.vnl.Value +} + +// Creates a new instance of the VirtualNetworkListPage type. +func NewVirtualNetworkListPage(cur VirtualNetworkList, getNextPage func(context.Context, VirtualNetworkList) (VirtualNetworkList, error)) VirtualNetworkListPage { + return VirtualNetworkListPage{ + fn: getNextPage, + vnl: cur, + } +} + // VirtualNetworkProperties properties of a virtual network. type VirtualNetworkProperties struct { // AllowedSubnets - The allowed subnets of the virtual network. @@ -8826,15 +10065,15 @@ type VirtualNetworkProperties struct { Description *string `json:"description,omitempty"` // ExternalProviderResourceID - The Microsoft.Network resource identifier of the virtual network. ExternalProviderResourceID *string `json:"externalProviderResourceId,omitempty"` - // ExternalSubnets - The external subnet properties. + // ExternalSubnets - READ-ONLY; The external subnet properties. ExternalSubnets *[]ExternalSubnet `json:"externalSubnets,omitempty"` // SubnetOverrides - The subnet overrides of the virtual network. SubnetOverrides *[]SubnetOverride `json:"subnetOverrides,omitempty"` // CreatedDate - READ-ONLY; The creation date of the virtual network. CreatedDate *date.Time `json:"createdDate,omitempty"` - // ProvisioningState - The provisioning status of the resource. + // ProvisioningState - READ-ONLY; The provisioning status of the resource. ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). + // UniqueIdentifier - READ-ONLY; The unique immutable identifier of a resource (Guid). UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` } @@ -8850,18 +10089,9 @@ func (vnp VirtualNetworkProperties) MarshalJSON() ([]byte, error) { if vnp.ExternalProviderResourceID != nil { objectMap["externalProviderResourceId"] = vnp.ExternalProviderResourceID } - if vnp.ExternalSubnets != nil { - objectMap["externalSubnets"] = vnp.ExternalSubnets - } if vnp.SubnetOverrides != nil { objectMap["subnetOverrides"] = vnp.SubnetOverrides } - if vnp.ProvisioningState != nil { - objectMap["provisioningState"] = vnp.ProvisioningState - } - if vnp.UniqueIdentifier != nil { - objectMap["uniqueIdentifier"] = vnp.UniqueIdentifier - } return json.Marshal(objectMap) } @@ -8873,14 +10103,8 @@ type VirtualNetworkPropertiesFragment struct { Description *string `json:"description,omitempty"` // ExternalProviderResourceID - The Microsoft.Network resource identifier of the virtual network. ExternalProviderResourceID *string `json:"externalProviderResourceId,omitempty"` - // ExternalSubnets - The external subnet properties. - ExternalSubnets *[]ExternalSubnetFragment `json:"externalSubnets,omitempty"` // SubnetOverrides - The subnet overrides of the virtual network. SubnetOverrides *[]SubnetOverrideFragment `json:"subnetOverrides,omitempty"` - // ProvisioningState - The provisioning status of the resource. - ProvisioningState *string `json:"provisioningState,omitempty"` - // UniqueIdentifier - The unique immutable identifier of a resource (Guid). - UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"` } // VirtualNetworksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a @@ -8984,3 +10208,9 @@ type WindowsOsInfo struct { // WindowsOsState - The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, SysprepApplied). Possible values include: 'NonSysprepped', 'SysprepRequested', 'SysprepApplied' WindowsOsState WindowsOsState `json:"windowsOsState,omitempty"` } + +// WindowsOsInfoFragment information about a Windows OS. +type WindowsOsInfoFragment struct { + // WindowsOsState - The state of the Windows OS (i.e. NonSysprepped, SysprepRequested, SysprepApplied). Possible values include: 'NonSysprepped', 'SysprepRequested', 'SysprepApplied' + WindowsOsState WindowsOsState `json:"windowsOsState,omitempty"` +} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/notificationchannels.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/notificationchannels.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/notificationchannels.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/notificationchannels.go index 3ce0051d60e2..59bd13573df5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/notificationchannels.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/notificationchannels.go @@ -32,11 +32,11 @@ func NewNotificationChannelsClientWithBaseURI(baseURI string, subscriptionID str return NotificationChannelsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create or replace an existing notificationChannel. +// CreateOrUpdate create or replace an existing notification channel. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. -// name - the name of the notificationChannel. +// name - the name of the notification channel. // notificationChannel - a notification. func (client NotificationChannelsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, notificationChannel NotificationChannel) (result NotificationChannel, err error) { if tracing.IsEnabled() { @@ -86,7 +86,7 @@ func (client NotificationChannelsClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -123,7 +123,7 @@ func (client NotificationChannelsClient) CreateOrUpdateResponder(resp *http.Resp // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. -// name - the name of the notificationChannel. +// name - the name of the notification channel. func (client NotificationChannelsClient) Delete(ctx context.Context, resourceGroupName string, labName string, name string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/NotificationChannelsClient.Delete") @@ -166,7 +166,7 @@ func (client NotificationChannelsClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -196,11 +196,11 @@ func (client NotificationChannelsClient) DeleteResponder(resp *http.Response) (r return } -// Get get notification channels. +// Get get notification channel. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. -// name - the name of the notificationChannel. +// name - the name of the notification channel. // expand - specify the $expand query. Example: 'properties($select=webHookUrl)' func (client NotificationChannelsClient) Get(ctx context.Context, resourceGroupName string, labName string, name string, expand string) (result NotificationChannel, err error) { if tracing.IsEnabled() { @@ -244,7 +244,7 @@ func (client NotificationChannelsClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -283,16 +283,16 @@ func (client NotificationChannelsClient) GetResponder(resp *http.Response) (resu // resourceGroupName - the name of the resource group. // labName - the name of the lab. // expand - specify the $expand query. Example: 'properties($select=webHookUrl)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client NotificationChannelsClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationNotificationChannelPage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client NotificationChannelsClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result NotificationChannelListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/NotificationChannelsClient.List") defer func() { sc := -1 - if result.rwcnc.Response.Response != nil { - sc = result.rwcnc.Response.Response.StatusCode + if result.ncl.Response.Response != nil { + sc = result.ncl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -306,17 +306,17 @@ func (client NotificationChannelsClient) List(ctx context.Context, resourceGroup resp, err := client.ListSender(req) if err != nil { - result.rwcnc.Response = autorest.Response{Response: resp} + result.ncl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.NotificationChannelsClient", "List", resp, "Failure sending request") return } - result.rwcnc, err = client.ListResponder(resp) + result.ncl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.NotificationChannelsClient", "List", resp, "Failure responding to request") return } - if result.rwcnc.hasNextLink() && result.rwcnc.IsEmpty() { + if result.ncl.hasNextLink() && result.ncl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -332,7 +332,7 @@ func (client NotificationChannelsClient) ListPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -365,7 +365,7 @@ func (client NotificationChannelsClient) ListSender(req *http.Request) (*http.Re // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client NotificationChannelsClient) ListResponder(resp *http.Response) (result ResponseWithContinuationNotificationChannel, err error) { +func (client NotificationChannelsClient) ListResponder(resp *http.Response) (result NotificationChannelList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -376,8 +376,8 @@ func (client NotificationChannelsClient) ListResponder(resp *http.Response) (res } // listNextResults retrieves the next set of results, if any. -func (client NotificationChannelsClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationNotificationChannel) (result ResponseWithContinuationNotificationChannel, err error) { - req, err := lastResults.responseWithContinuationNotificationChannelPreparer(ctx) +func (client NotificationChannelsClient) listNextResults(ctx context.Context, lastResults NotificationChannelList) (result NotificationChannelList, err error) { + req, err := lastResults.notificationChannelListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.NotificationChannelsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -397,7 +397,7 @@ func (client NotificationChannelsClient) listNextResults(ctx context.Context, la } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client NotificationChannelsClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationNotificationChannelIterator, err error) { +func (client NotificationChannelsClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result NotificationChannelListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/NotificationChannelsClient.List") defer func() { @@ -416,7 +416,7 @@ func (client NotificationChannelsClient) ListComplete(ctx context.Context, resou // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. -// name - the name of the notificationChannel. +// name - the name of the notification channel. // notifyParameters - properties for generating a Notification. func (client NotificationChannelsClient) Notify(ctx context.Context, resourceGroupName string, labName string, name string, notifyParameters NotifyParameters) (result autorest.Response, err error) { if tracing.IsEnabled() { @@ -460,7 +460,7 @@ func (client NotificationChannelsClient) NotifyPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -492,11 +492,11 @@ func (client NotificationChannelsClient) NotifyResponder(resp *http.Response) (r return } -// Update modify properties of notification channels. +// Update allows modifying tags of notification channels. All other properties will be ignored. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. -// name - the name of the notificationChannel. +// name - the name of the notification channel. // notificationChannel - a notification. func (client NotificationChannelsClient) Update(ctx context.Context, resourceGroupName string, labName string, name string, notificationChannel NotificationChannelFragment) (result NotificationChannel, err error) { if tracing.IsEnabled() { @@ -540,7 +540,7 @@ func (client NotificationChannelsClient) UpdatePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/operations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/operations.go index 3663de3800af..5ddb571a68e1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/operations.go @@ -75,7 +75,7 @@ func (client OperationsClient) GetPreparer(ctx context.Context, locationName str "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/policies.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/policies.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/policies.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/policies.go index 890dd2a23749..beffd2e1b708 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/policies.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/policies.go @@ -87,7 +87,7 @@ func (client PoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -169,7 +169,7 @@ func (client PoliciesClient) DeletePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -249,7 +249,7 @@ func (client PoliciesClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -289,16 +289,16 @@ func (client PoliciesClient) GetResponder(resp *http.Response) (result Policy, e // labName - the name of the lab. // policySetName - the name of the policy set. // expand - specify the $expand query. Example: 'properties($select=description)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client PoliciesClient) List(ctx context.Context, resourceGroupName string, labName string, policySetName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationPolicyPage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client PoliciesClient) List(ctx context.Context, resourceGroupName string, labName string, policySetName string, expand string, filter string, top *int32, orderby string) (result PolicyListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.List") defer func() { sc := -1 - if result.rwcp.Response.Response != nil { - sc = result.rwcp.Response.Response.StatusCode + if result.pl.Response.Response != nil { + sc = result.pl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -312,17 +312,17 @@ func (client PoliciesClient) List(ctx context.Context, resourceGroupName string, resp, err := client.ListSender(req) if err != nil { - result.rwcp.Response = autorest.Response{Response: resp} + result.pl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.PoliciesClient", "List", resp, "Failure sending request") return } - result.rwcp, err = client.ListResponder(resp) + result.pl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.PoliciesClient", "List", resp, "Failure responding to request") return } - if result.rwcp.hasNextLink() && result.rwcp.IsEmpty() { + if result.pl.hasNextLink() && result.pl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -339,7 +339,7 @@ func (client PoliciesClient) ListPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -372,7 +372,7 @@ func (client PoliciesClient) ListSender(req *http.Request) (*http.Response, erro // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client PoliciesClient) ListResponder(resp *http.Response) (result ResponseWithContinuationPolicy, err error) { +func (client PoliciesClient) ListResponder(resp *http.Response) (result PolicyList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -383,8 +383,8 @@ func (client PoliciesClient) ListResponder(resp *http.Response) (result Response } // listNextResults retrieves the next set of results, if any. -func (client PoliciesClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationPolicy) (result ResponseWithContinuationPolicy, err error) { - req, err := lastResults.responseWithContinuationPolicyPreparer(ctx) +func (client PoliciesClient) listNextResults(ctx context.Context, lastResults PolicyList) (result PolicyList, err error) { + req, err := lastResults.policyListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.PoliciesClient", "listNextResults", nil, "Failure preparing next results request") } @@ -404,7 +404,7 @@ func (client PoliciesClient) listNextResults(ctx context.Context, lastResults Re } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client PoliciesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, policySetName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationPolicyIterator, err error) { +func (client PoliciesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, policySetName string, expand string, filter string, top *int32, orderby string) (result PolicyListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.List") defer func() { @@ -419,7 +419,7 @@ func (client PoliciesClient) ListComplete(ctx context.Context, resourceGroupName return } -// Update modify properties of policies. +// Update allows modifying tags of policies. All other properties will be ignored. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. @@ -469,7 +469,7 @@ func (client PoliciesClient) UpdatePreparer(ctx context.Context, resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/policysets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/policysets.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/policysets.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/policysets.go index fd93791d9155..a9f43bc7ec61 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/policysets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/policysets.go @@ -78,7 +78,7 @@ func (client PolicySetsClient) EvaluatePoliciesPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/provideroperations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/provideroperations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/provideroperations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/provideroperations.go index b3923b6abb47..46355a0d1743 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/provideroperations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/provideroperations.go @@ -72,7 +72,7 @@ func (client ProviderOperationsClient) List(ctx context.Context) (result Provide // ListPreparer prepares the List request. func (client ProviderOperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/schedules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/schedules.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/schedules.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/schedules.go index f244bcbaa540..7084061f7aeb 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/schedules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/schedules.go @@ -85,7 +85,7 @@ func (client SchedulesClient) CreateOrUpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -165,7 +165,7 @@ func (client SchedulesClient) DeletePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client SchedulesClient) ExecutePreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -322,7 +322,7 @@ func (client SchedulesClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -361,16 +361,16 @@ func (client SchedulesClient) GetResponder(resp *http.Response) (result Schedule // resourceGroupName - the name of the resource group. // labName - the name of the lab. // expand - specify the $expand query. Example: 'properties($select=status)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client SchedulesClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationSchedulePage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client SchedulesClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ScheduleListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.List") defer func() { sc := -1 - if result.rwcs.Response.Response != nil { - sc = result.rwcs.Response.Response.StatusCode + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -384,17 +384,17 @@ func (client SchedulesClient) List(ctx context.Context, resourceGroupName string resp, err := client.ListSender(req) if err != nil { - result.rwcs.Response = autorest.Response{Response: resp} + result.sl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "List", resp, "Failure sending request") return } - result.rwcs, err = client.ListResponder(resp) + result.sl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "List", resp, "Failure responding to request") return } - if result.rwcs.hasNextLink() && result.rwcs.IsEmpty() { + if result.sl.hasNextLink() && result.sl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -410,7 +410,7 @@ func (client SchedulesClient) ListPreparer(ctx context.Context, resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -443,7 +443,7 @@ func (client SchedulesClient) ListSender(req *http.Request) (*http.Response, err // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client SchedulesClient) ListResponder(resp *http.Response) (result ResponseWithContinuationSchedule, err error) { +func (client SchedulesClient) ListResponder(resp *http.Response) (result ScheduleList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -454,8 +454,8 @@ func (client SchedulesClient) ListResponder(resp *http.Response) (result Respons } // listNextResults retrieves the next set of results, if any. -func (client SchedulesClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationSchedule) (result ResponseWithContinuationSchedule, err error) { - req, err := lastResults.responseWithContinuationSchedulePreparer(ctx) +func (client SchedulesClient) listNextResults(ctx context.Context, lastResults ScheduleList) (result ScheduleList, err error) { + req, err := lastResults.scheduleListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.SchedulesClient", "listNextResults", nil, "Failure preparing next results request") } @@ -475,7 +475,7 @@ func (client SchedulesClient) listNextResults(ctx context.Context, lastResults R } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SchedulesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationScheduleIterator, err error) { +func (client SchedulesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ScheduleListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.List") defer func() { @@ -495,13 +495,13 @@ func (client SchedulesClient) ListComplete(ctx context.Context, resourceGroupNam // resourceGroupName - the name of the resource group. // labName - the name of the lab. // name - the name of the schedule. -func (client SchedulesClient) ListApplicable(ctx context.Context, resourceGroupName string, labName string, name string) (result ResponseWithContinuationSchedulePage, err error) { +func (client SchedulesClient) ListApplicable(ctx context.Context, resourceGroupName string, labName string, name string) (result ScheduleListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.ListApplicable") defer func() { sc := -1 - if result.rwcs.Response.Response != nil { - sc = result.rwcs.Response.Response.StatusCode + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -515,17 +515,17 @@ func (client SchedulesClient) ListApplicable(ctx context.Context, resourceGroupN resp, err := client.ListApplicableSender(req) if err != nil { - result.rwcs.Response = autorest.Response{Response: resp} + result.sl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "ListApplicable", resp, "Failure sending request") return } - result.rwcs, err = client.ListApplicableResponder(resp) + result.sl, err = client.ListApplicableResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.SchedulesClient", "ListApplicable", resp, "Failure responding to request") return } - if result.rwcs.hasNextLink() && result.rwcs.IsEmpty() { + if result.sl.hasNextLink() && result.sl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -542,7 +542,7 @@ func (client SchedulesClient) ListApplicablePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -563,7 +563,7 @@ func (client SchedulesClient) ListApplicableSender(req *http.Request) (*http.Res // ListApplicableResponder handles the response to the ListApplicable request. The method always // closes the http.Response Body. -func (client SchedulesClient) ListApplicableResponder(resp *http.Response) (result ResponseWithContinuationSchedule, err error) { +func (client SchedulesClient) ListApplicableResponder(resp *http.Response) (result ScheduleList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -574,8 +574,8 @@ func (client SchedulesClient) ListApplicableResponder(resp *http.Response) (resu } // listApplicableNextResults retrieves the next set of results, if any. -func (client SchedulesClient) listApplicableNextResults(ctx context.Context, lastResults ResponseWithContinuationSchedule) (result ResponseWithContinuationSchedule, err error) { - req, err := lastResults.responseWithContinuationSchedulePreparer(ctx) +func (client SchedulesClient) listApplicableNextResults(ctx context.Context, lastResults ScheduleList) (result ScheduleList, err error) { + req, err := lastResults.scheduleListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.SchedulesClient", "listApplicableNextResults", nil, "Failure preparing next results request") } @@ -595,7 +595,7 @@ func (client SchedulesClient) listApplicableNextResults(ctx context.Context, las } // ListApplicableComplete enumerates all values, automatically crossing page boundaries as required. -func (client SchedulesClient) ListApplicableComplete(ctx context.Context, resourceGroupName string, labName string, name string) (result ResponseWithContinuationScheduleIterator, err error) { +func (client SchedulesClient) ListApplicableComplete(ctx context.Context, resourceGroupName string, labName string, name string) (result ScheduleListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.ListApplicable") defer func() { @@ -610,7 +610,7 @@ func (client SchedulesClient) ListApplicableComplete(ctx context.Context, resour return } -// Update modify properties of schedules. +// Update allows modifying tags of schedules. All other properties will be ignored. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. @@ -658,7 +658,7 @@ func (client SchedulesClient) UpdatePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/secrets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/secrets.go similarity index 76% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/secrets.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/secrets.go index 095f762e8110..85e3e17909e4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/secrets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/secrets.go @@ -31,20 +31,20 @@ func NewSecretsClientWithBaseURI(baseURI string, subscriptionID string) SecretsC return SecretsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create or replace an existing secret. +// CreateOrUpdate create or replace an existing secret. This operation can take a while to complete. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. // userName - the name of the user profile. // name - the name of the secret. // secret - a secret. -func (client SecretsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, name string, secret Secret) (result Secret, err error) { +func (client SecretsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, name string, secret Secret) (result SecretsCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SecretsClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -61,16 +61,9 @@ func (client SecretsClient) CreateOrUpdate(ctx context.Context, resourceGroupNam return } - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "dtl.SecretsClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) + result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "dtl.SecretsClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "dtl.SecretsClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -87,7 +80,7 @@ func (client SecretsClient) CreateOrUpdatePreparer(ctx context.Context, resource "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -104,8 +97,17 @@ func (client SecretsClient) CreateOrUpdatePreparer(ctx context.Context, resource // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client SecretsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client SecretsClient) CreateOrUpdateSender(req *http.Request) (future SecretsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -169,7 +171,7 @@ func (client SecretsClient) DeletePreparer(ctx context.Context, resourceGroupNam "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -249,7 +251,7 @@ func (client SecretsClient) GetPreparer(ctx context.Context, resourceGroupName s "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -289,16 +291,16 @@ func (client SecretsClient) GetResponder(resp *http.Response) (result Secret, er // labName - the name of the lab. // userName - the name of the user profile. // expand - specify the $expand query. Example: 'properties($select=value)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client SecretsClient) List(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationSecretPage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client SecretsClient) List(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result SecretListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SecretsClient.List") defer func() { sc := -1 - if result.rwcs.Response.Response != nil { - sc = result.rwcs.Response.Response.StatusCode + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -312,17 +314,17 @@ func (client SecretsClient) List(ctx context.Context, resourceGroupName string, resp, err := client.ListSender(req) if err != nil { - result.rwcs.Response = autorest.Response{Response: resp} + result.sl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.SecretsClient", "List", resp, "Failure sending request") return } - result.rwcs, err = client.ListResponder(resp) + result.sl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.SecretsClient", "List", resp, "Failure responding to request") return } - if result.rwcs.hasNextLink() && result.rwcs.IsEmpty() { + if result.sl.hasNextLink() && result.sl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -339,7 +341,7 @@ func (client SecretsClient) ListPreparer(ctx context.Context, resourceGroupName "userName": autorest.Encode("path", userName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -372,7 +374,7 @@ func (client SecretsClient) ListSender(req *http.Request) (*http.Response, error // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client SecretsClient) ListResponder(resp *http.Response) (result ResponseWithContinuationSecret, err error) { +func (client SecretsClient) ListResponder(resp *http.Response) (result SecretList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -383,8 +385,8 @@ func (client SecretsClient) ListResponder(resp *http.Response) (result ResponseW } // listNextResults retrieves the next set of results, if any. -func (client SecretsClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationSecret) (result ResponseWithContinuationSecret, err error) { - req, err := lastResults.responseWithContinuationSecretPreparer(ctx) +func (client SecretsClient) listNextResults(ctx context.Context, lastResults SecretList) (result SecretList, err error) { + req, err := lastResults.secretListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.SecretsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -404,7 +406,7 @@ func (client SecretsClient) listNextResults(ctx context.Context, lastResults Res } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SecretsClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationSecretIterator, err error) { +func (client SecretsClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result SecretListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SecretsClient.List") defer func() { @@ -418,3 +420,86 @@ func (client SecretsClient) ListComplete(ctx context.Context, resourceGroupName result.page, err = client.List(ctx, resourceGroupName, labName, userName, expand, filter, top, orderby) return } + +// Update allows modifying tags of secrets. All other properties will be ignored. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// name - the name of the secret. +// secret - a secret. +func (client SecretsClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, name string, secret SecretFragment) (result Secret, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecretsClient.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, labName, userName, name, secret) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.SecretsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.SecretsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.SecretsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SecretsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string, secret SecretFragment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + 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.DevTestLab/labs/{labName}/users/{userName}/secrets/{name}", pathParameters), + autorest.WithJSON(secret), + 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 SecretsClient) 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 SecretsClient) UpdateResponder(resp *http.Response) (result Secret, err error) { + err = autorest.Respond( + resp, + 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/devtestlabs/mgmt/2018-09-15/dtl/servicefabrics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/servicefabrics.go new file mode 100644 index 000000000000..5e85f872d927 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/servicefabrics.go @@ -0,0 +1,758 @@ +package dtl + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +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" +) + +// ServiceFabricsClient is the the DevTest Labs Client. +type ServiceFabricsClient struct { + BaseClient +} + +// NewServiceFabricsClient creates an instance of the ServiceFabricsClient client. +func NewServiceFabricsClient(subscriptionID string) ServiceFabricsClient { + return NewServiceFabricsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServiceFabricsClientWithBaseURI creates an instance of the ServiceFabricsClient 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 NewServiceFabricsClientWithBaseURI(baseURI string, subscriptionID string) ServiceFabricsClient { + return ServiceFabricsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or replace an existing service fabric. This operation can take a while to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// name - the name of the service fabric. +// serviceFabric - a Service Fabric. +func (client ServiceFabricsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, name string, serviceFabric ServiceFabric) (result ServiceFabricsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: serviceFabric, + Constraints: []validation.Constraint{{Target: "serviceFabric.ServiceFabricProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "serviceFabric.ServiceFabricProperties.ApplicableSchedule", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceFabric.ServiceFabricProperties.ApplicableSchedule.ApplicableScheduleProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "serviceFabric.ServiceFabricProperties.ApplicableSchedule.ApplicableScheduleProperties.LabVmsShutdown", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceFabric.ServiceFabricProperties.ApplicableSchedule.ApplicableScheduleProperties.LabVmsShutdown.ScheduleProperties", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "serviceFabric.ServiceFabricProperties.ApplicableSchedule.ApplicableScheduleProperties.LabVmsStartup", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceFabric.ServiceFabricProperties.ApplicableSchedule.ApplicableScheduleProperties.LabVmsStartup.ScheduleProperties", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("dtl.ServiceFabricsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, labName, userName, name, serviceFabric) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "CreateOrUpdate", nil, "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ServiceFabricsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string, serviceFabric ServiceFabric) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}", pathParameters), + autorest.WithJSON(serviceFabric), + 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 ServiceFabricsClient) CreateOrUpdateSender(req *http.Request) (future ServiceFabricsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ServiceFabricsClient) CreateOrUpdateResponder(resp *http.Response) (result ServiceFabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete service fabric. This operation can take a while to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// name - the name of the service fabric. +func (client ServiceFabricsClient) Delete(ctx context.Context, resourceGroupName string, labName string, userName string, name string) (result ServiceFabricsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, labName, userName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "Delete", nil, "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServiceFabricsClient) DeletePreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}", 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 ServiceFabricsClient) DeleteSender(req *http.Request) (future ServiceFabricsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ServiceFabricsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get service fabric. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// name - the name of the service fabric. +// expand - specify the $expand query. Example: 'properties($expand=applicableSchedule)' +func (client ServiceFabricsClient) Get(ctx context.Context, resourceGroupName string, labName string, userName string, name string, expand string) (result ServiceFabric, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricsClient.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, labName, userName, name, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServiceFabricsClient) GetPreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}", 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 ServiceFabricsClient) 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 ServiceFabricsClient) GetResponder(resp *http.Response) (result ServiceFabric, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list service fabrics in a given user profile. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// expand - specify the $expand query. Example: 'properties($expand=applicableSchedule)' +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client ServiceFabricsClient) List(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result ServiceFabricListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricsClient.List") + defer func() { + sc := -1 + if result.sfl.Response.Response != nil { + sc = result.sfl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, labName, userName, expand, filter, top, orderby) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sfl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "List", resp, "Failure sending request") + return + } + + result.sfl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "List", resp, "Failure responding to request") + return + } + if result.sfl.hasNextLink() && result.sfl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ServiceFabricsClient) ListPreparer(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceFabricsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ServiceFabricsClient) ListResponder(resp *http.Response) (result ServiceFabricList, err error) { + err = autorest.Respond( + resp, + 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 ServiceFabricsClient) listNextResults(ctx context.Context, lastResults ServiceFabricList) (result ServiceFabricList, err error) { + req, err := lastResults.serviceFabricListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "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, "dtl.ServiceFabricsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServiceFabricsClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, userName string, expand string, filter string, top *int32, orderby string) (result ServiceFabricListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, labName, userName, expand, filter, top, orderby) + return +} + +// ListApplicableSchedules lists the applicable start/stop schedules, if any. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// name - the name of the service fabric. +func (client ServiceFabricsClient) ListApplicableSchedules(ctx context.Context, resourceGroupName string, labName string, userName string, name string) (result ApplicableSchedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricsClient.ListApplicableSchedules") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListApplicableSchedulesPreparer(ctx, resourceGroupName, labName, userName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "ListApplicableSchedules", nil, "Failure preparing request") + return + } + + resp, err := client.ListApplicableSchedulesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "ListApplicableSchedules", resp, "Failure sending request") + return + } + + result, err = client.ListApplicableSchedulesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "ListApplicableSchedules", resp, "Failure responding to request") + return + } + + return +} + +// ListApplicableSchedulesPreparer prepares the ListApplicableSchedules request. +func (client ServiceFabricsClient) ListApplicableSchedulesPreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}/listApplicableSchedules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListApplicableSchedulesSender sends the ListApplicableSchedules request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceFabricsClient) ListApplicableSchedulesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListApplicableSchedulesResponder handles the response to the ListApplicableSchedules request. The method always +// closes the http.Response Body. +func (client ServiceFabricsClient) ListApplicableSchedulesResponder(resp *http.Response) (result ApplicableSchedule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Start start a service fabric. This operation can take a while to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// name - the name of the service fabric. +func (client ServiceFabricsClient) Start(ctx context.Context, resourceGroupName string, labName string, userName string, name string) (result ServiceFabricsStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricsClient.Start") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StartPreparer(ctx, resourceGroupName, labName, userName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "Start", nil, "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client ServiceFabricsClient) StartPreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceFabricsClient) StartSender(req *http.Request) (future ServiceFabricsStartFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client ServiceFabricsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop stop a service fabric This operation can take a while to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// name - the name of the service fabric. +func (client ServiceFabricsClient) Stop(ctx context.Context, resourceGroupName string, labName string, userName string, name string) (result ServiceFabricsStopFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricsClient.Stop") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.StopPreparer(ctx, resourceGroupName, labName, userName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "Stop", nil, "Failure preparing request") + return + } + + result, err = client.StopSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "Stop", nil, "Failure sending request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client ServiceFabricsClient) StopPreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceFabricsClient) StopSender(req *http.Request) (future ServiceFabricsStopFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client ServiceFabricsClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update allows modifying tags of service fabrics. All other properties will be ignored. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// name - the name of the service fabric. +// serviceFabric - a Service Fabric. +func (client ServiceFabricsClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, name string, serviceFabric ServiceFabricFragment) (result ServiceFabric, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricsClient.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, labName, userName, name, serviceFabric) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServiceFabricsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, labName string, userName string, name string, serviceFabric ServiceFabricFragment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{name}", pathParameters), + autorest.WithJSON(serviceFabric), + 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 ServiceFabricsClient) 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 ServiceFabricsClient) UpdateResponder(resp *http.Response) (result ServiceFabric, err error) { + err = autorest.Respond( + resp, + 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/devtestlabs/mgmt/2018-09-15/dtl/servicefabricschedules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/servicefabricschedules.go new file mode 100644 index 000000000000..a116e5dcee23 --- /dev/null +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/servicefabricschedules.go @@ -0,0 +1,597 @@ +package dtl + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +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" +) + +// ServiceFabricSchedulesClient is the the DevTest Labs Client. +type ServiceFabricSchedulesClient struct { + BaseClient +} + +// NewServiceFabricSchedulesClient creates an instance of the ServiceFabricSchedulesClient client. +func NewServiceFabricSchedulesClient(subscriptionID string) ServiceFabricSchedulesClient { + return NewServiceFabricSchedulesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServiceFabricSchedulesClientWithBaseURI creates an instance of the ServiceFabricSchedulesClient 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 NewServiceFabricSchedulesClientWithBaseURI(baseURI string, subscriptionID string) ServiceFabricSchedulesClient { + return ServiceFabricSchedulesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or replace an existing schedule. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// serviceFabricName - the name of the service fabric. +// name - the name of the schedule. +// schedule - a schedule. +func (client ServiceFabricSchedulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string, schedule Schedule) (result Schedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricSchedulesClient.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: schedule, + Constraints: []validation.Constraint{{Target: "schedule.ScheduleProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("dtl.ServiceFabricSchedulesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, labName, userName, serviceFabricName, name, schedule) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ServiceFabricSchedulesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string, schedule Schedule) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceFabricName": autorest.Encode("path", serviceFabricName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}", pathParameters), + autorest.WithJSON(schedule), + 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 ServiceFabricSchedulesClient) 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 ServiceFabricSchedulesClient) CreateOrUpdateResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete schedule. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// serviceFabricName - the name of the service fabric. +// name - the name of the schedule. +func (client ServiceFabricSchedulesClient) Delete(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricSchedulesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, labName, userName, serviceFabricName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServiceFabricSchedulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceFabricName": autorest.Encode("path", serviceFabricName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}", 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 ServiceFabricSchedulesClient) 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 ServiceFabricSchedulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Execute execute a schedule. This operation can take a while to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// serviceFabricName - the name of the service fabric. +// name - the name of the schedule. +func (client ServiceFabricSchedulesClient) Execute(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string) (result ServiceFabricSchedulesExecuteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricSchedulesClient.Execute") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ExecutePreparer(ctx, resourceGroupName, labName, userName, serviceFabricName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "Execute", nil, "Failure preparing request") + return + } + + result, err = client.ExecuteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "Execute", nil, "Failure sending request") + return + } + + return +} + +// ExecutePreparer prepares the Execute request. +func (client ServiceFabricSchedulesClient) ExecutePreparer(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceFabricName": autorest.Encode("path", serviceFabricName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}/execute", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExecuteSender sends the Execute request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceFabricSchedulesClient) ExecuteSender(req *http.Request) (future ServiceFabricSchedulesExecuteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ExecuteResponder handles the response to the Execute request. The method always +// closes the http.Response Body. +func (client ServiceFabricSchedulesClient) ExecuteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get schedule. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// serviceFabricName - the name of the service fabric. +// name - the name of the schedule. +// expand - specify the $expand query. Example: 'properties($select=status)' +func (client ServiceFabricSchedulesClient) Get(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string, expand string) (result Schedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricSchedulesClient.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, labName, userName, serviceFabricName, name, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServiceFabricSchedulesClient) GetPreparer(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceFabricName": autorest.Encode("path", serviceFabricName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}", 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 ServiceFabricSchedulesClient) 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 ServiceFabricSchedulesClient) GetResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list schedules in a given service fabric. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// serviceFabricName - the name of the service fabric. +// expand - specify the $expand query. Example: 'properties($select=status)' +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client ServiceFabricSchedulesClient) List(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, expand string, filter string, top *int32, orderby string) (result ScheduleListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricSchedulesClient.List") + defer func() { + sc := -1 + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, labName, userName, serviceFabricName, expand, filter, top, orderby) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "List", resp, "Failure sending request") + return + } + + result.sl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "List", resp, "Failure responding to request") + return + } + if result.sl.hasNextLink() && result.sl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ServiceFabricSchedulesClient) ListPreparer(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, expand string, filter string, top *int32, orderby string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceFabricName": autorest.Encode("path", serviceFabricName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + if len(orderby) > 0 { + queryParameters["$orderby"] = autorest.Encode("query", orderby) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ServiceFabricSchedulesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ServiceFabricSchedulesClient) ListResponder(resp *http.Response) (result ScheduleList, err error) { + err = autorest.Respond( + resp, + 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 ServiceFabricSchedulesClient) listNextResults(ctx context.Context, lastResults ScheduleList) (result ScheduleList, err error) { + req, err := lastResults.scheduleListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "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, "dtl.ServiceFabricSchedulesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServiceFabricSchedulesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, expand string, filter string, top *int32, orderby string) (result ScheduleListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricSchedulesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, labName, userName, serviceFabricName, expand, filter, top, orderby) + return +} + +// Update allows modifying tags of schedules. All other properties will be ignored. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// userName - the name of the user profile. +// serviceFabricName - the name of the service fabric. +// name - the name of the schedule. +// schedule - a schedule. +func (client ServiceFabricSchedulesClient) Update(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string, schedule ScheduleFragment) (result Schedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceFabricSchedulesClient.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, labName, userName, serviceFabricName, name, schedule) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.ServiceFabricSchedulesClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServiceFabricSchedulesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, labName string, userName string, serviceFabricName string, name string, schedule ScheduleFragment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serviceFabricName": autorest.Encode("path", serviceFabricName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2018-09-15" + 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.DevTestLab/labs/{labName}/users/{userName}/servicefabrics/{serviceFabricName}/schedules/{name}", pathParameters), + autorest.WithJSON(schedule), + 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 ServiceFabricSchedulesClient) 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 ServiceFabricSchedulesClient) UpdateResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + 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/devtestlabs/mgmt/2016-05-15/dtl/servicerunners.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/servicerunners.go similarity index 65% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/servicerunners.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/servicerunners.go index fdd6f638eeb7..42c5a344f7d5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/servicerunners.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/servicerunners.go @@ -30,7 +30,7 @@ func NewServiceRunnersClientWithBaseURI(baseURI string, subscriptionID string) S return ServiceRunnersClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create or replace an existing Service runner. +// CreateOrUpdate create or replace an existing service runner. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. @@ -78,7 +78,7 @@ func (client ServiceRunnersClient) CreateOrUpdatePreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -158,7 +158,7 @@ func (client ServiceRunnersClient) DeletePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client ServiceRunnersClient) GetPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -265,133 +265,3 @@ func (client ServiceRunnersClient) GetResponder(resp *http.Response) (result Ser result.Response = autorest.Response{Response: resp} return } - -// List list service runners in a given lab. -// Parameters: -// resourceGroupName - the name of the resource group. -// labName - the name of the lab. -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client ServiceRunnersClient) List(ctx context.Context, resourceGroupName string, labName string, filter string, top *int32, orderby string) (result ResponseWithContinuationServiceRunnerPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceRunnersClient.List") - defer func() { - sc := -1 - if result.rwcsr.Response.Response != nil { - sc = result.rwcsr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, labName, filter, top, orderby) - if err != nil { - err = autorest.NewErrorWithError(err, "dtl.ServiceRunnersClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.rwcsr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "dtl.ServiceRunnersClient", "List", resp, "Failure sending request") - return - } - - result.rwcsr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "dtl.ServiceRunnersClient", "List", resp, "Failure responding to request") - return - } - if result.rwcsr.hasNextLink() && result.rwcsr.IsEmpty() { - err = result.NextWithContext(ctx) - return - } - - return -} - -// ListPreparer prepares the List request. -func (client ServiceRunnersClient) ListPreparer(ctx context.Context, resourceGroupName string, labName string, filter string, top *int32, orderby string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "labName": autorest.Encode("path", labName), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), - } - - const APIVersion = "2016-05-15" - 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 len(orderby) > 0 { - queryParameters["$orderby"] = autorest.Encode("query", orderby) - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListSender sends the List request. The method will close the -// http.Response Body if it receives an error. -func (client ServiceRunnersClient) ListSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListResponder handles the response to the List request. The method always -// closes the http.Response Body. -func (client ServiceRunnersClient) ListResponder(resp *http.Response) (result ResponseWithContinuationServiceRunner, err error) { - err = autorest.Respond( - resp, - 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 ServiceRunnersClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationServiceRunner) (result ResponseWithContinuationServiceRunner, err error) { - req, err := lastResults.responseWithContinuationServiceRunnerPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "dtl.ServiceRunnersClient", "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, "dtl.ServiceRunnersClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "dtl.ServiceRunnersClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client ServiceRunnersClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, filter string, top *int32, orderby string) (result ResponseWithContinuationServiceRunnerIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ServiceRunnersClient.List") - defer func() { - sc := -1 - if result.Response().Response.Response != nil { - sc = result.page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.page, err = client.List(ctx, resourceGroupName, labName, filter, top, orderby) - return -} diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/users.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/users.go similarity index 91% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/users.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/users.go index 507df7e799c3..dd303d26148c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/users.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/users.go @@ -30,19 +30,19 @@ func NewUsersClientWithBaseURI(baseURI string, subscriptionID string) UsersClien return UsersClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create or replace an existing user profile. +// CreateOrUpdate create or replace an existing user profile. This operation can take a while to complete. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. // name - the name of the user profile. // userParameter - profile of a lab user. -func (client UsersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, userParameter User) (result User, err error) { +func (client UsersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, labName string, name string, userParameter User) (result UsersCreateOrUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.CreateOrUpdate") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -53,16 +53,9 @@ func (client UsersClient) CreateOrUpdate(ctx context.Context, resourceGroupName return } - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "dtl.UsersClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) + result, err = client.CreateOrUpdateSender(req) if err != nil { - err = autorest.NewErrorWithError(err, "dtl.UsersClient", "CreateOrUpdate", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "dtl.UsersClient", "CreateOrUpdate", nil, "Failure sending request") return } @@ -78,7 +71,7 @@ func (client UsersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -95,8 +88,17 @@ func (client UsersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // http.Response Body if it receives an error. -func (client UsersClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +func (client UsersClient) CreateOrUpdateSender(req *http.Request) (future UsersCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return } // CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always @@ -151,7 +153,7 @@ func (client UsersClient) DeletePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -238,7 +240,7 @@ func (client UsersClient) GetPreparer(ctx context.Context, resourceGroupName str "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -277,16 +279,16 @@ func (client UsersClient) GetResponder(resp *http.Response) (result User, err er // resourceGroupName - the name of the resource group. // labName - the name of the lab. // expand - specify the $expand query. Example: 'properties($select=identity)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client UsersClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationUserPage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client UsersClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result UserListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.List") defer func() { sc := -1 - if result.rwcu.Response.Response != nil { - sc = result.rwcu.Response.Response.StatusCode + if result.ul.Response.Response != nil { + sc = result.ul.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -300,17 +302,17 @@ func (client UsersClient) List(ctx context.Context, resourceGroupName string, la resp, err := client.ListSender(req) if err != nil { - result.rwcu.Response = autorest.Response{Response: resp} + result.ul.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.UsersClient", "List", resp, "Failure sending request") return } - result.rwcu, err = client.ListResponder(resp) + result.ul, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.UsersClient", "List", resp, "Failure responding to request") return } - if result.rwcu.hasNextLink() && result.rwcu.IsEmpty() { + if result.ul.hasNextLink() && result.ul.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -326,7 +328,7 @@ func (client UsersClient) ListPreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -359,7 +361,7 @@ func (client UsersClient) ListSender(req *http.Request) (*http.Response, error) // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client UsersClient) ListResponder(resp *http.Response) (result ResponseWithContinuationUser, err error) { +func (client UsersClient) ListResponder(resp *http.Response) (result UserList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -370,8 +372,8 @@ func (client UsersClient) ListResponder(resp *http.Response) (result ResponseWit } // listNextResults retrieves the next set of results, if any. -func (client UsersClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationUser) (result ResponseWithContinuationUser, err error) { - req, err := lastResults.responseWithContinuationUserPreparer(ctx) +func (client UsersClient) listNextResults(ctx context.Context, lastResults UserList) (result UserList, err error) { + req, err := lastResults.userListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.UsersClient", "listNextResults", nil, "Failure preparing next results request") } @@ -391,7 +393,7 @@ func (client UsersClient) listNextResults(ctx context.Context, lastResults Respo } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client UsersClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationUserIterator, err error) { +func (client UsersClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result UserListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.List") defer func() { @@ -406,7 +408,7 @@ func (client UsersClient) ListComplete(ctx context.Context, resourceGroupName st return } -// Update modify properties of user profiles. +// Update allows modifying tags of user profiles. All other properties will be ignored. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. @@ -454,7 +456,7 @@ func (client UsersClient) UpdatePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/version.go similarity index 90% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/version.go index dcb4088a8970..a5acdc3a3439 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/version.go @@ -10,7 +10,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() + " dtl/2016-05-15" + return "Azure-SDK-For-Go/" + Version() + " dtl/2018-09-15" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/virtualmachines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/virtualmachines.go similarity index 67% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/virtualmachines.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/virtualmachines.go index 4002568c8a9b..4e8bc23d5116 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/virtualmachines.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/virtualmachines.go @@ -72,7 +72,7 @@ func (client VirtualMachinesClient) AddDataDiskPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -154,7 +154,7 @@ func (client VirtualMachinesClient) ApplyArtifactsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -235,7 +235,7 @@ func (client VirtualMachinesClient) ClaimPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -274,7 +274,7 @@ func (client VirtualMachinesClient) ClaimResponder(resp *http.Response) (result return } -// CreateOrUpdate create or replace an existing Virtual machine. This operation can take a while to complete. +// CreateOrUpdate create or replace an existing virtual machine. This operation can take a while to complete. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. @@ -330,7 +330,7 @@ func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -412,7 +412,7 @@ func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -492,7 +492,7 @@ func (client VirtualMachinesClient) DetachDataDiskPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -582,7 +582,7 @@ func (client VirtualMachinesClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -616,22 +616,100 @@ func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result La return } +// GetRdpFileContents gets a string that represents the contents of the RDP file for the virtual machine +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// name - the name of the virtual machine. +func (client VirtualMachinesClient) GetRdpFileContents(ctx context.Context, resourceGroupName string, labName string, name string) (result RdpConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.GetRdpFileContents") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetRdpFileContentsPreparer(ctx, resourceGroupName, labName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "GetRdpFileContents", nil, "Failure preparing request") + return + } + + resp, err := client.GetRdpFileContentsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "GetRdpFileContents", resp, "Failure sending request") + return + } + + result, err = client.GetRdpFileContentsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "GetRdpFileContents", resp, "Failure responding to request") + return + } + + return +} + +// GetRdpFileContentsPreparer prepares the GetRdpFileContents request. +func (client VirtualMachinesClient) GetRdpFileContentsPreparer(ctx context.Context, resourceGroupName string, labName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/getRdpFileContents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRdpFileContentsSender sends the GetRdpFileContents request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) GetRdpFileContentsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetRdpFileContentsResponder handles the response to the GetRdpFileContents request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) GetRdpFileContentsResponder(resp *http.Response) (result RdpConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List list virtual machines in a given lab. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. // expand - specify the $expand query. Example: // 'properties($expand=artifacts,computeVm,networkInterface,applicableSchedule)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client VirtualMachinesClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationLabVirtualMachinePage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client VirtualMachinesClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result LabVirtualMachineListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List") defer func() { sc := -1 - if result.rwclvm.Response.Response != nil { - sc = result.rwclvm.Response.Response.StatusCode + if result.lvml.Response.Response != nil { + sc = result.lvml.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -645,17 +723,17 @@ func (client VirtualMachinesClient) List(ctx context.Context, resourceGroupName resp, err := client.ListSender(req) if err != nil { - result.rwclvm.Response = autorest.Response{Response: resp} + result.lvml.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "List", resp, "Failure sending request") return } - result.rwclvm, err = client.ListResponder(resp) + result.lvml, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "List", resp, "Failure responding to request") return } - if result.rwclvm.hasNextLink() && result.rwclvm.IsEmpty() { + if result.lvml.hasNextLink() && result.lvml.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -671,7 +749,7 @@ func (client VirtualMachinesClient) ListPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -704,7 +782,7 @@ func (client VirtualMachinesClient) ListSender(req *http.Request) (*http.Respons // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result ResponseWithContinuationLabVirtualMachine, err error) { +func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result LabVirtualMachineList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -715,8 +793,8 @@ func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result R } // listNextResults retrieves the next set of results, if any. -func (client VirtualMachinesClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationLabVirtualMachine) (result ResponseWithContinuationLabVirtualMachine, err error) { - req, err := lastResults.responseWithContinuationLabVirtualMachinePreparer(ctx) +func (client VirtualMachinesClient) listNextResults(ctx context.Context, lastResults LabVirtualMachineList) (result LabVirtualMachineList, err error) { + req, err := lastResults.labVirtualMachineListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "listNextResults", nil, "Failure preparing next results request") } @@ -736,7 +814,7 @@ func (client VirtualMachinesClient) listNextResults(ctx context.Context, lastRes } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachinesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationLabVirtualMachineIterator, err error) { +func (client VirtualMachinesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result LabVirtualMachineListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.List") defer func() { @@ -751,7 +829,7 @@ func (client VirtualMachinesClient) ListComplete(ctx context.Context, resourceGr return } -// ListApplicableSchedules lists all applicable schedules +// ListApplicableSchedules lists the applicable start/stop schedules, if any. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. @@ -798,7 +876,7 @@ func (client VirtualMachinesClient) ListApplicableSchedulesPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -829,6 +907,246 @@ func (client VirtualMachinesClient) ListApplicableSchedulesResponder(resp *http. return } +// Redeploy redeploy a virtual machine This operation can take a while to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// name - the name of the virtual machine. +func (client VirtualMachinesClient) Redeploy(ctx context.Context, resourceGroupName string, labName string, name string) (result VirtualMachinesRedeployFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Redeploy") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RedeployPreparer(ctx, resourceGroupName, labName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "Redeploy", nil, "Failure preparing request") + return + } + + result, err = client.RedeploySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "Redeploy", nil, "Failure sending request") + return + } + + return +} + +// RedeployPreparer prepares the Redeploy request. +func (client VirtualMachinesClient) RedeployPreparer(ctx context.Context, resourceGroupName string, labName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/redeploy", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RedeploySender sends the Redeploy request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future VirtualMachinesRedeployFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RedeployResponder handles the response to the Redeploy request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Resize resize Virtual Machine. This operation can take a while to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// name - the name of the virtual machine. +// resizeLabVirtualMachineProperties - request body for resizing a virtual machine. +func (client VirtualMachinesClient) Resize(ctx context.Context, resourceGroupName string, labName string, name string, resizeLabVirtualMachineProperties ResizeLabVirtualMachineProperties) (result VirtualMachinesResizeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Resize") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResizePreparer(ctx, resourceGroupName, labName, name, resizeLabVirtualMachineProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "Resize", nil, "Failure preparing request") + return + } + + result, err = client.ResizeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "Resize", nil, "Failure sending request") + return + } + + return +} + +// ResizePreparer prepares the Resize request. +func (client VirtualMachinesClient) ResizePreparer(ctx context.Context, resourceGroupName string, labName string, name string, resizeLabVirtualMachineProperties ResizeLabVirtualMachineProperties) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-09-15" + 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.DevTestLab/labs/{labName}/virtualmachines/{name}/resize", pathParameters), + autorest.WithJSON(resizeLabVirtualMachineProperties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResizeSender sends the Resize request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ResizeSender(req *http.Request) (future VirtualMachinesResizeFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResizeResponder handles the response to the Resize request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ResizeResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Restart restart a virtual machine. This operation can take a while to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// name - the name of the virtual machine. +func (client VirtualMachinesClient) Restart(ctx context.Context, resourceGroupName string, labName string, name string) (result VirtualMachinesRestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Restart") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, resourceGroupName, labName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "Restart", nil, "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client VirtualMachinesClient) RestartPreparer(ctx context.Context, resourceGroupName string, labName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) RestartSender(req *http.Request) (future VirtualMachinesRestartFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + // Start start a virtual machine. This operation can take a while to complete. // Parameters: // resourceGroupName - the name of the resource group. @@ -869,7 +1187,7 @@ func (client VirtualMachinesClient) StartPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -948,7 +1266,7 @@ func (client VirtualMachinesClient) StopPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -987,7 +1305,166 @@ func (client VirtualMachinesClient) StopResponder(resp *http.Response) (result a return } -// Update modify properties of virtual machines. +// TransferDisks transfers all data disks attached to the virtual machine to be owned by the current user. This +// operation can take a while to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// name - the name of the virtual machine. +func (client VirtualMachinesClient) TransferDisks(ctx context.Context, resourceGroupName string, labName string, name string) (result VirtualMachinesTransferDisksFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.TransferDisks") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.TransferDisksPreparer(ctx, resourceGroupName, labName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "TransferDisks", nil, "Failure preparing request") + return + } + + result, err = client.TransferDisksSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "TransferDisks", nil, "Failure sending request") + return + } + + return +} + +// TransferDisksPreparer prepares the TransferDisks request. +func (client VirtualMachinesClient) TransferDisksPreparer(ctx context.Context, resourceGroupName string, labName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/transferDisks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TransferDisksSender sends the TransferDisks request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) TransferDisksSender(req *http.Request) (future VirtualMachinesTransferDisksFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TransferDisksResponder handles the response to the TransferDisks request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) TransferDisksResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// UnClaim release ownership of an existing virtual machine This operation can take a while to complete. +// Parameters: +// resourceGroupName - the name of the resource group. +// labName - the name of the lab. +// name - the name of the virtual machine. +func (client VirtualMachinesClient) UnClaim(ctx context.Context, resourceGroupName string, labName string, name string) (result VirtualMachinesUnClaimFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.UnClaim") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UnClaimPreparer(ctx, resourceGroupName, labName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "UnClaim", nil, "Failure preparing request") + return + } + + result, err = client.UnClaimSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "dtl.VirtualMachinesClient", "UnClaim", nil, "Failure sending request") + return + } + + return +} + +// UnClaimPreparer prepares the UnClaim request. +func (client VirtualMachinesClient) UnClaimPreparer(ctx context.Context, resourceGroupName string, labName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-09-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}/unClaim", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UnClaimSender sends the UnClaim request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) UnClaimSender(req *http.Request) (future VirtualMachinesUnClaimFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UnClaimResponder handles the response to the UnClaim request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) UnClaimResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update allows modifying tags of virtual machines. All other properties will be ignored. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. @@ -1035,7 +1512,7 @@ func (client VirtualMachinesClient) UpdatePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/virtualmachineschedules.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/virtualmachineschedules.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/virtualmachineschedules.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/virtualmachineschedules.go index 9d3f290286be..7160d6d106a4 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/virtualmachineschedules.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/virtualmachineschedules.go @@ -88,7 +88,7 @@ func (client VirtualMachineSchedulesClient) CreateOrUpdatePreparer(ctx context.C "virtualMachineName": autorest.Encode("path", virtualMachineName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -170,7 +170,7 @@ func (client VirtualMachineSchedulesClient) DeletePreparer(ctx context.Context, "virtualMachineName": autorest.Encode("path", virtualMachineName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -242,7 +242,7 @@ func (client VirtualMachineSchedulesClient) ExecutePreparer(ctx context.Context, "virtualMachineName": autorest.Encode("path", virtualMachineName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -331,7 +331,7 @@ func (client VirtualMachineSchedulesClient) GetPreparer(ctx context.Context, res "virtualMachineName": autorest.Encode("path", virtualMachineName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -371,16 +371,16 @@ func (client VirtualMachineSchedulesClient) GetResponder(resp *http.Response) (r // labName - the name of the lab. // virtualMachineName - the name of the virtual machine. // expand - specify the $expand query. Example: 'properties($select=status)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client VirtualMachineSchedulesClient) List(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationSchedulePage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client VirtualMachineSchedulesClient) List(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, expand string, filter string, top *int32, orderby string) (result ScheduleListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineSchedulesClient.List") defer func() { sc := -1 - if result.rwcs.Response.Response != nil { - sc = result.rwcs.Response.Response.StatusCode + if result.sl.Response.Response != nil { + sc = result.sl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -394,17 +394,17 @@ func (client VirtualMachineSchedulesClient) List(ctx context.Context, resourceGr resp, err := client.ListSender(req) if err != nil { - result.rwcs.Response = autorest.Response{Response: resp} + result.sl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.VirtualMachineSchedulesClient", "List", resp, "Failure sending request") return } - result.rwcs, err = client.ListResponder(resp) + result.sl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.VirtualMachineSchedulesClient", "List", resp, "Failure responding to request") return } - if result.rwcs.hasNextLink() && result.rwcs.IsEmpty() { + if result.sl.hasNextLink() && result.sl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -421,7 +421,7 @@ func (client VirtualMachineSchedulesClient) ListPreparer(ctx context.Context, re "virtualMachineName": autorest.Encode("path", virtualMachineName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -454,7 +454,7 @@ func (client VirtualMachineSchedulesClient) ListSender(req *http.Request) (*http // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client VirtualMachineSchedulesClient) ListResponder(resp *http.Response) (result ResponseWithContinuationSchedule, err error) { +func (client VirtualMachineSchedulesClient) ListResponder(resp *http.Response) (result ScheduleList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -465,8 +465,8 @@ func (client VirtualMachineSchedulesClient) ListResponder(resp *http.Response) ( } // listNextResults retrieves the next set of results, if any. -func (client VirtualMachineSchedulesClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationSchedule) (result ResponseWithContinuationSchedule, err error) { - req, err := lastResults.responseWithContinuationSchedulePreparer(ctx) +func (client VirtualMachineSchedulesClient) listNextResults(ctx context.Context, lastResults ScheduleList) (result ScheduleList, err error) { + req, err := lastResults.scheduleListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.VirtualMachineSchedulesClient", "listNextResults", nil, "Failure preparing next results request") } @@ -486,7 +486,7 @@ func (client VirtualMachineSchedulesClient) listNextResults(ctx context.Context, } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualMachineSchedulesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationScheduleIterator, err error) { +func (client VirtualMachineSchedulesClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string, expand string, filter string, top *int32, orderby string) (result ScheduleListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineSchedulesClient.List") defer func() { @@ -501,7 +501,7 @@ func (client VirtualMachineSchedulesClient) ListComplete(ctx context.Context, re return } -// Update modify properties of schedules. +// Update allows modifying tags of schedules. All other properties will be ignored. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. @@ -551,7 +551,7 @@ func (client VirtualMachineSchedulesClient) UpdatePreparer(ctx context.Context, "virtualMachineName": autorest.Encode("path", virtualMachineName), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/virtualnetworks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/virtualnetworks.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/virtualnetworks.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/virtualnetworks.go index be48a4313b56..0ad6594f8d06 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2016-05-15/dtl/virtualnetworks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/devtestlabs/mgmt/2018-09-15/dtl/virtualnetworks.go @@ -71,7 +71,7 @@ func (client VirtualNetworksClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -153,7 +153,7 @@ func (client VirtualNetworksClient) DeletePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -240,7 +240,7 @@ func (client VirtualNetworksClient) GetPreparer(ctx context.Context, resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -279,16 +279,16 @@ func (client VirtualNetworksClient) GetResponder(resp *http.Response) (result Vi // resourceGroupName - the name of the resource group. // labName - the name of the lab. // expand - specify the $expand query. Example: 'properties($expand=externalSubnets)' -// filter - the filter to apply to the operation. -// top - the maximum number of resources to return from the operation. -// orderby - the ordering expression for the results, using OData notation. -func (client VirtualNetworksClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationVirtualNetworkPage, err error) { +// filter - the filter to apply to the operation. Example: '$filter=contains(name,'myName') +// top - the maximum number of resources to return from the operation. Example: '$top=10' +// orderby - the ordering expression for the results, using OData notation. Example: '$orderby=name desc' +func (client VirtualNetworksClient) List(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result VirtualNetworkListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.List") defer func() { sc := -1 - if result.rwcvn.Response.Response != nil { - sc = result.rwcvn.Response.Response.StatusCode + if result.vnl.Response.Response != nil { + sc = result.vnl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -302,17 +302,17 @@ func (client VirtualNetworksClient) List(ctx context.Context, resourceGroupName resp, err := client.ListSender(req) if err != nil { - result.rwcvn.Response = autorest.Response{Response: resp} + result.vnl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "dtl.VirtualNetworksClient", "List", resp, "Failure sending request") return } - result.rwcvn, err = client.ListResponder(resp) + result.vnl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "dtl.VirtualNetworksClient", "List", resp, "Failure responding to request") return } - if result.rwcvn.hasNextLink() && result.rwcvn.IsEmpty() { + if result.vnl.hasNextLink() && result.vnl.IsEmpty() { err = result.NextWithContext(ctx) return } @@ -328,7 +328,7 @@ func (client VirtualNetworksClient) ListPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -361,7 +361,7 @@ func (client VirtualNetworksClient) ListSender(req *http.Request) (*http.Respons // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client VirtualNetworksClient) ListResponder(resp *http.Response) (result ResponseWithContinuationVirtualNetwork, err error) { +func (client VirtualNetworksClient) ListResponder(resp *http.Response) (result VirtualNetworkList, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), @@ -372,8 +372,8 @@ func (client VirtualNetworksClient) ListResponder(resp *http.Response) (result R } // listNextResults retrieves the next set of results, if any. -func (client VirtualNetworksClient) listNextResults(ctx context.Context, lastResults ResponseWithContinuationVirtualNetwork) (result ResponseWithContinuationVirtualNetwork, err error) { - req, err := lastResults.responseWithContinuationVirtualNetworkPreparer(ctx) +func (client VirtualNetworksClient) listNextResults(ctx context.Context, lastResults VirtualNetworkList) (result VirtualNetworkList, err error) { + req, err := lastResults.virtualNetworkListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "dtl.VirtualNetworksClient", "listNextResults", nil, "Failure preparing next results request") } @@ -393,7 +393,7 @@ func (client VirtualNetworksClient) listNextResults(ctx context.Context, lastRes } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client VirtualNetworksClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result ResponseWithContinuationVirtualNetworkIterator, err error) { +func (client VirtualNetworksClient) ListComplete(ctx context.Context, resourceGroupName string, labName string, expand string, filter string, top *int32, orderby string) (result VirtualNetworkListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/VirtualNetworksClient.List") defer func() { @@ -408,7 +408,7 @@ func (client VirtualNetworksClient) ListComplete(ctx context.Context, resourceGr return } -// Update modify properties of virtual networks. +// Update allows modifying tags of virtual networks. All other properties will be ignored. // Parameters: // resourceGroupName - the name of the resource group. // labName - the name of the lab. @@ -456,7 +456,7 @@ func (client VirtualNetworksClient) UpdatePreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-05-15" + const APIVersion = "2018-09-15" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/modules.txt b/vendor/modules.txt index f031c66c0452..39fbc6ccf4c4 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -39,7 +39,7 @@ github.com/Azure/azure-sdk-for-go/services/datalake/store/mgmt/2016-11-01/accoun 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/devtestlabs/mgmt/2018-09-15/dtl github.com/Azure/azure-sdk-for-go/services/digitaltwins/mgmt/2020-10-31/digitaltwins github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2018-05-01/dns github.com/Azure/azure-sdk-for-go/services/domainservices/mgmt/2020-01-01/aad diff --git a/website/docs/r/dev_test_global_vm_shutdown_schedule.html.markdown b/website/docs/r/dev_test_global_vm_shutdown_schedule.html.markdown index dacdee081093..31d94d4ddf18 100644 --- a/website/docs/r/dev_test_global_vm_shutdown_schedule.html.markdown +++ b/website/docs/r/dev_test_global_vm_shutdown_schedule.html.markdown @@ -109,6 +109,8 @@ A `notification_settings` - (Required) - block supports the following: * `enabled` - (Optional) Whether to enable pre-shutdown notifications. Possible values are `true` and `false`. Defaults to `false` +* `email` - (Optional) E-mail address to which the notification will be sent. + * `time_in_minutes` - (Optional) Time in minutes between 15 and 120 before a shutdown event at which a notification will be sent. Defaults to `30`. * `webhook_url` - The webhook URL to which the notification will be sent. Required if `enabled` is `true`. Optional otherwise.