From e288264845ce3ba643d9f521a1600ce292e8bd14 Mon Sep 17 00:00:00 2001 From: Matthew Christopher Date: Tue, 21 Feb 2017 23:45:51 -0800 Subject: [PATCH] Version 4.0.0 for Azure.Batch management (#2836) * Regenerate management for Batch * Regenerate Batch management with latest spec * C# Batch management versioning and changelog * Tests for new Batch management plane operations --- .../InMemoryTests/AccountTests.InMemory.cs | 4 +- .../AccountTests.ScenarioTests.cs | 79 + .../BatchAccountCanCreateWithBYOSEnabled.json | 740 +++++++++ .../BatchAccountEndToEndAsync.json | 304 ++-- .../GetLocationQuotasAsync.json | 42 +- src/ResourceManagement/Batch/Batch.sln | 18 + .../Generated/ApplicationOperations.cs | 576 +++---- .../ApplicationOperationsExtensions.cs | 55 +- .../Generated/ApplicationPackageOperations.cs | 424 ++--- .../ApplicationPackageOperationsExtensions.cs | 43 +- .../Generated/BatchAccountOperations.cs | 1372 +++++++++-------- .../BatchAccountOperationsExtensions.cs | 297 ++-- .../Generated/BatchManagementClient.cs | 103 +- .../Generated/IApplicationOperations.cs | 32 +- .../IApplicationPackageOperations.cs | 28 +- .../Generated/IBatchAccountOperations.cs | 176 ++- .../Generated/IBatchManagementClient.cs | 20 +- .../Generated/ILocationOperations.cs | 18 +- .../Generated/LocationOperations.cs | 105 +- .../Generated/LocationOperationsExtensions.cs | 15 +- .../Generated/Models/AccountKeyType.cs | 16 +- .../ActivateApplicationPackageParameters.cs | 14 +- .../Models/AddApplicationParameters.cs | 11 +- .../Generated/Models/Application.cs | 23 +- .../Generated/Models/ApplicationPackage.cs | 58 +- .../Models/AutoStorageBaseProperties.cs | 18 +- .../Generated/Models/AutoStorageProperties.cs | 20 +- .../Generated/Models/BatchAccount.cs | 105 +- .../Models/BatchAccountCreateHeaders.cs | 58 + .../Models/BatchAccountCreateParameters.cs | 63 +- .../Models/BatchAccountDeleteHeaders.cs | 58 + .../Generated/Models/BatchAccountKeys.cs | 19 +- .../BatchAccountRegenerateKeyParameters.cs | 15 +- .../Models/BatchAccountUpdateParameters.cs | 59 +- .../Generated/Models/BatchLocationQuota.cs | 19 +- .../Generated/Models/KeyVaultReference.cs | 74 + .../Generated/Models/PackageState.cs | 18 +- .../Generated/Models/Page.cs | 29 +- .../Generated/Models/PoolAllocationMode.cs | 31 + .../Generated/Models/ProvisioningState.cs | 24 +- .../Generated/Models/Resource.cs | 43 +- .../Models/UpdateApplicationParameters.cs | 13 +- .../Properties/AssemblyInfo.cs | 4 +- .../project.json | 8 +- .../Batch/RegenerateBatch.cmd | 2 +- src/ResourceManagement/Batch/changelog.md | 5 + 46 files changed, 3412 insertions(+), 1846 deletions(-) create mode 100644 src/ResourceManagement/Batch/Batch.Tests/SessionRecords/Batch.Tests.ScenarioTests.AccountTests/BatchAccountCanCreateWithBYOSEnabled.json create mode 100644 src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountCreateHeaders.cs create mode 100644 src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountDeleteHeaders.cs create mode 100644 src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/KeyVaultReference.cs create mode 100644 src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/PoolAllocationMode.cs diff --git a/src/ResourceManagement/Batch/Batch.Tests/InMemoryTests/AccountTests.InMemory.cs b/src/ResourceManagement/Batch/Batch.Tests/InMemoryTests/AccountTests.InMemory.cs index 06cf0d38ac9d1..947046ac23788 100644 --- a/src/ResourceManagement/Batch/Batch.Tests/InMemoryTests/AccountTests.InMemory.cs +++ b/src/ResourceManagement/Batch/Batch.Tests/InMemoryTests/AccountTests.InMemory.cs @@ -357,9 +357,9 @@ public void AccountDeleteNotFoundValidateMessage() } [Fact] - public void AccountDeleteNoContentValidateMessage() + public void AccountDeleteOkValidateMessage() { - var noContentResponse = new HttpResponseMessage(HttpStatusCode.NoContent) + var noContentResponse = new HttpResponseMessage(HttpStatusCode.OK) { Content = new StringContent(@"") }; diff --git a/src/ResourceManagement/Batch/Batch.Tests/ScenarioTests/AccountTests.ScenarioTests.cs b/src/ResourceManagement/Batch/Batch.Tests/ScenarioTests/AccountTests.ScenarioTests.cs index 75a83fa5cc094..581a4eab6602e 100644 --- a/src/ResourceManagement/Batch/Batch.Tests/ScenarioTests/AccountTests.ScenarioTests.cs +++ b/src/ResourceManagement/Batch/Batch.Tests/ScenarioTests/AccountTests.ScenarioTests.cs @@ -92,5 +92,84 @@ public async Task BatchAccountEndToEndAsync() } } } + + [Fact] + public async Task BatchAccountCanCreateWithBYOSEnabled() + { + using (MockContext context = StartMockContextAndInitializeClients(this.GetType().FullName)) + { + string resourceGroupName = TestUtilities.GenerateName(); + string batchAccountName = TestUtilities.GenerateName(); + string keyvaultName = TestUtilities.GenerateName(); + ResourceGroup group = new ResourceGroup(this.Location); + await this.ResourceManagementClient.ResourceGroups.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, group); + + try + { + //Register with keyvault just in case we haven't already + await this.ResourceManagementClient.Providers.RegisterWithHttpMessagesAsync("Microsoft.KeyVault"); + + var result = await this.ResourceManagementClient.Resources.CreateOrUpdateWithHttpMessagesAsync( + resourceGroupName, + "Microsoft.KeyVault", + "", + "vaults", + keyvaultName, + "2015-06-01", + new GenericResource(this.Location) + { + Properties = new Dictionary + { + {"tenantId", "72f988bf-86f1-41af-91ab-2d7cd011db47"}, + {"sku", new Dictionary{{"family", "A"}, {"name", "standard"}}}, + {"accessPolicies", new [] + { + new Dictionary + { + {"objectId", "f520d84c-3fd3-4cc8-88d4-2ed25b00d27a"}, + {"tenantId", "72f988bf-86f1-41af-91ab-2d7cd011db47"}, + {"permissions", new Dictionary + { + {"secrets", new [] { "All" }}, + {"keys", new [] { "All" }}, + } + } + } + } + }, + {"enabledForDeployment", true}, + {"enabledForTemplateDeployment", true}, + {"enabledForDiskEncryption", true} + } + }); + + var keyVaultReferenceId = + $"/subscriptions/{this.BatchManagementClient.SubscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{keyvaultName}"; + var keyVaultReferenceUrl = ((Newtonsoft.Json.Linq.JObject)result.Body.Properties)["vaultUri"] + "/"; + // Create an account + BatchAccountCreateParameters createParams = new BatchAccountCreateParameters( + this.Location, + poolAllocationMode: PoolAllocationMode.UserSubscription, + keyVaultReference: new KeyVaultReference( + keyVaultReferenceId, + keyVaultReferenceUrl)); + + await this.BatchManagementClient.BatchAccount.CreateAsync(resourceGroupName, batchAccountName, createParams); + + // Get the account and verify some properties + BatchAccount batchAccount = await this.BatchManagementClient.BatchAccount.GetAsync(resourceGroupName, batchAccountName); + Assert.Equal(batchAccountName, batchAccount.Name); + Assert.True(batchAccount.CoreQuota > 0); + Assert.Equal(PoolAllocationMode.UserSubscription, batchAccount.PoolAllocationMode); + Assert.Equal(keyVaultReferenceId, batchAccount.KeyVaultReference.Id); + Assert.Equal(keyVaultReferenceUrl, batchAccount.KeyVaultReference.Url); + } + finally + { + await this.ResourceManagementClient.ResourceGroups.DeleteWithHttpMessagesAsync(resourceGroupName); + } + } + } + } } diff --git a/src/ResourceManagement/Batch/Batch.Tests/SessionRecords/Batch.Tests.ScenarioTests.AccountTests/BatchAccountCanCreateWithBYOSEnabled.json b/src/ResourceManagement/Batch/Batch.Tests/SessionRecords/Batch.Tests.ScenarioTests.AccountTests/BatchAccountCanCreateWithBYOSEnabled.json new file mode 100644 index 0000000000000..05148dcaa367e --- /dev/null +++ b/src/ResourceManagement/Batch/Batch.Tests/SessionRecords/Batch.Tests.ScenarioTests.AccountTests/BatchAccountCanCreateWithBYOSEnabled.json @@ -0,0 +1,740 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/providers/Microsoft.Batch?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2g/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "cc6fac18-1140-467e-85c6-5a4dcafe6af3" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/providers/Microsoft.Batch\",\r\n \"namespace\": \"Microsoft.Batch\",\r\n \"authorization\": {\r\n \"applicationId\": \"ddbf3205-c6bd-46ae-8127-60eb93363864\",\r\n \"roleDefinitionId\": \"b7f84953-1d03-4eab-9ea4-45f065258ff8\"\r\n },\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"batchAccounts\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2017-01-01\",\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"operations\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2017-01-01\",\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2017-01-01\",\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/quotas\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2017-01-01\",\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 17 Feb 2017 21:36:04 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14998" + ], + "x-ms-request-id": [ + "8a108a34-d0e2-48d9-8889-25f8685f907c" + ], + "x-ms-correlation-request-id": [ + "8a108a34-d0e2-48d9-8889-25f8685f907c" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20170217T213604Z:8a108a34-d0e2-48d9-8889-25f8685f907c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourcegroups/azsmnet5574?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlZ3JvdXBzL2F6c21uZXQ1NTc0P2FwaS12ZXJzaW9uPTIwMTYtMDItMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"West Europe\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "33" + ], + "x-ms-client-request-id": [ + "05ab6b20-6dc4-4661-97ef-7b09da92e796" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet5574\",\r\n \"name\": \"azsmnet5574\",\r\n \"location\": \"westeurope\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "179" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 17 Feb 2017 21:36:07 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "0212a2a7-f4de-4da9-aa65-c1daf1172af1" + ], + "x-ms-correlation-request-id": [ + "0212a2a7-f4de-4da9-aa65-c1daf1172af1" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20170217T213607Z:0212a2a7-f4de-4da9-aa65-c1daf1172af1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/providers/Microsoft.KeyVault/register?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Byb3ZpZGVycy9NaWNyb3NvZnQuS2V5VmF1bHQvcmVnaXN0ZXI/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "32f92df6-fc0d-4396-819b-b8072be415e1" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/providers/Microsoft.KeyVault\",\r\n \"namespace\": \"Microsoft.KeyVault\",\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"vaults\",\r\n \"locations\": [\r\n \"North Central US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"East US 2\",\r\n \"Central US\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Brazil South\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"Korea Central\",\r\n \"Korea South\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-10-01\",\r\n \"2015-06-01\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"vaults/secrets\",\r\n \"locations\": [\r\n \"North Central US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"East US 2\",\r\n \"Central US\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Brazil South\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"Korea Central\",\r\n \"Korea South\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-10-01\",\r\n \"2015-06-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"vaults/accessPolicies\",\r\n \"locations\": [\r\n \"North Central US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"East US 2\",\r\n \"Central US\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Brazil South\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"Korea Central\",\r\n \"Korea South\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-10-01\",\r\n \"2015-06-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"operations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2016-10-01\",\r\n \"2015-06-01\",\r\n \"2014-12-19-preview\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"checkNameAvailability\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2016-10-01\",\r\n \"2015-06-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"deletedVaults\",\r\n \"locations\": [\r\n \"North Central US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"East US 2\",\r\n \"Central US\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Brazil South\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"Korea Central\",\r\n \"Korea South\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2016-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/deletedVaults\",\r\n \"locations\": [\r\n \"North Central US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"East US 2\",\r\n \"Central US\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Brazil South\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"Korea Central\",\r\n \"Korea South\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-10-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/operationResults\",\r\n \"locations\": [\r\n \"North Central US\",\r\n \"East US\",\r\n \"North Europe\",\r\n \"West Europe\",\r\n \"East Asia\",\r\n \"Southeast Asia\",\r\n \"East US 2\",\r\n \"Central US\",\r\n \"South Central US\",\r\n \"West US\",\r\n \"Japan East\",\r\n \"Japan West\",\r\n \"Australia East\",\r\n \"Australia Southeast\",\r\n \"Brazil South\",\r\n \"Central India\",\r\n \"South India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"Korea Central\",\r\n \"Korea South\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2016-10-01\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 17 Feb 2017 21:36:08 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-request-id": [ + "02e1fbc2-4f21-4ac9-bc9e-715bf99f6a70" + ], + "x-ms-correlation-request-id": [ + "02e1fbc2-4f21-4ac9-bc9e-715bf99f6a70" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20170217T213609Z:02e1fbc2-4f21-4ac9-bc9e-715bf99f6a70" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourcegroups/azsmnet5574/providers/Microsoft.KeyVault//vaults/azsmnet1960?api-version=2015-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlZ3JvdXBzL2F6c21uZXQ1NTc0L3Byb3ZpZGVycy9NaWNyb3NvZnQuS2V5VmF1bHQvL3ZhdWx0cy9henNtbmV0MTk2MD9hcGktdmVyc2lvbj0yMDE1LTA2LTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"sku\": {\r\n \"family\": \"A\",\r\n \"name\": \"standard\"\r\n },\r\n \"accessPolicies\": [\r\n {\r\n \"objectId\": \"f520d84c-3fd3-4cc8-88d4-2ed25b00d27a\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"permissions\": {\r\n \"secrets\": [\r\n \"All\"\r\n ],\r\n \"keys\": [\r\n \"All\"\r\n ]\r\n }\r\n }\r\n ],\r\n \"enabledForDeployment\": true,\r\n \"enabledForTemplateDeployment\": true,\r\n \"enabledForDiskEncryption\": true\r\n },\r\n \"location\": \"West Europe\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "621" + ], + "x-ms-client-request-id": [ + "332ab94e-9a1b-46a2-ad46-2a89f9350933" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet5574/providers/Microsoft.KeyVault/vaults/azsmnet1960\",\r\n \"name\": \"azsmnet1960\",\r\n \"type\": \"Microsoft.KeyVault/vaults\",\r\n \"location\": \"West Europe\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"sku\": {\r\n \"family\": \"A\",\r\n \"name\": \"standard\"\r\n },\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"accessPolicies\": [\r\n {\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\",\r\n \"objectId\": \"f520d84c-3fd3-4cc8-88d4-2ed25b00d27a\",\r\n \"permissions\": {\r\n \"secrets\": [\r\n \"All\"\r\n ],\r\n \"keys\": [\r\n \"All\"\r\n ]\r\n }\r\n }\r\n ],\r\n \"enabledForDeployment\": true,\r\n \"enabledForDiskEncryption\": true,\r\n \"enabledForTemplateDeployment\": true,\r\n \"vaultUri\": \"https://azsmnet1960.vault.azure.net\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 17 Feb 2017 21:36:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.5" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-keyvault-service-version": [ + "1.0.0.151" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-request-id": [ + "092d52e5-2eef-4d66-81c8-319dce67bc70" + ], + "x-ms-correlation-request-id": [ + "092d52e5-2eef-4d66-81c8-319dce67bc70" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20170217T213615Z:092d52e5-2eef-4d66-81c8-319dce67bc70" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet5574/providers/Microsoft.Batch/batchAccounts/azsmnet2046?api-version=2017-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlR3JvdXBzL2F6c21uZXQ1NTc0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvYmF0Y2hBY2NvdW50cy9henNtbmV0MjA0Nj9hcGktdmVyc2lvbj0yMDE3LTAxLTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"West Europe\",\r\n \"properties\": {\r\n \"poolAllocationMode\": \"UserSubscription\",\r\n \"keyVaultReference\": {\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet5574/providers/Microsoft.KeyVault/vaults/azsmnet1960\",\r\n \"url\": \"https://azsmnet1960.vault.azure.net/\"\r\n }\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "336" + ], + "x-ms-client-request-id": [ + "8114ddd5-e5f2-4dec-966f-c206d757ea08" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Batch.BatchManagementClient/4.0.0" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 17 Feb 2017 21:36:19 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet5574/providers/Microsoft.Batch/batchAccounts/azsmnet2046/operationResults/ca08d00e-8f28-4ca6-aaa5-7cd0763a87a9?api-version=2017-01-01" + ], + "Retry-After": [ + "15" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "request-id": [ + "ca08d00e-8f28-4ca6-aaa5-7cd0763a87a9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "7288cbac-e2fd-483a-873d-c9d4ac7541de" + ], + "x-ms-correlation-request-id": [ + "7288cbac-e2fd-483a-873d-c9d4ac7541de" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20170217T213619Z:7288cbac-e2fd-483a-873d-c9d4ac7541de" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet5574/providers/Microsoft.Batch/batchAccounts/azsmnet2046/operationResults/ca08d00e-8f28-4ca6-aaa5-7cd0763a87a9?api-version=2017-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlR3JvdXBzL2F6c21uZXQ1NTc0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvYmF0Y2hBY2NvdW50cy9henNtbmV0MjA0Ni9vcGVyYXRpb25SZXN1bHRzL2NhMDhkMDBlLThmMjgtNGNhNi1hYWE1LTdjZDA3NjNhODdhOT9hcGktdmVyc2lvbj0yMDE3LTAxLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Batch.BatchManagementClient/4.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet2046\",\r\n \"location\": \"westeurope\",\r\n \"properties\": {\r\n \"accountEndpoint\": \"azsmnet2046.westeurope.batch.azure.com\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"coreQuota\": 2147483647,\r\n \"poolQuota\": 20,\r\n \"activeJobAndJobScheduleQuota\": 20,\r\n \"poolAllocationMode\": \"usersubscription\",\r\n \"keyVaultReference\": {\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet5574/providers/Microsoft.KeyVault/vaults/azsmnet1960\",\r\n \"url\": \"https://azsmnet1960.vault.azure.net/\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet5574/providers/Microsoft.Batch/batchAccounts/azsmnet2046\",\r\n \"type\": \"Microsoft.Batch/batchAccounts\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Last-Modified": [ + "Fri, 17 Feb 2017 21:36:52 GMT" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 17 Feb 2017 21:36:49 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "0x8D4577D1666A7BF" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "request-id": [ + "7f93b237-364c-4ad9-b37c-a406df13477a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14993" + ], + "x-ms-request-id": [ + "bba41368-230d-4a86-8591-c45e6c6a88f7" + ], + "x-ms-correlation-request-id": [ + "bba41368-230d-4a86-8591-c45e6c6a88f7" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20170217T213650Z:bba41368-230d-4a86-8591-c45e6c6a88f7" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet5574/providers/Microsoft.Batch/batchAccounts/azsmnet2046?api-version=2017-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlR3JvdXBzL2F6c21uZXQ1NTc0L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvYmF0Y2hBY2NvdW50cy9henNtbmV0MjA0Nj9hcGktdmVyc2lvbj0yMDE3LTAxLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "3d8fcf7a-1eff-4dea-86c0-7726d792f2e7" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Batch.BatchManagementClient/4.0.0" + ] + }, + "ResponseBody": "{\r\n \"name\": \"azsmnet2046\",\r\n \"location\": \"westeurope\",\r\n \"properties\": {\r\n \"accountEndpoint\": \"azsmnet2046.westeurope.batch.azure.com\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"coreQuota\": 2147483647,\r\n \"poolQuota\": 20,\r\n \"activeJobAndJobScheduleQuota\": 20,\r\n \"poolAllocationMode\": \"usersubscription\",\r\n \"keyVaultReference\": {\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet5574/providers/Microsoft.KeyVault/vaults/azsmnet1960\",\r\n \"url\": \"https://azsmnet1960.vault.azure.net/\"\r\n }\r\n },\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet5574/providers/Microsoft.Batch/batchAccounts/azsmnet2046\",\r\n \"type\": \"Microsoft.Batch/batchAccounts\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Last-Modified": [ + "Fri, 17 Feb 2017 21:36:52 GMT" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 17 Feb 2017 21:36:49 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "ETag": [ + "0x8D4577D1683840E" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "request-id": [ + "a4bddbd9-a522-4de6-99ec-3a9458322d4c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14992" + ], + "x-ms-request-id": [ + "6043c10e-aef5-4d52-80e6-1336334b4e1b" + ], + "x-ms-correlation-request-id": [ + "6043c10e-aef5-4d52-80e6-1336334b4e1b" + ], + "x-ms-routing-request-id": [ + "WESTUS2:20170217T213650Z:6043c10e-aef5-4d52-80e6-1336334b4e1b" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourcegroups/azsmnet5574?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlZ3JvdXBzL2F6c21uZXQ1NTc0P2FwaS12ZXJzaW9uPTIwMTYtMDItMDE=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "bfe01e5f-f4cd-463b-aaf9-962d992ee830" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 17 Feb 2017 21:36:51 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUNTU3NC1XRVNURVVST1BFIiwiam9iTG9jYXRpb24iOiJ3ZXN0ZXVyb3BlIn0?api-version=2016-02-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-request-id": [ + "da39b76c-7026-41ce-b1a5-328c7e9b48f9" + ], + "x-ms-correlation-request-id": [ + "da39b76c-7026-41ce-b1a5-328c7e9b48f9" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20170217T213652Z:da39b76c-7026-41ce-b1a5-328c7e9b48f9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUNTU3NC1XRVNURVVST1BFIiwiam9iTG9jYXRpb24iOiJ3ZXN0ZXVyb3BlIn0?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xOTlRrVlVOVFUzTkMxWFJWTlVSVlZTVDFCRklpd2lhbTlpVEc5allYUnBiMjRpT2lKM1pYTjBaWFZ5YjNCbEluMD9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 17 Feb 2017 21:37:21 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUNTU3NC1XRVNURVVST1BFIiwiam9iTG9jYXRpb24iOiJ3ZXN0ZXVyb3BlIn0?api-version=2016-02-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14997" + ], + "x-ms-request-id": [ + "352e1bac-21b3-4877-8c34-4fff21d74ddb" + ], + "x-ms-correlation-request-id": [ + "352e1bac-21b3-4877-8c34-4fff21d74ddb" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20170217T213722Z:352e1bac-21b3-4877-8c34-4fff21d74ddb" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUNTU3NC1XRVNURVVST1BFIiwiam9iTG9jYXRpb24iOiJ3ZXN0ZXVyb3BlIn0?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xOTlRrVlVOVFUzTkMxWFJWTlVSVlZTVDFCRklpd2lhbTlpVEc5allYUnBiMjRpT2lKM1pYTjBaWFZ5YjNCbEluMD9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 17 Feb 2017 21:37:52 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUNTU3NC1XRVNURVVST1BFIiwiam9iTG9jYXRpb24iOiJ3ZXN0ZXVyb3BlIn0?api-version=2016-02-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14996" + ], + "x-ms-request-id": [ + "567eda2c-8419-4f37-9d7a-ffd0cbea20c5" + ], + "x-ms-correlation-request-id": [ + "567eda2c-8419-4f37-9d7a-ffd0cbea20c5" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20170217T213752Z:567eda2c-8419-4f37-9d7a-ffd0cbea20c5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUNTU3NC1XRVNURVVST1BFIiwiam9iTG9jYXRpb24iOiJ3ZXN0ZXVyb3BlIn0?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xOTlRrVlVOVFUzTkMxWFJWTlVSVlZTVDFCRklpd2lhbTlpVEc5allYUnBiMjRpT2lKM1pYTjBaWFZ5YjNCbEluMD9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 17 Feb 2017 21:38:22 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUNTU3NC1XRVNURVVST1BFIiwiam9iTG9jYXRpb24iOiJ3ZXN0ZXVyb3BlIn0?api-version=2016-02-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "x-ms-request-id": [ + "abde606e-644f-4037-9e50-6c538d25cb3a" + ], + "x-ms-correlation-request-id": [ + "abde606e-644f-4037-9e50-6c538d25cb3a" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20170217T213823Z:abde606e-644f-4037-9e50-6c538d25cb3a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUNTU3NC1XRVNURVVST1BFIiwiam9iTG9jYXRpb24iOiJ3ZXN0ZXVyb3BlIn0?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xOTlRrVlVOVFUzTkMxWFJWTlVSVlZTVDFCRklpd2lhbTlpVEc5allYUnBiMjRpT2lKM1pYTjBaWFZ5YjNCbEluMD9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Fri, 17 Feb 2017 21:38:52 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14994" + ], + "x-ms-request-id": [ + "86b66c61-c4c0-4720-b663-3f212d5d75c3" + ], + "x-ms-correlation-request-id": [ + "86b66c61-c4c0-4720-b663-3f212d5d75c3" + ], + "x-ms-routing-request-id": [ + "CENTRALUS:20170217T213853Z:86b66c61-c4c0-4720-b663-3f212d5d75c3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + } + ], + "Names": { + "BatchAccountCanCreateWithBYOSEnabled": [ + "azsmnet5574", + "azsmnet2046", + "azsmnet1960" + ] + }, + "Variables": { + "SubscriptionId": "2915bbd6-1252-405f-8173-6c00428146d9" + } +} \ No newline at end of file diff --git a/src/ResourceManagement/Batch/Batch.Tests/SessionRecords/Batch.Tests.ScenarioTests.AccountTests/BatchAccountEndToEndAsync.json b/src/ResourceManagement/Batch/Batch.Tests/SessionRecords/Batch.Tests.ScenarioTests.AccountTests/BatchAccountEndToEndAsync.json index b16c03fe0c464..fcd033455c3a7 100644 --- a/src/ResourceManagement/Batch/Batch.Tests/SessionRecords/Batch.Tests.ScenarioTests.AccountTests/BatchAccountEndToEndAsync.json +++ b/src/ResourceManagement/Batch/Batch.Tests/SessionRecords/Batch.Tests.ScenarioTests.AccountTests/BatchAccountEndToEndAsync.json @@ -1,22 +1,23 @@ { "Entries": [ { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/providers/Microsoft.Batch?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2g/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/providers/Microsoft.Batch?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2g/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "689265a2-8e59-4ebf-bac0-0bca47118ac7" + "25b5843f-6bdf-4720-868e-400a32199790" ], "accept-language": [ "en-US" ], "User-Agent": [ + "FxVersion/4.6.24214.01", "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/providers/Microsoft.Batch\",\r\n \"namespace\": \"Microsoft.Batch\",\r\n \"authorization\": {\r\n \"applicationId\": \"ddbf3205-c6bd-46ae-8127-60eb93363864\",\r\n \"roleDefinitionId\": \"b7f84953-1d03-4eab-9ea4-45f065258ff8\"\r\n },\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"batchAccounts\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2015-12-01\",\r\n \"2015-09-01\",\r\n \"2015-07-01\",\r\n \"2014-05-01-privatepreview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"operations\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2015-09-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/quotas\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/providers/Microsoft.Batch\",\r\n \"namespace\": \"Microsoft.Batch\",\r\n \"authorization\": {\r\n \"applicationId\": \"ddbf3205-c6bd-46ae-8127-60eb93363864\",\r\n \"roleDefinitionId\": \"b7f84953-1d03-4eab-9ea4-45f065258ff8\"\r\n },\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"batchAccounts\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2017-01-01\",\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"operations\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2017-01-01\",\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2017-01-01\",\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/quotas\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2017-01-01\",\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", "ResponseHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -28,7 +29,7 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:41:40 GMT" + "Fri, 17 Feb 2017 21:33:40 GMT" ], "Pragma": [ "no-cache" @@ -37,16 +38,16 @@ "Accept-Encoding" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14994" + "14993" ], "x-ms-request-id": [ - "6f6b3f21-7125-4b79-bdf5-f7975558e60c" + "ed417f54-5bf0-4bff-98c5-55fc89e1000c" ], "x-ms-correlation-request-id": [ - "6f6b3f21-7125-4b79-bdf5-f7975558e60c" + "ed417f54-5bf0-4bff-98c5-55fc89e1000c" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184141Z:6f6b3f21-7125-4b79-bdf5-f7975558e60c" + "WESTUS2:20170217T213341Z:ed417f54-5bf0-4bff-98c5-55fc89e1000c" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -55,8 +56,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourcegroups/azsmnet793?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Jlc291cmNlZ3JvdXBzL2F6c21uZXQ3OTM/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourcegroups/azsmnet1826?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlZ3JvdXBzL2F6c21uZXQxODI2P2FwaS12ZXJzaW9uPTIwMTYtMDItMDE=", "RequestMethod": "PUT", "RequestBody": "{\r\n \"location\": \"West Europe\"\r\n}", "RequestHeaders": { @@ -67,19 +68,20 @@ "33" ], "x-ms-client-request-id": [ - "a0618efc-da99-4332-b9bb-ae0aba2cbce6" + "ebd6d1d3-442d-489f-bf7c-215f8f63b6f9" ], "accept-language": [ "en-US" ], "User-Agent": [ + "FxVersion/4.6.24214.01", "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793\",\r\n \"name\": \"azsmnet793\",\r\n \"location\": \"westeurope\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826\",\r\n \"name\": \"azsmnet1826\",\r\n \"location\": \"westeurope\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ - "177" + "179" ], "Content-Type": [ "application/json; charset=utf-8" @@ -91,22 +93,22 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:41:41 GMT" + "Fri, 17 Feb 2017 21:33:42 GMT" ], "Pragma": [ "no-cache" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "1196" ], "x-ms-request-id": [ - "285b8aa7-699d-4598-90bb-870c0f9c4109" + "a0a3a12b-9bd9-4d96-a4de-271435026e52" ], "x-ms-correlation-request-id": [ - "285b8aa7-699d-4598-90bb-870c0f9c4109" + "a0a3a12b-9bd9-4d96-a4de-271435026e52" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184142Z:285b8aa7-699d-4598-90bb-870c0f9c4109" + "WESTUS2:20170217T213343Z:a0a3a12b-9bd9-4d96-a4de-271435026e52" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -115,8 +117,8 @@ "StatusCode": 201 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts/azsmnet5660?api-version=2015-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Jlc291cmNlR3JvdXBzL2F6c21uZXQ3OTMvcHJvdmlkZXJzL01pY3Jvc29mdC5CYXRjaC9iYXRjaEFjY291bnRzL2F6c21uZXQ1NjYwP2FwaS12ZXJzaW9uPTIwMTUtMTItMDE=", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts/azsmnet2245?api-version=2017-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlR3JvdXBzL2F6c21uZXQxODI2L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvYmF0Y2hBY2NvdW50cy9henNtbmV0MjI0NT9hcGktdmVyc2lvbj0yMDE3LTAxLTAx", "RequestMethod": "PUT", "RequestBody": "{\r\n \"location\": \"West Europe\"\r\n}", "RequestHeaders": { @@ -127,13 +129,14 @@ "33" ], "x-ms-client-request-id": [ - "4efe0968-f0c8-4442-9da1-4eebebabe6b5" + "2198fe2e-7a97-4c19-a4bb-c4939918309d" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.Batch.BatchManagementClient/3.0.0" + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Batch.BatchManagementClient/4.0.0" ] }, "ResponseBody": "", @@ -148,13 +151,13 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:41:45 GMT" + "Fri, 17 Feb 2017 21:33:46 GMT" ], "Pragma": [ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts/azsmnet5660/operationResults/87d25198-ccb9-4ef1-9ba0-74f2c11efff3?api-version=2015-12-01" + "https://management.azure.com/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts/azsmnet2245/operationResults/a839bcac-9f28-4e42-9711-294c67a4b03a?api-version=2017-01-01" ], "Retry-After": [ "15" @@ -163,10 +166,10 @@ "Microsoft-HTTPAPI/2.0" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1197" + "1196" ], "request-id": [ - "87d25198-ccb9-4ef1-9ba0-74f2c11efff3" + "a839bcac-9f28-4e42-9711-294c67a4b03a" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -175,28 +178,29 @@ "nosniff" ], "x-ms-request-id": [ - "83fe3389-30e2-4039-ab92-ce0143c577fd" + "7c3bada1-61c6-4912-a5f0-97b7e60c4283" ], "x-ms-correlation-request-id": [ - "83fe3389-30e2-4039-ab92-ce0143c577fd" + "7c3bada1-61c6-4912-a5f0-97b7e60c4283" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184146Z:83fe3389-30e2-4039-ab92-ce0143c577fd" + "WESTUS2:20170217T213346Z:7c3bada1-61c6-4912-a5f0-97b7e60c4283" ] }, "StatusCode": 202 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts/azsmnet5660/operationResults/87d25198-ccb9-4ef1-9ba0-74f2c11efff3?api-version=2015-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Jlc291cmNlR3JvdXBzL2F6c21uZXQ3OTMvcHJvdmlkZXJzL01pY3Jvc29mdC5CYXRjaC9iYXRjaEFjY291bnRzL2F6c21uZXQ1NjYwL29wZXJhdGlvblJlc3VsdHMvODdkMjUxOTgtY2NiOS00ZWYxLTliYTAtNzRmMmMxMWVmZmYzP2FwaS12ZXJzaW9uPTIwMTUtMTItMDE=", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts/azsmnet2245/operationResults/a839bcac-9f28-4e42-9711-294c67a4b03a?api-version=2017-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlR3JvdXBzL2F6c21uZXQxODI2L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvYmF0Y2hBY2NvdW50cy9henNtbmV0MjI0NS9vcGVyYXRpb25SZXN1bHRzL2E4MzliY2FjLTlmMjgtNGU0Mi05NzExLTI5NGM2N2E0YjAzYT9hcGktdmVyc2lvbj0yMDE3LTAxLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "Microsoft.Azure.Management.Batch.BatchManagementClient/3.0.0" + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Batch.BatchManagementClient/4.0.0" ] }, - "ResponseBody": "{\r\n \"name\": \"azsmnet5660\",\r\n \"location\": \"westeurope\",\r\n \"properties\": {\r\n \"accountEndpoint\": \"azsmnet5660.westeurope.batch.azure.com\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"coreQuota\": 20,\r\n \"poolQuota\": 20,\r\n \"activeJobAndJobScheduleQuota\": 20\r\n },\r\n \"id\": \"/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts/azsmnet5660\",\r\n \"type\": \"Microsoft.Batch/batchAccounts\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"azsmnet2245\",\r\n \"location\": \"westeurope\",\r\n \"properties\": {\r\n \"accountEndpoint\": \"azsmnet2245.westeurope.batch.azure.com\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"coreQuota\": 20,\r\n \"poolQuota\": 20,\r\n \"activeJobAndJobScheduleQuota\": 20,\r\n \"poolAllocationMode\": \"batchservice\"\r\n },\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts/azsmnet2245\",\r\n \"type\": \"Microsoft.Batch/batchAccounts\"\r\n}", "ResponseHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -205,13 +209,13 @@ "-1" ], "Last-Modified": [ - "Mon, 28 Nov 2016 18:42:16 GMT" + "Fri, 17 Feb 2017 21:34:16 GMT" ], "Cache-Control": [ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:42:15 GMT" + "Fri, 17 Feb 2017 21:34:16 GMT" ], "Pragma": [ "no-cache" @@ -220,7 +224,7 @@ "chunked" ], "ETag": [ - "0x8D417BE46E2BE1D" + "0x8D4577CB9324CBE" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -229,7 +233,7 @@ "Accept-Encoding" ], "request-id": [ - "8135ccdd-f384-4ac8-9fb2-bec032d14d83" + "347f8939-773f-4adf-a121-cfe54a012499" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -238,37 +242,38 @@ "nosniff" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14992" + "14996" ], "x-ms-request-id": [ - "0c258b2f-03e3-410d-a7b0-592e949048d0" + "b1c81476-8ffa-4789-a5be-bb9ca1bdd46a" ], "x-ms-correlation-request-id": [ - "0c258b2f-03e3-410d-a7b0-592e949048d0" + "b1c81476-8ffa-4789-a5be-bb9ca1bdd46a" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184216Z:0c258b2f-03e3-410d-a7b0-592e949048d0" + "WESTUS2:20170217T213416Z:b1c81476-8ffa-4789-a5be-bb9ca1bdd46a" ] }, "StatusCode": 200 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts/azsmnet5660?api-version=2015-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Jlc291cmNlR3JvdXBzL2F6c21uZXQ3OTMvcHJvdmlkZXJzL01pY3Jvc29mdC5CYXRjaC9iYXRjaEFjY291bnRzL2F6c21uZXQ1NjYwP2FwaS12ZXJzaW9uPTIwMTUtMTItMDE=", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts/azsmnet2245?api-version=2017-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlR3JvdXBzL2F6c21uZXQxODI2L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvYmF0Y2hBY2NvdW50cy9henNtbmV0MjI0NT9hcGktdmVyc2lvbj0yMDE3LTAxLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "8e48f651-46c9-49ab-a83e-458a3acc7b0a" + "5cef9cbd-caeb-4483-80dd-c59d86232355" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.Batch.BatchManagementClient/3.0.0" + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Batch.BatchManagementClient/4.0.0" ] }, - "ResponseBody": "{\r\n \"name\": \"azsmnet5660\",\r\n \"location\": \"westeurope\",\r\n \"properties\": {\r\n \"accountEndpoint\": \"azsmnet5660.westeurope.batch.azure.com\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"coreQuota\": 20,\r\n \"poolQuota\": 20,\r\n \"activeJobAndJobScheduleQuota\": 20\r\n },\r\n \"id\": \"/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts/azsmnet5660\",\r\n \"type\": \"Microsoft.Batch/batchAccounts\"\r\n}", + "ResponseBody": "{\r\n \"name\": \"azsmnet2245\",\r\n \"location\": \"westeurope\",\r\n \"properties\": {\r\n \"accountEndpoint\": \"azsmnet2245.westeurope.batch.azure.com\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"coreQuota\": 20,\r\n \"poolQuota\": 20,\r\n \"activeJobAndJobScheduleQuota\": 20,\r\n \"poolAllocationMode\": \"batchservice\"\r\n },\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts/azsmnet2245\",\r\n \"type\": \"Microsoft.Batch/batchAccounts\"\r\n}", "ResponseHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -277,13 +282,13 @@ "-1" ], "Last-Modified": [ - "Mon, 28 Nov 2016 18:42:16 GMT" + "Fri, 17 Feb 2017 21:34:16 GMT" ], "Cache-Control": [ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:42:15 GMT" + "Fri, 17 Feb 2017 21:34:16 GMT" ], "Pragma": [ "no-cache" @@ -292,7 +297,7 @@ "chunked" ], "ETag": [ - "0x8D417BE470922A3" + "0x8D4577CB9551EA3" ], "Server": [ "Microsoft-HTTPAPI/2.0" @@ -301,7 +306,7 @@ "Accept-Encoding" ], "request-id": [ - "582c3b44-bff8-4f18-be27-b5f7dbd24b78" + "dc70511d-980e-4aec-a212-e969b841f41d" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -310,40 +315,41 @@ "nosniff" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14991" + "14995" ], "x-ms-request-id": [ - "f6ea6da2-856d-4a01-b18c-5591c8a079fe" + "514e8f2a-8a34-42d1-9998-00b9bb04ebcb" ], "x-ms-correlation-request-id": [ - "f6ea6da2-856d-4a01-b18c-5591c8a079fe" + "514e8f2a-8a34-42d1-9998-00b9bb04ebcb" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184216Z:f6ea6da2-856d-4a01-b18c-5591c8a079fe" + "WESTUS2:20170217T213417Z:514e8f2a-8a34-42d1-9998-00b9bb04ebcb" ] }, "StatusCode": 200 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts/azsmnet5660?api-version=2015-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Jlc291cmNlR3JvdXBzL2F6c21uZXQ3OTMvcHJvdmlkZXJzL01pY3Jvc29mdC5CYXRjaC9iYXRjaEFjY291bnRzL2F6c21uZXQ1NjYwP2FwaS12ZXJzaW9uPTIwMTUtMTItMDE=", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts/azsmnet2245?api-version=2017-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlR3JvdXBzL2F6c21uZXQxODI2L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvYmF0Y2hBY2NvdW50cy9henNtbmV0MjI0NT9hcGktdmVyc2lvbj0yMDE3LTAxLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "bb90b4e7-d105-4c93-a294-544fd5133f16" + "2875e793-2ea9-46d6-a830-0fd7241c677f" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.Batch.BatchManagementClient/3.0.0" + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Batch.BatchManagementClient/4.0.0" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Batch/batchAccounts/azsmnet5660' under resource group 'azsmnet793' was not found.\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Batch/batchAccounts/azsmnet2245' under resource group 'azsmnet1826' was not found.\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ - "155" + "156" ], "Content-Type": [ "application/json; charset=utf-8" @@ -355,7 +361,7 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:42:48 GMT" + "Fri, 17 Feb 2017 21:34:48 GMT" ], "Pragma": [ "no-cache" @@ -364,13 +370,13 @@ "gateway" ], "x-ms-request-id": [ - "b81d5ef0-f32e-4c18-99bf-ce1e67ddf104" + "7c6ec06a-4d11-4481-a67a-f3b8e8661886" ], "x-ms-correlation-request-id": [ - "b81d5ef0-f32e-4c18-99bf-ce1e67ddf104" + "7c6ec06a-4d11-4481-a67a-f3b8e8661886" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184248Z:b81d5ef0-f32e-4c18-99bf-ce1e67ddf104" + "WESTUS2:20170217T213448Z:7c6ec06a-4d11-4481-a67a-f3b8e8661886" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -379,22 +385,23 @@ "StatusCode": 404 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts/azsmnet5660/listKeys?api-version=2015-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Jlc291cmNlR3JvdXBzL2F6c21uZXQ3OTMvcHJvdmlkZXJzL01pY3Jvc29mdC5CYXRjaC9iYXRjaEFjY291bnRzL2F6c21uZXQ1NjYwL2xpc3RLZXlzP2FwaS12ZXJzaW9uPTIwMTUtMTItMDE=", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts/azsmnet2245/listKeys?api-version=2017-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlR3JvdXBzL2F6c21uZXQxODI2L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvYmF0Y2hBY2NvdW50cy9henNtbmV0MjI0NS9saXN0S2V5cz9hcGktdmVyc2lvbj0yMDE3LTAxLTAx", "RequestMethod": "POST", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "bfbe9fe9-4df2-4070-a151-f4e455408d41" + "20c00de4-9f40-43d0-92bb-ac58264238d6" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.Batch.BatchManagementClient/3.0.0" + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Batch.BatchManagementClient/4.0.0" ] }, - "ResponseBody": "{\r\n \"accountName\": \"azsmnet5660\",\r\n \"primary\": \"kNLme2DUyKweMnkrg+9MGitrAsYjFBsUfMDtDi4vw1Z3L/DaxwOayFDNyoMtWIqbCbVDGeLFs1z1s/FFR0OJ5g==\",\r\n \"secondary\": \"cvt4oqIaOaEFogK3CNhgpzSXPWpJy4/422RRNM4Md4UQWenPy17t3VihWg4csYTBdTRUjjMoJ+cTL68z+E774Q==\"\r\n}", + "ResponseBody": "{\r\n \"accountName\": \"azsmnet2245\",\r\n \"primary\": \"vH+P4hogdqwbLOLrcOGj7dGzMIr1LXxZ4fbMAS971HDLF0fpjOSdvwGivUqg5PM33zsJEv8qLVAFwd9BmYcreQ==\",\r\n \"secondary\": \"a6SQ72FW20/NlWobKkbpjgZRqkVbPrBRBiZIyTbx3DGrCIZ/f2We2bF1n6VJm+UdKpHykRMwVOwiyT28iEJBxQ==\"\r\n}", "ResponseHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -406,7 +413,7 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:42:15 GMT" + "Fri, 17 Feb 2017 21:34:16 GMT" ], "Pragma": [ "no-cache" @@ -421,7 +428,7 @@ "Accept-Encoding" ], "request-id": [ - "4ace2cad-d507-4d28-a351-b44ada0fcc45" + "21de8ffb-0719-4a18-a832-b3c350a1121e" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -430,23 +437,23 @@ "nosniff" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1196" + "1195" ], "x-ms-request-id": [ - "c0dc998a-21c5-45e0-8b8c-f81bac6bb56f" + "3c31e7f6-b9f2-4d21-8b55-d64565637bfb" ], "x-ms-correlation-request-id": [ - "c0dc998a-21c5-45e0-8b8c-f81bac6bb56f" + "3c31e7f6-b9f2-4d21-8b55-d64565637bfb" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184216Z:c0dc998a-21c5-45e0-8b8c-f81bac6bb56f" + "WESTUS2:20170217T213417Z:3c31e7f6-b9f2-4d21-8b55-d64565637bfb" ] }, "StatusCode": 200 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts/azsmnet5660/regenerateKeys?api-version=2015-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Jlc291cmNlR3JvdXBzL2F6c21uZXQ3OTMvcHJvdmlkZXJzL01pY3Jvc29mdC5CYXRjaC9iYXRjaEFjY291bnRzL2F6c21uZXQ1NjYwL3JlZ2VuZXJhdGVLZXlzP2FwaS12ZXJzaW9uPTIwMTUtMTItMDE=", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts/azsmnet2245/regenerateKeys?api-version=2017-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlR3JvdXBzL2F6c21uZXQxODI2L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvYmF0Y2hBY2NvdW50cy9henNtbmV0MjI0NS9yZWdlbmVyYXRlS2V5cz9hcGktdmVyc2lvbj0yMDE3LTAxLTAx", "RequestMethod": "POST", "RequestBody": "{\r\n \"keyName\": \"Primary\"\r\n}", "RequestHeaders": { @@ -457,16 +464,17 @@ "28" ], "x-ms-client-request-id": [ - "eb9144d9-e7f2-434e-852b-c308647a6cf5" + "ebad3fe1-8f20-450e-b274-62e7e4cabdb7" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.Batch.BatchManagementClient/3.0.0" + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Batch.BatchManagementClient/4.0.0" ] }, - "ResponseBody": "{\r\n \"accountName\": \"azsmnet5660\",\r\n \"primary\": \"5QS1rp4D3I9w3KdKGNJcWeAr+03PdnLxIoDGhbWwTenp+ch90+uLtmUpCK7yOm4isRooOyQkATPXxTccVK0JWA==\",\r\n \"secondary\": \"cvt4oqIaOaEFogK3CNhgpzSXPWpJy4/422RRNM4Md4UQWenPy17t3VihWg4csYTBdTRUjjMoJ+cTL68z+E774Q==\"\r\n}", + "ResponseBody": "{\r\n \"accountName\": \"azsmnet2245\",\r\n \"primary\": \"PBDsalr11LoHg0fv8IvyHOa8LCU/lB4f6plsdKvyo4DPXDZOCHKNPDqohFxHcGTW4jCbf2KnyI5sOq8FZyKndg==\",\r\n \"secondary\": \"a6SQ72FW20/NlWobKkbpjgZRqkVbPrBRBiZIyTbx3DGrCIZ/f2We2bF1n6VJm+UdKpHykRMwVOwiyT28iEJBxQ==\"\r\n}", "ResponseHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -478,7 +486,7 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:42:16 GMT" + "Fri, 17 Feb 2017 21:34:16 GMT" ], "Pragma": [ "no-cache" @@ -493,7 +501,7 @@ "Accept-Encoding" ], "request-id": [ - "c951b80c-8ddb-4536-becb-43f90795473e" + "9f05f140-0db2-4b1a-aa2e-758934911cb1" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -502,37 +510,38 @@ "nosniff" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1195" + "1194" ], "x-ms-request-id": [ - "4b4377b1-01fb-4649-8ddb-3121bffa8e04" + "8c5bf7e3-212e-4b66-a3ba-83949d8f808d" ], "x-ms-correlation-request-id": [ - "4b4377b1-01fb-4649-8ddb-3121bffa8e04" + "8c5bf7e3-212e-4b66-a3ba-83949d8f808d" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184217Z:4b4377b1-01fb-4649-8ddb-3121bffa8e04" + "WESTUS2:20170217T213417Z:8c5bf7e3-212e-4b66-a3ba-83949d8f808d" ] }, "StatusCode": 200 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts?api-version=2015-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Jlc291cmNlR3JvdXBzL2F6c21uZXQ3OTMvcHJvdmlkZXJzL01pY3Jvc29mdC5CYXRjaC9iYXRjaEFjY291bnRzP2FwaS12ZXJzaW9uPTIwMTUtMTItMDE=", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts?api-version=2017-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlR3JvdXBzL2F6c21uZXQxODI2L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvYmF0Y2hBY2NvdW50cz9hcGktdmVyc2lvbj0yMDE3LTAxLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "9eda91f3-87bb-4065-801b-72490caa9694" + "53691e5d-5f0e-46a3-abe4-9340f27d8692" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.Batch.BatchManagementClient/3.0.0" + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Batch.BatchManagementClient/4.0.0" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"name\": \"azsmnet5660\",\r\n \"location\": \"westeurope\",\r\n \"properties\": {\r\n \"accountEndpoint\": \"azsmnet5660.westeurope.batch.azure.com\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"coreQuota\": 20,\r\n \"poolQuota\": 20,\r\n \"activeJobAndJobScheduleQuota\": 20\r\n },\r\n \"id\": \"/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts/azsmnet5660\",\r\n \"type\": \"Microsoft.Batch/batchAccounts\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"name\": \"azsmnet2245\",\r\n \"location\": \"westeurope\",\r\n \"properties\": {\r\n \"accountEndpoint\": \"azsmnet2245.westeurope.batch.azure.com\",\r\n \"provisioningState\": \"Succeeded\",\r\n \"coreQuota\": 20,\r\n \"poolQuota\": 20,\r\n \"activeJobAndJobScheduleQuota\": 20,\r\n \"poolAllocationMode\": \"batchservice\"\r\n },\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts/azsmnet2245\",\r\n \"type\": \"Microsoft.Batch/batchAccounts\"\r\n }\r\n ]\r\n}", "ResponseHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -544,7 +553,7 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:42:16 GMT" + "Fri, 17 Feb 2017 21:34:17 GMT" ], "Pragma": [ "no-cache" @@ -559,7 +568,7 @@ "Accept-Encoding" ], "request-id": [ - "5633774b-ae2c-4ed5-8f7f-c2c771a964ee" + "70f466c5-db47-464c-9784-cd56a9c2c14b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -568,34 +577,35 @@ "nosniff" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14990" + "14994" ], "x-ms-request-id": [ - "5f47b24f-2948-492c-a7e4-aedd1438accc" + "351f3a58-24aa-4f22-84a9-fa01cd7d9678" ], "x-ms-correlation-request-id": [ - "5f47b24f-2948-492c-a7e4-aedd1438accc" + "351f3a58-24aa-4f22-84a9-fa01cd7d9678" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184217Z:5f47b24f-2948-492c-a7e4-aedd1438accc" + "WESTUS2:20170217T213417Z:351f3a58-24aa-4f22-84a9-fa01cd7d9678" ] }, "StatusCode": 200 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts/azsmnet5660?api-version=2015-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Jlc291cmNlR3JvdXBzL2F6c21uZXQ3OTMvcHJvdmlkZXJzL01pY3Jvc29mdC5CYXRjaC9iYXRjaEFjY291bnRzL2F6c21uZXQ1NjYwP2FwaS12ZXJzaW9uPTIwMTUtMTItMDE=", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts/azsmnet2245?api-version=2017-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlR3JvdXBzL2F6c21uZXQxODI2L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvYmF0Y2hBY2NvdW50cy9henNtbmV0MjI0NT9hcGktdmVyc2lvbj0yMDE3LTAxLTAx", "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "0f82d400-d0c5-4321-8be3-1d1a46e34527" + "de6fc8bd-264b-4b69-9e2e-ea5a8ab03ff9" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.Batch.BatchManagementClient/3.0.0" + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Batch.BatchManagementClient/4.0.0" ] }, "ResponseBody": "", @@ -610,13 +620,13 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:42:17 GMT" + "Fri, 17 Feb 2017 21:34:17 GMT" ], "Pragma": [ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts/azsmnet5660/operationResults/30e56ed0-773d-4045-898c-82f7dad3edd4?api-version=2015-12-01" + "https://management.azure.com/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts/azsmnet2245/operationResults/beac3c1e-fbbc-45f2-b259-f97536078bcb?api-version=2017-01-01" ], "Retry-After": [ "15" @@ -625,7 +635,7 @@ "Microsoft-HTTPAPI/2.0" ], "request-id": [ - "30e56ed0-773d-4045-898c-82f7dad3edd4" + "beac3c1e-fbbc-45f2-b259-f97536078bcb" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -634,34 +644,35 @@ "nosniff" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1194" + "1193" ], "x-ms-request-id": [ - "86193e5c-d97d-42b9-8709-fcbcb0172e24" + "8628d85d-be71-41ad-9e05-7f6195d72078" ], "x-ms-correlation-request-id": [ - "86193e5c-d97d-42b9-8709-fcbcb0172e24" + "8628d85d-be71-41ad-9e05-7f6195d72078" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184218Z:86193e5c-d97d-42b9-8709-fcbcb0172e24" + "WESTUS2:20170217T213418Z:8628d85d-be71-41ad-9e05-7f6195d72078" ] }, "StatusCode": 202 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourceGroups/azsmnet793/providers/Microsoft.Batch/batchAccounts/azsmnet5660/operationResults/30e56ed0-773d-4045-898c-82f7dad3edd4?api-version=2015-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Jlc291cmNlR3JvdXBzL2F6c21uZXQ3OTMvcHJvdmlkZXJzL01pY3Jvc29mdC5CYXRjaC9iYXRjaEFjY291bnRzL2F6c21uZXQ1NjYwL29wZXJhdGlvblJlc3VsdHMvMzBlNTZlZDAtNzczZC00MDQ1LTg5OGMtODJmN2RhZDNlZGQ0P2FwaS12ZXJzaW9uPTIwMTUtMTItMDE=", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourceGroups/azsmnet1826/providers/Microsoft.Batch/batchAccounts/azsmnet2245/operationResults/beac3c1e-fbbc-45f2-b259-f97536078bcb?api-version=2017-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlR3JvdXBzL2F6c21uZXQxODI2L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvYmF0Y2hBY2NvdW50cy9henNtbmV0MjI0NS9vcGVyYXRpb25SZXN1bHRzL2JlYWMzYzFlLWZiYmMtNDVmMi1iMjU5LWY5NzUzNjA3OGJjYj9hcGktdmVyc2lvbj0yMDE3LTAxLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "Microsoft.Azure.Management.Batch.BatchManagementClient/3.0.0" + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Batch.BatchManagementClient/4.0.0" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Batch/batchAccounts/azsmnet5660' under resource group 'azsmnet793' was not found.\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.Batch/batchAccounts/azsmnet2245' under resource group 'azsmnet1826' was not found.\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ - "155" + "156" ], "Content-Type": [ "application/json; charset=utf-8" @@ -673,7 +684,7 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:42:48 GMT" + "Fri, 17 Feb 2017 21:34:47 GMT" ], "Pragma": [ "no-cache" @@ -682,13 +693,13 @@ "gateway" ], "x-ms-request-id": [ - "990bbe06-463e-43ef-ab6c-ebad50e041d9" + "ef2d651f-6ee2-409c-bf0c-86a8df673de3" ], "x-ms-correlation-request-id": [ - "990bbe06-463e-43ef-ab6c-ebad50e041d9" + "ef2d651f-6ee2-409c-bf0c-86a8df673de3" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184248Z:990bbe06-463e-43ef-ab6c-ebad50e041d9" + "WESTUS2:20170217T213448Z:ef2d651f-6ee2-409c-bf0c-86a8df673de3" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -697,18 +708,19 @@ "StatusCode": 404 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/resourcegroups/azsmnet793?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Jlc291cmNlZ3JvdXBzL2F6c21uZXQ3OTM/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/resourcegroups/azsmnet1826?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Jlc291cmNlZ3JvdXBzL2F6c21uZXQxODI2P2FwaS12ZXJzaW9uPTIwMTYtMDItMDE=", "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "d498e12a-8b9c-4561-b19b-97d221a95b77" + "ef74e045-0f16-4973-9326-9ea0bf4f9d35" ], "accept-language": [ "en-US" ], "User-Agent": [ + "FxVersion/4.6.24214.01", "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" ] }, @@ -724,28 +736,28 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:42:50 GMT" + "Fri, 17 Feb 2017 21:34:51 GMT" ], "Pragma": [ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUNzkzLVdFU1RFVVJPUEUiLCJqb2JMb2NhdGlvbiI6Indlc3RldXJvcGUifQ?api-version=2016-02-01" + "https://management.azure.com/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUMTgyNi1XRVNURVVST1BFIiwiam9iTG9jYXRpb24iOiJ3ZXN0ZXVyb3BlIn0?api-version=2016-02-01" ], "Retry-After": [ "15" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "1195" ], "x-ms-request-id": [ - "f1e2428d-8249-4e10-8f24-6036e25d8e07" + "1759712f-f5b2-4634-850d-199761d14883" ], "x-ms-correlation-request-id": [ - "f1e2428d-8249-4e10-8f24-6036e25d8e07" + "1759712f-f5b2-4634-850d-199761d14883" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184250Z:f1e2428d-8249-4e10-8f24-6036e25d8e07" + "WESTUS2:20170217T213451Z:1759712f-f5b2-4634-850d-199761d14883" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -754,12 +766,13 @@ "StatusCode": 202 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUNzkzLVdFU1RFVVJPUEUiLCJqb2JMb2NhdGlvbiI6Indlc3RldXJvcGUifQ?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xOTlRrVlVOemt6TFZkRlUxUkZWVkpQVUVVaUxDSnFiMkpNYjJOaGRHbHZiaUk2SW5kbGMzUmxkWEp2Y0dVaWZRP2FwaS12ZXJzaW9uPTIwMTYtMDItMDE=", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUMTgyNi1XRVNURVVST1BFIiwiam9iTG9jYXRpb24iOiJ3ZXN0ZXVyb3BlIn0?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xOTlRrVlVNVGd5TmkxWFJWTlVSVlZTVDFCRklpd2lhbTlpVEc5allYUnBiMjRpT2lKM1pYTjBaWFZ5YjNCbEluMD9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ + "FxVersion/4.6.24214.01", "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" ] }, @@ -775,28 +788,28 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:43:20 GMT" + "Fri, 17 Feb 2017 21:35:21 GMT" ], "Pragma": [ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUNzkzLVdFU1RFVVJPUEUiLCJqb2JMb2NhdGlvbiI6Indlc3RldXJvcGUifQ?api-version=2016-02-01" + "https://management.azure.com/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUMTgyNi1XRVNURVVST1BFIiwiam9iTG9jYXRpb24iOiJ3ZXN0ZXVyb3BlIn0?api-version=2016-02-01" ], "Retry-After": [ "15" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14998" + "14985" ], "x-ms-request-id": [ - "fad28ab1-17da-4173-b186-2fb1abb3a831" + "c5c68661-75f5-412b-83c9-bea3e79c8912" ], "x-ms-correlation-request-id": [ - "fad28ab1-17da-4173-b186-2fb1abb3a831" + "c5c68661-75f5-412b-83c9-bea3e79c8912" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184321Z:fad28ab1-17da-4173-b186-2fb1abb3a831" + "WESTUS2:20170217T213522Z:c5c68661-75f5-412b-83c9-bea3e79c8912" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -805,12 +818,13 @@ "StatusCode": 202 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUNzkzLVdFU1RFVVJPUEUiLCJqb2JMb2NhdGlvbiI6Indlc3RldXJvcGUifQ?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xOTlRrVlVOemt6TFZkRlUxUkZWVkpQVUVVaUxDSnFiMkpNYjJOaGRHbHZiaUk2SW5kbGMzUmxkWEp2Y0dVaWZRP2FwaS12ZXJzaW9uPTIwMTYtMDItMDE=", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1BWlNNTkVUMTgyNi1XRVNURVVST1BFIiwiam9iTG9jYXRpb24iOiJ3ZXN0ZXVyb3BlIn0?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFCV2xOTlRrVlVNVGd5TmkxWFJWTlVSVlZTVDFCRklpd2lhbTlpVEc5allYUnBiMjRpT2lKM1pYTjBaWFZ5YjNCbEluMD9hcGktdmVyc2lvbj0yMDE2LTAyLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ + "FxVersion/4.6.24214.01", "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" ] }, @@ -826,22 +840,22 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:43:50 GMT" + "Fri, 17 Feb 2017 21:35:51 GMT" ], "Pragma": [ "no-cache" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14997" + "14984" ], "x-ms-request-id": [ - "f2acbf29-e981-4fc0-967c-f5f38025fa45" + "fecf0fa2-3597-4ead-b27f-df5c0a6a0338" ], "x-ms-correlation-request-id": [ - "f2acbf29-e981-4fc0-967c-f5f38025fa45" + "fecf0fa2-3597-4ead-b27f-df5c0a6a0338" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T184351Z:f2acbf29-e981-4fc0-967c-f5f38025fa45" + "WESTUS2:20170217T213552Z:fecf0fa2-3597-4ead-b27f-df5c0a6a0338" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -852,11 +866,11 @@ ], "Names": { "BatchAccountEndToEndAsync": [ - "azsmnet793", - "azsmnet5660" + "azsmnet1826", + "azsmnet2245" ] }, "Variables": { - "SubscriptionId": "46241355-bb95-46a9-ba6c-42b554d71925" + "SubscriptionId": "2915bbd6-1252-405f-8173-6c00428146d9" } } \ No newline at end of file diff --git a/src/ResourceManagement/Batch/Batch.Tests/SessionRecords/Batch.Tests.ScenarioTests.LocationTests/GetLocationQuotasAsync.json b/src/ResourceManagement/Batch/Batch.Tests/SessionRecords/Batch.Tests.ScenarioTests.LocationTests/GetLocationQuotasAsync.json index 46f23a6627332..8bf1d51ea8783 100644 --- a/src/ResourceManagement/Batch/Batch.Tests/SessionRecords/Batch.Tests.ScenarioTests.LocationTests/GetLocationQuotasAsync.json +++ b/src/ResourceManagement/Batch/Batch.Tests/SessionRecords/Batch.Tests.ScenarioTests.LocationTests/GetLocationQuotasAsync.json @@ -1,22 +1,23 @@ { "Entries": [ { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/providers/Microsoft.Batch?api-version=2016-02-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2g/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/providers/Microsoft.Batch?api-version=2016-02-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2g/YXBpLXZlcnNpb249MjAxNi0wMi0wMQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "fbc30f19-5b79-498b-9c79-983ff00e5136" + "b8ea4b3c-ef08-415d-adb7-4f2dccca805a" ], "accept-language": [ "en-US" ], "User-Agent": [ + "FxVersion/4.6.24214.01", "Microsoft.Azure.Management.ResourceManager.ResourceManagementClient/1.1.3-preview" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/providers/Microsoft.Batch\",\r\n \"namespace\": \"Microsoft.Batch\",\r\n \"authorization\": {\r\n \"applicationId\": \"ddbf3205-c6bd-46ae-8127-60eb93363864\",\r\n \"roleDefinitionId\": \"b7f84953-1d03-4eab-9ea4-45f065258ff8\"\r\n },\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"batchAccounts\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2015-12-01\",\r\n \"2015-09-01\",\r\n \"2015-07-01\",\r\n \"2014-05-01-privatepreview\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"operations\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2015-09-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/quotas\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\"\r\n ],\r\n \"apiVersions\": [\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/providers/Microsoft.Batch\",\r\n \"namespace\": \"Microsoft.Batch\",\r\n \"authorization\": {\r\n \"applicationId\": \"ddbf3205-c6bd-46ae-8127-60eb93363864\",\r\n \"roleDefinitionId\": \"b7f84953-1d03-4eab-9ea4-45f065258ff8\"\r\n },\r\n \"resourceTypes\": [\r\n {\r\n \"resourceType\": \"batchAccounts\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2017-01-01\",\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ],\r\n \"capabilities\": \"CrossResourceGroupResourceMove, CrossSubscriptionResourceMove\"\r\n },\r\n {\r\n \"resourceType\": \"operations\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2017-01-01\",\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations\",\r\n \"locations\": [],\r\n \"apiVersions\": [\r\n \"2017-01-01\",\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ]\r\n },\r\n {\r\n \"resourceType\": \"locations/quotas\",\r\n \"locations\": [\r\n \"West Europe\",\r\n \"East US\",\r\n \"East US 2\",\r\n \"West US\",\r\n \"North Central US\",\r\n \"Brazil South\",\r\n \"North Europe\",\r\n \"Central US\",\r\n \"East Asia\",\r\n \"Japan East\",\r\n \"Australia Southeast\",\r\n \"Japan West\",\r\n \"Korea South\",\r\n \"Korea Central\",\r\n \"Southeast Asia\",\r\n \"South Central US\",\r\n \"Australia East\",\r\n \"South India\",\r\n \"Central India\",\r\n \"West India\",\r\n \"Canada Central\",\r\n \"Canada East\",\r\n \"UK South\",\r\n \"UK West\",\r\n \"West Central US\",\r\n \"West US 2\",\r\n \"East US 2 EUAP\",\r\n \"Central US EUAP\"\r\n ],\r\n \"apiVersions\": [\r\n \"2017-01-01\",\r\n \"2015-12-01\",\r\n \"2015-09-01\"\r\n ]\r\n }\r\n ],\r\n \"registrationState\": \"Registered\"\r\n}", "ResponseHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -28,7 +29,7 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:11:41 GMT" + "Fri, 17 Feb 2017 21:33:36 GMT" ], "Pragma": [ "no-cache" @@ -37,16 +38,16 @@ "Accept-Encoding" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14997" + "14992" ], "x-ms-request-id": [ - "7cf0e412-58a1-4a82-83c8-1bbeb15ba132" + "8401253d-b1cb-4cdf-a206-3a9c7c9bce4e" ], "x-ms-correlation-request-id": [ - "7cf0e412-58a1-4a82-83c8-1bbeb15ba132" + "8401253d-b1cb-4cdf-a206-3a9c7c9bce4e" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T181141Z:7cf0e412-58a1-4a82-83c8-1bbeb15ba132" + "WESTUS2:20170217T213337Z:8401253d-b1cb-4cdf-a206-3a9c7c9bce4e" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -55,19 +56,20 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/46241355-bb95-46a9-ba6c-42b554d71925/providers/Microsoft.Batch/locations/West%20Europe/quotas?api-version=2015-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNDYyNDEzNTUtYmI5NS00NmE5LWJhNmMtNDJiNTU0ZDcxOTI1L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvbG9jYXRpb25zL1dlc3QlMjBFdXJvcGUvcXVvdGFzP2FwaS12ZXJzaW9uPTIwMTUtMTItMDE=", + "RequestUri": "/subscriptions/2915bbd6-1252-405f-8173-6c00428146d9/providers/Microsoft.Batch/locations/West%20Europe/quotas?api-version=2017-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMjkxNWJiZDYtMTI1Mi00MDVmLTgxNzMtNmMwMDQyODE0NmQ5L3Byb3ZpZGVycy9NaWNyb3NvZnQuQmF0Y2gvbG9jYXRpb25zL1dlc3QlMjBFdXJvcGUvcXVvdGFzP2FwaS12ZXJzaW9uPTIwMTctMDEtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "8ed248c6-ef0b-49d9-9c61-479c5354b0f8" + "ffedfe07-0cd5-43d7-ab62-2a7e7b988ae7" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.Batch.BatchManagementClient/3.0.0" + "FxVersion/4.6.24214.01", + "Microsoft.Azure.Management.Batch.BatchManagementClient/4.0.0" ] }, "ResponseBody": "{\r\n \"accountQuota\": 1\r\n}", @@ -82,7 +84,7 @@ "no-cache" ], "Date": [ - "Mon, 28 Nov 2016 18:11:42 GMT" + "Fri, 17 Feb 2017 21:33:37 GMT" ], "Pragma": [ "no-cache" @@ -97,7 +99,7 @@ "Accept-Encoding" ], "request-id": [ - "4c850c6d-fd6a-46e5-a10c-abcfbe1227a8" + "5ae7dda3-b7f6-40a8-9f0f-68e45092082b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -106,16 +108,16 @@ "nosniff" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14997" + "14986" ], "x-ms-request-id": [ - "9ba1cc12-9777-4e1a-8178-fff720da88aa" + "4e4967c5-24a7-4466-9baf-d843b491e584" ], "x-ms-correlation-request-id": [ - "9ba1cc12-9777-4e1a-8178-fff720da88aa" + "4e4967c5-24a7-4466-9baf-d843b491e584" ], "x-ms-routing-request-id": [ - "CENTRALUS:20161128T181142Z:9ba1cc12-9777-4e1a-8178-fff720da88aa" + "WESTUS2:20170217T213338Z:4e4967c5-24a7-4466-9baf-d843b491e584" ] }, "StatusCode": 200 @@ -123,6 +125,6 @@ ], "Names": {}, "Variables": { - "SubscriptionId": "46241355-bb95-46a9-ba6c-42b554d71925" + "SubscriptionId": "2915bbd6-1252-405f-8173-6c00428146d9" } } \ No newline at end of file diff --git a/src/ResourceManagement/Batch/Batch.sln b/src/ResourceManagement/Batch/Batch.sln index 16bb31d150628..ff05f2d62f85d 100644 --- a/src/ResourceManagement/Batch/Batch.sln +++ b/src/ResourceManagement/Batch/Batch.sln @@ -16,6 +16,12 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "HttpRecorder", "..\..\TestF EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "TestFramework", "..\..\TestFramework\Microsoft.Rest.ClientRuntime.Azure.TestFramework\TestFramework.xproj", "{C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}" EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime\Microsoft.Rest.ClientRuntime.xproj", "{EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime.Azure", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime.Azure\Microsoft.Rest.ClientRuntime.Azure.xproj", "{D5296EAB-C13E-4A88-9532-BD0677D18EC9}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Rest.ClientRuntime.Azure.Authentication", "..\..\ClientRuntime\Microsoft.Rest.ClientRuntime.Azure.Authentication\Microsoft.Rest.ClientRuntime.Azure.Authentication.xproj", "{6319205D-BBFC-4150-BEAE-31B1C9B911DD}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -38,6 +44,18 @@ Global {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Debug|Any CPU.Build.0 = Debug|Any CPU {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Release|Any CPU.ActiveCfg = Release|Any CPU {C4C4E1C8-B99D-4D90-8C27-6D0C0A268BA5}.Release|Any CPU.Build.0 = Release|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EDDB6367-5C7B-428C-B54C-96BCD90F6E6C}.Release|Any CPU.Build.0 = Release|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D5296EAB-C13E-4A88-9532-BD0677D18EC9}.Release|Any CPU.Build.0 = Release|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6319205D-BBFC-4150-BEAE-31B1C9B911DD}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationOperations.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationOperations.cs index 062c191e0ac34..7f79216327be4 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationOperations.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// ApplicationOperations operations. /// - internal partial class ApplicationOperations : Microsoft.Rest.IServiceOperations, IApplicationOperations + internal partial class ApplicationOperations : IServiceOperations, IApplicationOperations { /// /// Initializes a new instance of the ApplicationOperations class. @@ -29,11 +38,11 @@ internal partial class ApplicationOperations : Microsoft.Rest.IServiceOperations /// internal ApplicationOperations(BatchManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -51,7 +60,7 @@ internal ApplicationOperations(BatchManagementClient client) /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The parameters for the request. @@ -62,109 +71,112 @@ internal ApplicationOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, AddApplicationParameters parameters = default(AddApplicationParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, AddApplicationParameters parameters = default(AddApplicationParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (applicationId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationId"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("applicationId", applicationId); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{applicationId}", System.Uri.EscapeDataString(applicationId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -182,40 +194,40 @@ internal ApplicationOperations(BatchManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -223,15 +235,15 @@ internal ApplicationOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -241,7 +253,7 @@ internal ApplicationOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -254,7 +266,7 @@ internal ApplicationOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -263,12 +275,12 @@ internal ApplicationOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -283,7 +295,7 @@ internal ApplicationOperations(BatchManagementClient client) /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// Headers that will be added to request. @@ -291,105 +303,108 @@ internal ApplicationOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (applicationId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationId"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("applicationId", applicationId); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{applicationId}", System.Uri.EscapeDataString(applicationId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -406,43 +421,51 @@ internal ApplicationOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -452,7 +475,7 @@ internal ApplicationOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -461,7 +484,7 @@ internal ApplicationOperations(BatchManagementClient client) } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -476,7 +499,7 @@ internal ApplicationOperations(BatchManagementClient client) /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// Headers that will be added to request. @@ -484,108 +507,111 @@ internal ApplicationOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (applicationId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationId"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("applicationId", applicationId); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{applicationId}", System.Uri.EscapeDataString(applicationId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -602,35 +628,35 @@ internal ApplicationOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -638,15 +664,15 @@ internal ApplicationOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -656,7 +682,7 @@ internal ApplicationOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -669,7 +695,7 @@ internal ApplicationOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -678,12 +704,12 @@ internal ApplicationOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -698,7 +724,7 @@ internal ApplicationOperations(BatchManagementClient client) /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The parameters for the request. @@ -709,110 +735,113 @@ internal ApplicationOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, UpdateApplicationParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, UpdateApplicationParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (applicationId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationId"); } if (parameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("applicationId", applicationId); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{applicationId}", System.Uri.EscapeDataString(applicationId)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -830,48 +859,56 @@ internal ApplicationOperations(BatchManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -881,7 +918,7 @@ internal ApplicationOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -890,7 +927,7 @@ internal ApplicationOperations(BatchManagementClient client) } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -913,107 +950,110 @@ internal ApplicationOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, int? maxresults = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, int? maxresults = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("maxresults", maxresults); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); if (maxresults != null) { - _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(maxresults, this.Client.SerializationSettings).Trim('"')))); + _queryParameters.Add(string.Format("maxresults={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(maxresults, Client.SerializationSettings).Trim('"')))); } - if (this.Client.ApiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1030,35 +1070,35 @@ internal ApplicationOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1066,15 +1106,15 @@ internal ApplicationOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1084,7 +1124,7 @@ internal ApplicationOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1097,7 +1137,7 @@ internal ApplicationOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1106,12 +1146,12 @@ internal ApplicationOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1128,60 +1168,63 @@ internal ApplicationOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1198,35 +1241,35 @@ internal ApplicationOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1234,15 +1277,15 @@ internal ApplicationOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1252,7 +1295,7 @@ internal ApplicationOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1265,7 +1308,7 @@ internal ApplicationOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1274,15 +1317,16 @@ internal ApplicationOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationOperationsExtensions.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationOperationsExtensions.cs index 8a3d62440bc20..d79ced7949eae 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationOperationsExtensions.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ApplicationOperations. @@ -30,14 +34,14 @@ public static partial class ApplicationOperationsExtensions /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The parameters for the request. /// public static Application Create(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId, AddApplicationParameters parameters = default(AddApplicationParameters)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationOperations)s).CreateAsync(resourceGroupName, accountName, applicationId, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.CreateAsync(resourceGroupName, accountName, applicationId, parameters).GetAwaiter().GetResult(); } /// @@ -53,7 +57,7 @@ public static partial class ApplicationOperationsExtensions /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The parameters for the request. @@ -61,7 +65,7 @@ public static partial class ApplicationOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateAsync(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId, AddApplicationParameters parameters = default(AddApplicationParameters), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateAsync(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId, AddApplicationParameters parameters = default(AddApplicationParameters), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, applicationId, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -82,11 +86,11 @@ public static partial class ApplicationOperationsExtensions /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// public static void Delete(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationOperations)s).DeleteAsync(resourceGroupName, accountName, applicationId), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, accountName, applicationId).GetAwaiter().GetResult(); } /// @@ -102,12 +106,12 @@ public static void Delete(this IApplicationOperations operations, string resourc /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, applicationId, null, cancellationToken).ConfigureAwait(false); } @@ -125,11 +129,11 @@ public static void Delete(this IApplicationOperations operations, string resourc /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// public static Application Get(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationOperations)s).GetAsync(resourceGroupName, accountName, applicationId), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, accountName, applicationId).GetAwaiter().GetResult(); } /// @@ -145,12 +149,12 @@ public static Application Get(this IApplicationOperations operations, string res /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, applicationId, null, cancellationToken).ConfigureAwait(false)) { @@ -171,14 +175,14 @@ public static Application Get(this IApplicationOperations operations, string res /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The parameters for the request. /// public static void Update(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId, UpdateApplicationParameters parameters) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationOperations)s).UpdateAsync(resourceGroupName, accountName, applicationId, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.UpdateAsync(resourceGroupName, accountName, applicationId, parameters).GetAwaiter().GetResult(); } /// @@ -194,7 +198,7 @@ public static void Update(this IApplicationOperations operations, string resourc /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The parameters for the request. @@ -202,7 +206,7 @@ public static void Update(this IApplicationOperations operations, string resourc /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId, UpdateApplicationParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task UpdateAsync(this IApplicationOperations operations, string resourceGroupName, string accountName, string applicationId, UpdateApplicationParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, applicationId, parameters, null, cancellationToken).ConfigureAwait(false); } @@ -222,9 +226,9 @@ public static void Update(this IApplicationOperations operations, string resourc /// /// The maximum number of items to return in the response. /// - public static Microsoft.Rest.Azure.IPage List(this IApplicationOperations operations, string resourceGroupName, string accountName, int? maxresults = default(int?)) + public static IPage List(this IApplicationOperations operations, string resourceGroupName, string accountName, int? maxresults = default(int?)) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationOperations)s).ListAsync(resourceGroupName, accountName, maxresults), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync(resourceGroupName, accountName, maxresults).GetAwaiter().GetResult(); } /// @@ -245,7 +249,7 @@ public static void Update(this IApplicationOperations operations, string resourc /// /// The cancellation token. /// - public static async Task> ListAsync(this IApplicationOperations operations, string resourceGroupName, string accountName, int? maxresults = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IApplicationOperations operations, string resourceGroupName, string accountName, int? maxresults = default(int?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, maxresults, null, cancellationToken).ConfigureAwait(false)) { @@ -262,9 +266,9 @@ public static void Update(this IApplicationOperations operations, string resourc /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IApplicationOperations operations, string nextPageLink) + public static IPage ListNext(this IApplicationOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -279,7 +283,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IApplication /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IApplicationOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IApplicationOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -289,3 +293,4 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IApplication } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationPackageOperations.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationPackageOperations.cs index 84057bb75349c..59c75c26f92b1 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationPackageOperations.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationPackageOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// ApplicationPackageOperations operations. /// - internal partial class ApplicationPackageOperations : Microsoft.Rest.IServiceOperations, IApplicationPackageOperations + internal partial class ApplicationPackageOperations : IServiceOperations, IApplicationPackageOperations { /// /// Initializes a new instance of the ApplicationPackageOperations class. @@ -29,11 +38,11 @@ internal partial class ApplicationPackageOperations : Microsoft.Rest.IServiceOpe /// internal ApplicationPackageOperations(BatchManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -51,7 +60,7 @@ internal ApplicationPackageOperations(BatchManagementClient client) /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application to activate. @@ -65,66 +74,69 @@ internal ApplicationPackageOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task ActivateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, string format, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task ActivateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, string format, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (applicationId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationId"); } if (version == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "version"); + throw new ValidationException(ValidationRules.CannotBeNull, "version"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (format == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "format"); + throw new ValidationException(ValidationRules.CannotBeNull, "format"); } ActivateApplicationPackageParameters parameters = new ActivateApplicationPackageParameters(); if (format != null) @@ -132,54 +144,54 @@ internal ApplicationPackageOperations(BatchManagementClient client) parameters.Format = format; } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("applicationId", applicationId); tracingParameters.Add("version", version); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Activate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Activate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}/activate").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{applicationId}", System.Uri.EscapeDataString(applicationId)); _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -197,48 +209,56 @@ internal ApplicationPackageOperations(BatchManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -248,7 +268,7 @@ internal ApplicationPackageOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -257,7 +277,7 @@ internal ApplicationPackageOperations(BatchManagementClient client) } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -272,7 +292,7 @@ internal ApplicationPackageOperations(BatchManagementClient client) /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application. @@ -283,114 +303,117 @@ internal ApplicationPackageOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (applicationId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationId"); } if (version == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "version"); + throw new ValidationException(ValidationRules.CannotBeNull, "version"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("applicationId", applicationId); tracingParameters.Add("version", version); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Create", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{applicationId}", System.Uri.EscapeDataString(applicationId)); _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -407,35 +430,35 @@ internal ApplicationPackageOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -443,15 +466,15 @@ internal ApplicationPackageOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -461,7 +484,7 @@ internal ApplicationPackageOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -474,7 +497,7 @@ internal ApplicationPackageOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -483,12 +506,12 @@ internal ApplicationPackageOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -503,7 +526,7 @@ internal ApplicationPackageOperations(BatchManagementClient client) /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application to delete. @@ -514,111 +537,114 @@ internal ApplicationPackageOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (applicationId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationId"); } if (version == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "version"); + throw new ValidationException(ValidationRules.CannotBeNull, "version"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("applicationId", applicationId); tracingParameters.Add("version", version); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{applicationId}", System.Uri.EscapeDataString(applicationId)); _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -635,43 +661,51 @@ internal ApplicationPackageOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -681,7 +715,7 @@ internal ApplicationPackageOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -690,7 +724,7 @@ internal ApplicationPackageOperations(BatchManagementClient client) } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -705,7 +739,7 @@ internal ApplicationPackageOperations(BatchManagementClient client) /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application. @@ -716,114 +750,117 @@ internal ApplicationPackageOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (applicationId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "applicationId"); + throw new ValidationException(ValidationRules.CannotBeNull, "applicationId"); } if (version == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "version"); + throw new ValidationException(ValidationRules.CannotBeNull, "version"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("applicationId", applicationId); tracingParameters.Add("version", version); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/applications/{applicationId}/versions/{version}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); _url = _url.Replace("{applicationId}", System.Uri.EscapeDataString(applicationId)); _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -840,35 +877,35 @@ internal ApplicationPackageOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -876,15 +913,15 @@ internal ApplicationPackageOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -894,7 +931,7 @@ internal ApplicationPackageOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -907,7 +944,7 @@ internal ApplicationPackageOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -916,15 +953,16 @@ internal ApplicationPackageOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationPackageOperationsExtensions.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationPackageOperationsExtensions.cs index 1d7deb4017b7e..ed9b838d4956b 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationPackageOperationsExtensions.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ApplicationPackageOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for ApplicationPackageOperations. @@ -30,7 +34,7 @@ public static partial class ApplicationPackageOperationsExtensions /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application to activate. @@ -40,7 +44,7 @@ public static partial class ApplicationPackageOperationsExtensions /// public static void Activate(this IApplicationPackageOperations operations, string resourceGroupName, string accountName, string applicationId, string version, string format) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationPackageOperations)s).ActivateAsync(resourceGroupName, accountName, applicationId, version, format), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.ActivateAsync(resourceGroupName, accountName, applicationId, version, format).GetAwaiter().GetResult(); } /// @@ -56,7 +60,7 @@ public static void Activate(this IApplicationPackageOperations operations, strin /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application to activate. @@ -67,7 +71,7 @@ public static void Activate(this IApplicationPackageOperations operations, strin /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ActivateAsync(this IApplicationPackageOperations operations, string resourceGroupName, string accountName, string applicationId, string version, string format, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task ActivateAsync(this IApplicationPackageOperations operations, string resourceGroupName, string accountName, string applicationId, string version, string format, CancellationToken cancellationToken = default(CancellationToken)) { await operations.ActivateWithHttpMessagesAsync(resourceGroupName, accountName, applicationId, version, format, null, cancellationToken).ConfigureAwait(false); } @@ -85,14 +89,14 @@ public static void Activate(this IApplicationPackageOperations operations, strin /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application. /// public static ApplicationPackage Create(this IApplicationPackageOperations operations, string resourceGroupName, string accountName, string applicationId, string version) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationPackageOperations)s).CreateAsync(resourceGroupName, accountName, applicationId, version), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.CreateAsync(resourceGroupName, accountName, applicationId, version).GetAwaiter().GetResult(); } /// @@ -108,7 +112,7 @@ public static ApplicationPackage Create(this IApplicationPackageOperations opera /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application. @@ -116,7 +120,7 @@ public static ApplicationPackage Create(this IApplicationPackageOperations opera /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateAsync(this IApplicationPackageOperations operations, string resourceGroupName, string accountName, string applicationId, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateAsync(this IApplicationPackageOperations operations, string resourceGroupName, string accountName, string applicationId, string version, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, applicationId, version, null, cancellationToken).ConfigureAwait(false)) { @@ -137,14 +141,14 @@ public static ApplicationPackage Create(this IApplicationPackageOperations opera /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application to delete. /// public static void Delete(this IApplicationPackageOperations operations, string resourceGroupName, string accountName, string applicationId, string version) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationPackageOperations)s).DeleteAsync(resourceGroupName, accountName, applicationId, version), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, accountName, applicationId, version).GetAwaiter().GetResult(); } /// @@ -160,7 +164,7 @@ public static void Delete(this IApplicationPackageOperations operations, string /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application to delete. @@ -168,7 +172,7 @@ public static void Delete(this IApplicationPackageOperations operations, string /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IApplicationPackageOperations operations, string resourceGroupName, string accountName, string applicationId, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IApplicationPackageOperations operations, string resourceGroupName, string accountName, string applicationId, string version, CancellationToken cancellationToken = default(CancellationToken)) { await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, applicationId, version, null, cancellationToken).ConfigureAwait(false); } @@ -186,14 +190,14 @@ public static void Delete(this IApplicationPackageOperations operations, string /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application. /// public static ApplicationPackage Get(this IApplicationPackageOperations operations, string resourceGroupName, string accountName, string applicationId, string version) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IApplicationPackageOperations)s).GetAsync(resourceGroupName, accountName, applicationId, version), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, accountName, applicationId, version).GetAwaiter().GetResult(); } /// @@ -209,7 +213,7 @@ public static ApplicationPackage Get(this IApplicationPackageOperations operatio /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application. @@ -217,7 +221,7 @@ public static ApplicationPackage Get(this IApplicationPackageOperations operatio /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IApplicationPackageOperations operations, string resourceGroupName, string accountName, string applicationId, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IApplicationPackageOperations operations, string resourceGroupName, string accountName, string applicationId, string version, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, applicationId, version, null, cancellationToken).ConfigureAwait(false)) { @@ -227,3 +231,4 @@ public static ApplicationPackage Get(this IApplicationPackageOperations operatio } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/BatchAccountOperations.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/BatchAccountOperations.cs index 491ac405611d8..995ffe73f7b20 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/BatchAccountOperations.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/BatchAccountOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// BatchAccountOperations operations. /// - internal partial class BatchAccountOperations : Microsoft.Rest.IServiceOperations, IBatchAccountOperations + internal partial class BatchAccountOperations : IServiceOperations, IBatchAccountOperations { /// /// Initializes a new instance of the BatchAccountOperations class. @@ -29,11 +38,11 @@ internal partial class BatchAccountOperations : Microsoft.Rest.IServiceOperation /// internal BatchAccountOperations(BatchManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -43,8 +52,8 @@ internal BatchAccountOperations(BatchManagementClient client) /// /// Creates a new Batch account with the specified parameters. Existing - /// accounts cannot be updated with this API and should instead be updated - /// with the Update Batch Account API. + /// accounts cannot be updated with this API and should instead be updated with + /// the Update Batch Account API. /// /// /// The name of the resource group that contains the new Batch account. @@ -66,34 +75,24 @@ internal BatchAccountOperations(BatchManagementClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync( - resourceGroupName, accountName, parameters, customHeaders, cancellationToken); - return await this.Client.GetPutOrPatchOperationResultAsync(_response, - customHeaders, - cancellationToken); + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Creates a new Batch account with the specified parameters. Existing - /// accounts cannot be updated with this API and should instead be updated - /// with the Update Batch Account API. + /// Updates the properties of an existing Batch account. /// /// - /// The name of the resource group that contains the new Batch account. + /// The name of the resource group that contains the Batch account. /// /// - /// A name for the Batch account which must be unique within the region. Batch - /// account names must be between 3 and 24 characters in length and must use - /// only numbers and lowercase letters. This name is used as part of the DNS - /// name that is used to access the Batch service in the region in which the - /// account is created. For example: - /// http://accountname.region.batch.azure.com/. + /// The name of the account. /// /// - /// Additional parameters for account creation. + /// Additional parameters for account update. /// /// /// Headers that will be added to request. @@ -101,111 +100,110 @@ internal BatchAccountOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } if (parameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) + if (Client.ApiVersion == null) { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -223,40 +221,40 @@ internal BatchAccountOperations(BatchManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -264,15 +262,15 @@ internal BatchAccountOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -282,7 +280,7 @@ internal BatchAccountOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -295,7 +293,7 @@ internal BatchAccountOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -304,18 +302,41 @@ internal BatchAccountOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Updates the properties of an existing Batch account. + /// Deletes the specified Batch account. + /// + /// + /// The name of the resource group that contains the Batch account to be + /// deleted. + /// + /// + /// The name of the account to be deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the specified Batch account. /// /// /// The name of the resource group that contains the Batch account. @@ -323,116 +344,111 @@ internal BatchAccountOperations(BatchManagementClient client) /// /// The name of the account. /// - /// - /// Additional parameters for account update. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountUpdateParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } - if (parameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); - } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -448,42 +464,36 @@ internal BatchAccountOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -491,15 +501,15 @@ internal BatchAccountOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -509,7 +519,7 @@ internal BatchAccountOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -522,7 +532,7 @@ internal BatchAccountOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -531,149 +541,90 @@ internal BatchAccountOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Deletes the specified Batch account. - /// - /// - /// The name of the resource group that contains the Batch account to be - /// deleted. - /// - /// - /// The name of the account to be deleted. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync( - resourceGroupName, accountName, customHeaders, cancellationToken); - return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken); - } - - /// - /// Deletes the specified Batch account. + /// Gets information about the Batch accounts associated with the subscription. /// - /// - /// The name of the resource group that contains the Batch account to be - /// deleted. - /// - /// - /// The name of the account to be deleted. - /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (resourceGroupName == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (resourceGroupName != null) + if (Client.SubscriptionId == null) { - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); - } - } - if (accountName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); - } - if (accountName != null) - { - if (accountName.Length > 24) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); - } - if (accountName.Length < 3) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); - } - } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("accountName", accountName); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}").ToString(); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -690,43 +641,51 @@ internal BatchAccountOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204 && (int)_statusCode != 200) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -736,28 +695,44 @@ internal BatchAccountOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets information about the specified Batch account. + /// Gets information about the Batch accounts associated within the specified + /// resource group. /// /// - /// The name of the resource group that contains the Batch account. - /// - /// - /// The name of the account. + /// The name of the resource group whose Batch accounts to list. /// /// /// Headers that will be added to request. @@ -765,102 +740,84 @@ internal BatchAccountOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } - if (accountName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); - } - if (accountName != null) + if (Client.ApiVersion == null) { - if (accountName.Length > 24) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); - } - if (accountName.Length < 3) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); - } + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.ApiVersion == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (this.Client.SubscriptionId == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("accountName", accountName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -877,35 +834,35 @@ internal BatchAccountOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -913,15 +870,15 @@ internal BatchAccountOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -931,7 +888,7 @@ internal BatchAccountOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -944,7 +901,7 @@ internal BatchAccountOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -953,87 +910,128 @@ internal BatchAccountOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets information about the Batch accounts associated with the subscription. + /// Synchronizes access keys for the auto storage account configured for the + /// specified Batch account. /// + /// + /// The name of the resource group that contains the Batch account. + /// + /// + /// The name of the Batch account. + /// /// /// Headers that will be added to request. /// /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response + /// + /// Thrown when a required parameter is null /// - /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task SynchronizeAutoStorageKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.ApiVersion == null) + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 24) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + } + } + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "SynchronizeAutoStorageKeys", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Batch/batchAccounts").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1050,35 +1048,35 @@ internal BatchAccountOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1086,15 +1084,15 @@ internal BatchAccountOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1104,44 +1102,32 @@ internal BatchAccountOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets information about the Batch accounts associated within the specified - /// resource group. + /// Regenerates the specified account key for the Batch account. /// /// - /// The name of the resource group whose Batch accounts to list. + /// The name of the resource group that contains the Batch account. + /// + /// + /// The name of the account. + /// + /// + /// The type of account key to regenerate. Possible values include: 'Primary', + /// 'Secondary' /// /// /// Headers that will be added to request. @@ -1149,81 +1135,108 @@ internal BatchAccountOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, AccountKeyType keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (accountName != null) + { + if (accountName.Length > 24) + { + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); + } + if (accountName.Length < 3) + { + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + BatchAccountRegenerateKeyParameters parameters = new BatchAccountRegenerateKeyParameters(); + parameters.KeyName = keyName; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RegenerateKey", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1239,36 +1252,42 @@ internal BatchAccountOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1276,15 +1295,15 @@ internal BatchAccountOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1294,7 +1313,7 @@ internal BatchAccountOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1307,7 +1326,7 @@ internal BatchAccountOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1316,25 +1335,31 @@ internal BatchAccountOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Synchronizes access keys for the auto storage account configured for the - /// specified Batch account. + /// Gets the account keys for the specified Batch account. /// + /// + /// This operation applies only to Batch accounts created with a + /// poolAllocationMode of 'BatchService'. If the Batch account was created with + /// a poolAllocationMode of 'UserSubscription', clients cannot use access to + /// keys to authenticate, and must use Azure Active Directory instead. In this + /// case, getting the keys will fail. + /// /// /// The name of the resource group that contains the Batch account. /// /// - /// The name of the Batch account. + /// The name of the account. /// /// /// Headers that will be added to request. @@ -1342,99 +1367,105 @@ internal BatchAccountOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task SynchronizeAutoStorageKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "SynchronizeAutoStorageKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetKeys", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/syncAutoStorageKeys").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1451,43 +1482,51 @@ internal BatchAccountOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 204) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } } - else { - _responseContent = string.Empty; + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1497,32 +1536,56 @@ internal BatchAccountOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Regenerates the specified account key for the specified Batch account. + /// Creates a new Batch account with the specified parameters. Existing + /// accounts cannot be updated with this API and should instead be updated with + /// the Update Batch Account API. /// /// - /// The name of the resource group that contains the Batch account. + /// The name of the resource group that contains the new Batch account. /// /// - /// The name of the account. + /// A name for the Batch account which must be unique within the region. Batch + /// account names must be between 3 and 24 characters in length and must use + /// only numbers and lowercase letters. This name is used as part of the DNS + /// name that is used to access the Batch service in the region in which the + /// account is created. For example: + /// http://accountname.region.batch.azure.com/. /// - /// - /// The type of account key to regenerate. Possible values include: 'Primary', - /// 'Secondary' + /// + /// Additional parameters for account creation. /// /// /// Headers that will be added to request. @@ -1530,105 +1593,114 @@ internal BatchAccountOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, AccountKeyType keyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } - if (this.Client.ApiVersion == null) + if (parameters == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - if (this.Client.SubscriptionId == null) + if (parameters != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + parameters.Validate(); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - BatchAccountRegenerateKeyParameters parameters = new BatchAccountRegenerateKeyParameters(); - parameters.KeyName = keyName; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "RegenerateKey", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/regenerateKeys").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1646,40 +1718,40 @@ internal BatchAccountOperations(BatchManagementClient client) string _requestContent = null; if(parameters != null) { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1687,15 +1759,15 @@ internal BatchAccountOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1705,7 +1777,7 @@ internal BatchAccountOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -1718,7 +1790,7 @@ internal BatchAccountOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -1727,24 +1799,38 @@ internal BatchAccountOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Gets the account keys for the specified Batch account. + /// Deletes the specified Batch account. /// /// - /// The name of the resource group that contains the Batch account. + /// The name of the resource group that contains the Batch account to be + /// deleted. /// /// - /// The name of the account. + /// The name of the account to be deleted. /// /// /// Headers that will be added to request. @@ -1752,102 +1838,102 @@ internal BatchAccountOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response + /// + /// Thrown when a required parameter is null /// - /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (resourceGroupName != null) { if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._]+$"); } } if (accountName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "accountName"); + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); } if (accountName != null) { if (accountName.Length > 24) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "accountName", 24); + throw new ValidationException(ValidationRules.MaxLength, "accountName", 24); } if (accountName.Length < 3) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "accountName", 3); + throw new ValidationException(ValidationRules.MinLength, "accountName", 3); } if (!System.Text.RegularExpressions.Regex.IsMatch(accountName, "^[-\\w\\._]+$")) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); + throw new ValidationException(ValidationRules.Pattern, "accountName", "^[-\\w\\._]+$"); } } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetKeys", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}/listKeys").ToString(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Batch/batchAccounts/{accountName}").ToString(); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -1864,35 +1950,35 @@ internal BatchAccountOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1900,15 +1986,15 @@ internal BatchAccountOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -1918,34 +2004,29 @@ internal BatchAccountOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } - // Deserialize Response - if ((int)_statusCode == 200) + try { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + _httpResponse.Dispose(); } + throw new SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -1962,60 +2043,63 @@ internal BatchAccountOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2032,35 +2116,35 @@ internal BatchAccountOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2068,15 +2152,15 @@ internal BatchAccountOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2086,7 +2170,7 @@ internal BatchAccountOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2099,7 +2183,7 @@ internal BatchAccountOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2108,12 +2192,12 @@ internal BatchAccountOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } @@ -2131,60 +2215,63 @@ internal BatchAccountOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + List _queryParameters = new List(); if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -2201,35 +2288,35 @@ internal BatchAccountOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -2237,15 +2324,15 @@ internal BatchAccountOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -2255,7 +2342,7 @@ internal BatchAccountOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2268,7 +2355,7 @@ internal BatchAccountOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -2277,15 +2364,16 @@ internal BatchAccountOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/BatchAccountOperationsExtensions.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/BatchAccountOperationsExtensions.cs index fb9480bbe7aaf..f7b932672203f 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/BatchAccountOperationsExtensions.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/BatchAccountOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for BatchAccountOperations. @@ -19,8 +23,8 @@ public static partial class BatchAccountOperationsExtensions { /// /// Creates a new Batch account with the specified parameters. Existing - /// accounts cannot be updated with this API and should instead be updated - /// with the Update Batch Account API. + /// accounts cannot be updated with this API and should instead be updated with + /// the Update Batch Account API. /// /// /// The operations group for this extension method. @@ -41,13 +45,13 @@ public static partial class BatchAccountOperationsExtensions /// public static BatchAccount Create(this IBatchAccountOperations operations, string resourceGroupName, string accountName, BatchAccountCreateParameters parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IBatchAccountOperations)s).CreateAsync(resourceGroupName, accountName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.CreateAsync(resourceGroupName, accountName, parameters).GetAwaiter().GetResult(); } /// /// Creates a new Batch account with the specified parameters. Existing - /// accounts cannot be updated with this API and should instead be updated - /// with the Update Batch Account API. + /// accounts cannot be updated with this API and should instead be updated with + /// the Update Batch Account API. /// /// /// The operations group for this extension method. @@ -69,7 +73,7 @@ public static BatchAccount Create(this IBatchAccountOperations operations, strin /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, accountName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -77,66 +81,6 @@ public static BatchAccount Create(this IBatchAccountOperations operations, strin } } - /// - /// Creates a new Batch account with the specified parameters. Existing - /// accounts cannot be updated with this API and should instead be updated - /// with the Update Batch Account API. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the new Batch account. - /// - /// - /// A name for the Batch account which must be unique within the region. Batch - /// account names must be between 3 and 24 characters in length and must use - /// only numbers and lowercase letters. This name is used as part of the DNS - /// name that is used to access the Batch service in the region in which the - /// account is created. For example: - /// http://accountname.region.batch.azure.com/. - /// - /// - /// Additional parameters for account creation. - /// - public static BatchAccount BeginCreate(this IBatchAccountOperations operations, string resourceGroupName, string accountName, BatchAccountCreateParameters parameters) - { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IBatchAccountOperations)s).BeginCreateAsync(resourceGroupName, accountName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// Creates a new Batch account with the specified parameters. Existing - /// accounts cannot be updated with this API and should instead be updated - /// with the Update Batch Account API. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the new Batch account. - /// - /// - /// A name for the Batch account which must be unique within the region. Batch - /// account names must be between 3 and 24 characters in length and must use - /// only numbers and lowercase letters. This name is used as part of the DNS - /// name that is used to access the Batch service in the region in which the - /// account is created. For example: - /// http://accountname.region.batch.azure.com/. - /// - /// - /// Additional parameters for account creation. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginCreateAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Updates the properties of an existing Batch account. /// @@ -154,7 +98,7 @@ public static BatchAccount BeginCreate(this IBatchAccountOperations operations, /// public static BatchAccount Update(this IBatchAccountOperations operations, string resourceGroupName, string accountName, BatchAccountUpdateParameters parameters) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IBatchAccountOperations)s).UpdateAsync(resourceGroupName, accountName, parameters), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, accountName, parameters).GetAwaiter().GetResult(); } /// @@ -175,7 +119,7 @@ public static BatchAccount Update(this IBatchAccountOperations operations, strin /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, BatchAccountUpdateParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task UpdateAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, BatchAccountUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, accountName, parameters, null, cancellationToken).ConfigureAwait(false)) { @@ -196,48 +140,9 @@ public static BatchAccount Update(this IBatchAccountOperations operations, strin /// /// The name of the account to be deleted. /// - public static void Delete(this IBatchAccountOperations operations, string resourceGroupName, string accountName) - { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IBatchAccountOperations)s).DeleteAsync(resourceGroupName, accountName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// Deletes the specified Batch account. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the Batch account to be - /// deleted. - /// - /// - /// The name of the account to be deleted. - /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task DeleteAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static BatchAccountDeleteHeaders Delete(this IBatchAccountOperations operations, string resourceGroupName, string accountName) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false); - } - - /// - /// Deletes the specified Batch account. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group that contains the Batch account to be - /// deleted. - /// - /// - /// The name of the account to be deleted. - /// - public static void BeginDelete(this IBatchAccountOperations operations, string resourceGroupName, string accountName) - { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IBatchAccountOperations)s).BeginDeleteAsync(resourceGroupName, accountName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.DeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// @@ -256,9 +161,12 @@ public static void BeginDelete(this IBatchAccountOperations operations, string r /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// @@ -275,7 +183,7 @@ public static void BeginDelete(this IBatchAccountOperations operations, string r /// public static BatchAccount Get(this IBatchAccountOperations operations, string resourceGroupName, string accountName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IBatchAccountOperations)s).GetAsync(resourceGroupName, accountName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// @@ -293,7 +201,7 @@ public static BatchAccount Get(this IBatchAccountOperations operations, string r /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { @@ -307,9 +215,9 @@ public static BatchAccount Get(this IBatchAccountOperations operations, string r /// /// The operations group for this extension method. /// - public static Microsoft.Rest.Azure.IPage List(this IBatchAccountOperations operations) + public static IPage List(this IBatchAccountOperations operations) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IBatchAccountOperations)s).ListAsync(), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListAsync().GetAwaiter().GetResult(); } /// @@ -321,7 +229,7 @@ public static Microsoft.Rest.Azure.IPage List(this IBatchAccountOp /// /// The cancellation token. /// - public static async Task> ListAsync(this IBatchAccountOperations operations, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListAsync(this IBatchAccountOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -339,9 +247,9 @@ public static Microsoft.Rest.Azure.IPage List(this IBatchAccountOp /// /// The name of the resource group whose Batch accounts to list. /// - public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IBatchAccountOperations operations, string resourceGroupName) + public static IPage ListByResourceGroup(this IBatchAccountOperations operations, string resourceGroupName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IBatchAccountOperations)s).ListByResourceGroupAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); } /// @@ -357,7 +265,7 @@ public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this /// /// The cancellation token. /// - public static async Task> ListByResourceGroupAsync(this IBatchAccountOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListByResourceGroupAsync(this IBatchAccountOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { @@ -380,7 +288,7 @@ public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this /// public static void SynchronizeAutoStorageKeys(this IBatchAccountOperations operations, string resourceGroupName, string accountName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IBatchAccountOperations)s).SynchronizeAutoStorageKeysAsync(resourceGroupName, accountName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.SynchronizeAutoStorageKeysAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// @@ -399,13 +307,13 @@ public static void SynchronizeAutoStorageKeys(this IBatchAccountOperations opera /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task SynchronizeAutoStorageKeysAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task SynchronizeAutoStorageKeysAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) { await operations.SynchronizeAutoStorageKeysWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false); } /// - /// Regenerates the specified account key for the specified Batch account. + /// Regenerates the specified account key for the Batch account. /// /// /// The operations group for this extension method. @@ -422,11 +330,11 @@ public static void SynchronizeAutoStorageKeys(this IBatchAccountOperations opera /// public static BatchAccountKeys RegenerateKey(this IBatchAccountOperations operations, string resourceGroupName, string accountName, AccountKeyType keyName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IBatchAccountOperations)s).RegenerateKeyAsync(resourceGroupName, accountName, keyName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.RegenerateKeyAsync(resourceGroupName, accountName, keyName).GetAwaiter().GetResult(); } /// - /// Regenerates the specified account key for the specified Batch account. + /// Regenerates the specified account key for the Batch account. /// /// /// The operations group for this extension method. @@ -444,7 +352,7 @@ public static BatchAccountKeys RegenerateKey(this IBatchAccountOperations operat /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RegenerateKeyAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, AccountKeyType keyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task RegenerateKeyAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, AccountKeyType keyName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.RegenerateKeyWithHttpMessagesAsync(resourceGroupName, accountName, keyName, null, cancellationToken).ConfigureAwait(false)) { @@ -455,6 +363,13 @@ public static BatchAccountKeys RegenerateKey(this IBatchAccountOperations operat /// /// Gets the account keys for the specified Batch account. /// + /// + /// This operation applies only to Batch accounts created with a + /// poolAllocationMode of 'BatchService'. If the Batch account was created with + /// a poolAllocationMode of 'UserSubscription', clients cannot use access to + /// keys to authenticate, and must use Azure Active Directory instead. In this + /// case, getting the keys will fail. + /// /// /// The operations group for this extension method. /// @@ -466,12 +381,19 @@ public static BatchAccountKeys RegenerateKey(this IBatchAccountOperations operat /// public static BatchAccountKeys GetKeys(this IBatchAccountOperations operations, string resourceGroupName, string accountName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IBatchAccountOperations)s).GetKeysAsync(resourceGroupName, accountName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetKeysAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } /// /// Gets the account keys for the specified Batch account. /// + /// + /// This operation applies only to Batch accounts created with a + /// poolAllocationMode of 'BatchService'. If the Batch account was created with + /// a poolAllocationMode of 'UserSubscription', clients cannot use access to + /// keys to authenticate, and must use Azure Active Directory instead. In this + /// case, getting the keys will fail. + /// /// /// The operations group for this extension method. /// @@ -484,7 +406,7 @@ public static BatchAccountKeys GetKeys(this IBatchAccountOperations operations, /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetKeysAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetKeysAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetKeysWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { @@ -492,6 +414,108 @@ public static BatchAccountKeys GetKeys(this IBatchAccountOperations operations, } } + /// + /// Creates a new Batch account with the specified parameters. Existing + /// accounts cannot be updated with this API and should instead be updated with + /// the Update Batch Account API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the new Batch account. + /// + /// + /// A name for the Batch account which must be unique within the region. Batch + /// account names must be between 3 and 24 characters in length and must use + /// only numbers and lowercase letters. This name is used as part of the DNS + /// name that is used to access the Batch service in the region in which the + /// account is created. For example: + /// http://accountname.region.batch.azure.com/. + /// + /// + /// Additional parameters for account creation. + /// + public static BatchAccount BeginCreate(this IBatchAccountOperations operations, string resourceGroupName, string accountName, BatchAccountCreateParameters parameters) + { + return operations.BeginCreateAsync(resourceGroupName, accountName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates a new Batch account with the specified parameters. Existing + /// accounts cannot be updated with this API and should instead be updated with + /// the Update Batch Account API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the new Batch account. + /// + /// + /// A name for the Batch account which must be unique within the region. Batch + /// account names must be between 3 and 24 characters in length and must use + /// only numbers and lowercase letters. This name is used as part of the DNS + /// name that is used to access the Batch service in the region in which the + /// account is created. For example: + /// http://accountname.region.batch.azure.com/. + /// + /// + /// Additional parameters for account creation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(resourceGroupName, accountName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified Batch account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the Batch account to be + /// deleted. + /// + /// + /// The name of the account to be deleted. + /// + public static BatchAccountDeleteHeaders BeginDelete(this IBatchAccountOperations operations, string resourceGroupName, string accountName) + { + return operations.BeginDeleteAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified Batch account. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group that contains the Batch account to be + /// deleted. + /// + /// + /// The name of the account to be deleted. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IBatchAccountOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// /// Gets information about the Batch accounts associated with the subscription. /// @@ -501,9 +525,9 @@ public static BatchAccountKeys GetKeys(this IBatchAccountOperations operations, /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListNext(this IBatchAccountOperations operations, string nextPageLink) + public static IPage ListNext(this IBatchAccountOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IBatchAccountOperations)s).ListNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -518,7 +542,7 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IBatchAccou /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IBatchAccountOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListNextAsync(this IBatchAccountOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -536,9 +560,9 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IBatchAccou /// /// The NextLink from the previous successful call to List operation. /// - public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IBatchAccountOperations operations, string nextPageLink) + public static IPage ListByResourceGroupNext(this IBatchAccountOperations operations, string nextPageLink) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IBatchAccountOperations)s).ListByResourceGroupNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -554,7 +578,7 @@ public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(t /// /// The cancellation token. /// - public static async Task> ListByResourceGroupNextAsync(this IBatchAccountOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task> ListByResourceGroupNextAsync(this IBatchAccountOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { @@ -564,3 +588,4 @@ public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(t } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/BatchManagementClient.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/BatchManagementClient.cs index 4db0f4580b30f..fd2fd3b3d90fb 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/BatchManagementClient.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/BatchManagementClient.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Rest.Serialization; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; - public partial class BatchManagementClient : Microsoft.Rest.ServiceClient, IBatchManagementClient, IAzureClient + public partial class BatchManagementClient : ServiceClient, IBatchManagementClient, IAzureClient { /// /// The base URI of the service. @@ -33,16 +41,16 @@ public partial class BatchManagementClient : Microsoft.Rest.ServiceClient /// Credentials needed for the client to connect to Azure. /// - public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } + public ServiceClientCredentials Credentials { get; private set; } /// - /// A unique identifier of a Microsoft Azure subscription. The subscription id + /// A unique identifier of a Microsoft Azure subscription. The subscription ID /// forms part of the URI for every service call. /// public string SubscriptionId { get; set; } /// - /// Client API Version. + /// The API version to be used with the HTTP request. /// public string ApiVersion { get; private set; } @@ -91,7 +99,7 @@ public partial class BatchManagementClient : Microsoft.Rest.ServiceClient protected BatchManagementClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) { - this.Initialize(); + Initialize(); } /// @@ -105,7 +113,7 @@ protected BatchManagementClient(params System.Net.Http.DelegatingHandler[] handl /// protected BatchManagementClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) { - this.Initialize(); + Initialize(); } /// @@ -126,7 +134,7 @@ protected BatchManagementClient(System.Uri baseUri, params System.Net.Http.Deleg { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -150,7 +158,7 @@ protected BatchManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHa { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -165,16 +173,16 @@ protected BatchManagementClient(System.Uri baseUri, System.Net.Http.HttpClientHa /// /// Thrown when a required parameter is null /// - public BatchManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public BatchManagementClient(ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -193,16 +201,16 @@ public BatchManagementClient(Microsoft.Rest.ServiceClientCredentials credentials /// /// Thrown when a required parameter is null /// - public BatchManagementClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public BatchManagementClient(ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -221,7 +229,7 @@ public BatchManagementClient(Microsoft.Rest.ServiceClientCredentials credentials /// /// Thrown when a required parameter is null /// - public BatchManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public BatchManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -231,11 +239,11 @@ public BatchManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCre { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -257,7 +265,7 @@ public BatchManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCre /// /// Thrown when a required parameter is null /// - public BatchManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public BatchManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -267,11 +275,11 @@ public BatchManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCre { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -284,15 +292,15 @@ public BatchManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCre /// private void Initialize() { - this.BatchAccount = new BatchAccountOperations(this); - this.ApplicationPackage = new ApplicationPackageOperations(this); - this.Application = new ApplicationOperations(this); - this.Location = new LocationOperations(this); - this.BaseUri = new System.Uri("https://management.azure.com"); - this.ApiVersion = "2015-12-01"; - this.AcceptLanguage = "en-US"; - this.LongRunningOperationRetryTimeout = 30; - this.GenerateClientRequestId = true; + BatchAccount = new BatchAccountOperations(this); + ApplicationPackage = new ApplicationPackageOperations(this); + Application = new ApplicationOperations(this); + Location = new LocationOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2017-01-01"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings { Formatting = Newtonsoft.Json.Formatting.Indented, @@ -300,28 +308,29 @@ private void Initialize() DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); + SerializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings { DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, - ContractResolver = new Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), + ContractResolver = new ReadOnlyJsonContractResolver(), Converters = new System.Collections.Generic.List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; CustomInitialize(); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.TransformationJsonConverter()); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); - } + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IApplicationOperations.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IApplicationOperations.cs index 3dddda683f7b1..5321160a60844 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IApplicationOperations.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IApplicationOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// ApplicationOperations operations. @@ -26,7 +33,7 @@ public partial interface IApplicationOperations /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The parameters for the request. @@ -46,7 +53,7 @@ public partial interface IApplicationOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, AddApplicationParameters parameters = default(AddApplicationParameters), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, AddApplicationParameters parameters = default(AddApplicationParameters), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes an application. /// @@ -57,7 +64,7 @@ public partial interface IApplicationOperations /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The headers that will be added to request. @@ -71,7 +78,7 @@ public partial interface IApplicationOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the specified application. /// @@ -82,7 +89,7 @@ public partial interface IApplicationOperations /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The headers that will be added to request. @@ -99,7 +106,7 @@ public partial interface IApplicationOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates settings for the specified application. /// @@ -110,7 +117,7 @@ public partial interface IApplicationOperations /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The parameters for the request. @@ -127,7 +134,7 @@ public partial interface IApplicationOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, UpdateApplicationParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, UpdateApplicationParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the applications in the specified account. /// @@ -155,7 +162,7 @@ public partial interface IApplicationOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, int? maxresults = default(int?), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, int? maxresults = default(int?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Lists all of the applications in the specified account. /// @@ -177,6 +184,7 @@ public partial interface IApplicationOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IApplicationPackageOperations.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IApplicationPackageOperations.cs index 5676c49cee78f..922a0246cc6d0 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IApplicationPackageOperations.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IApplicationPackageOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// ApplicationPackageOperations operations. @@ -26,7 +33,7 @@ public partial interface IApplicationPackageOperations /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application to activate. @@ -46,7 +53,7 @@ public partial interface IApplicationPackageOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task ActivateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, string format, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task ActivateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, string format, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Creates an application package record. /// @@ -57,7 +64,7 @@ public partial interface IApplicationPackageOperations /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application. @@ -77,7 +84,7 @@ public partial interface IApplicationPackageOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes an application package record and its associated binary /// file. @@ -89,7 +96,7 @@ public partial interface IApplicationPackageOperations /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application to delete. @@ -106,7 +113,7 @@ public partial interface IApplicationPackageOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the specified application package. /// @@ -117,7 +124,7 @@ public partial interface IApplicationPackageOperations /// The name of the Batch account. /// /// - /// The id of the application. + /// The ID of the application. /// /// /// The version of the application. @@ -137,6 +144,7 @@ public partial interface IApplicationPackageOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, string applicationId, string version, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IBatchAccountOperations.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IBatchAccountOperations.cs index 82e685557ab53..20d5896d14f86 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IBatchAccountOperations.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IBatchAccountOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// BatchAccountOperations operations. @@ -17,20 +24,20 @@ namespace Microsoft.Azure.Management.Batch public partial interface IBatchAccountOperations { /// - /// Creates a new Batch account with the specified parameters. - /// Existing accounts cannot be updated with this API and should - /// instead be updated with the Update Batch Account API. + /// Creates a new Batch account with the specified parameters. Existing + /// accounts cannot be updated with this API and should instead be + /// updated with the Update Batch Account API. /// /// /// The name of the resource group that contains the new Batch account. /// /// /// A name for the Batch account which must be unique within the - /// region. Batch account names must be between 3 and 24 characters - /// in length and must use only numbers and lowercase letters. This - /// name is used as part of the DNS name that is used to access the - /// Batch service in the region in which the account is created. For - /// example: http://accountname.region.batch.azure.com/. + /// region. Batch account names must be between 3 and 24 characters in + /// length and must use only numbers and lowercase letters. This name + /// is used as part of the DNS name that is used to access the Batch + /// service in the region in which the account is created. For example: + /// http://accountname.region.batch.azure.com/. /// /// /// Additional parameters for account creation. @@ -50,42 +57,7 @@ public partial interface IBatchAccountOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Creates a new Batch account with the specified parameters. - /// Existing accounts cannot be updated with this API and should - /// instead be updated with the Update Batch Account API. - /// - /// - /// The name of the resource group that contains the new Batch account. - /// - /// - /// A name for the Batch account which must be unique within the - /// region. Batch account names must be between 3 and 24 characters - /// in length and must use only numbers and lowercase letters. This - /// name is used as part of the DNS name that is used to access the - /// Batch service in the region in which the account is created. For - /// example: http://accountname.region.batch.azure.com/. - /// - /// - /// Additional parameters for account creation. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Updates the properties of an existing Batch account. /// @@ -113,30 +85,7 @@ public partial interface IBatchAccountOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountUpdateParameters parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - /// - /// Deletes the specified Batch account. - /// - /// - /// The name of the resource group that contains the Batch account to - /// be deleted. - /// - /// - /// The name of the account to be deleted. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes the specified Batch account. /// @@ -159,7 +108,7 @@ public partial interface IBatchAccountOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the specified Batch account. /// @@ -184,7 +133,7 @@ public partial interface IBatchAccountOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the Batch accounts associated with the /// subscription. @@ -204,7 +153,7 @@ public partial interface IBatchAccountOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the Batch accounts associated within the /// specified resource group. @@ -227,7 +176,7 @@ public partial interface IBatchAccountOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Synchronizes access keys for the auto storage account configured /// for the specified Batch account. @@ -250,10 +199,9 @@ public partial interface IBatchAccountOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task SynchronizeAutoStorageKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task SynchronizeAutoStorageKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Regenerates the specified account key for the specified Batch - /// account. + /// Regenerates the specified account key for the Batch account. /// /// /// The name of the resource group that contains the Batch account. @@ -280,10 +228,17 @@ public partial interface IBatchAccountOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, AccountKeyType keyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> RegenerateKeyWithHttpMessagesAsync(string resourceGroupName, string accountName, AccountKeyType keyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets the account keys for the specified Batch account. /// + /// + /// This operation applies only to Batch accounts created with a + /// poolAllocationMode of 'BatchService'. If the Batch account was + /// created with a poolAllocationMode of 'UserSubscription', clients + /// cannot use access to keys to authenticate, and must use Azure + /// Active Directory instead. In this case, getting the keys will fail. + /// /// /// The name of the resource group that contains the Batch account. /// @@ -305,7 +260,65 @@ public partial interface IBatchAccountOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetKeysWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new Batch account with the specified parameters. Existing + /// accounts cannot be updated with this API and should instead be + /// updated with the Update Batch Account API. + /// + /// + /// The name of the resource group that contains the new Batch account. + /// + /// + /// A name for the Batch account which must be unique within the + /// region. Batch account names must be between 3 and 24 characters in + /// length and must use only numbers and lowercase letters. This name + /// is used as part of the DNS name that is used to access the Batch + /// service in the region in which the account is created. For example: + /// http://accountname.region.batch.azure.com/. + /// + /// + /// Additional parameters for account creation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, BatchAccountCreateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified Batch account. + /// + /// + /// The name of the resource group that contains the Batch account to + /// be deleted. + /// + /// + /// The name of the account to be deleted. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the Batch accounts associated with the /// subscription. @@ -328,7 +341,7 @@ public partial interface IBatchAccountOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets information about the Batch accounts associated within the /// specified resource group. @@ -351,6 +364,7 @@ public partial interface IBatchAccountOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IBatchManagementClient.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IBatchManagementClient.cs index 3ccada94247ed..8dfc08c761614 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IBatchManagementClient.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/IBatchManagementClient.cs @@ -1,16 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; /// /// @@ -34,16 +37,16 @@ public partial interface IBatchManagementClient : System.IDisposable /// /// Credentials needed for the client to connect to Azure. /// - Microsoft.Rest.ServiceClientCredentials Credentials { get; } + ServiceClientCredentials Credentials { get; } /// /// A unique identifier of a Microsoft Azure subscription. The - /// subscription id forms part of the URI for every service call. + /// subscription ID forms part of the URI for every service call. /// string SubscriptionId { get; set; } /// - /// Client API Version. + /// The API version to be used with the HTTP request. /// string ApiVersion { get; } @@ -59,8 +62,8 @@ public partial interface IBatchManagementClient : System.IDisposable int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is - /// generated and included in each request. Default is true. + /// When set to true a unique x-ms-client-request-id value is generated + /// and included in each request. Default is true. /// bool? GenerateClientRequestId { get; set; } @@ -87,3 +90,4 @@ public partial interface IBatchManagementClient : System.IDisposable } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ILocationOperations.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ILocationOperations.cs index 6a42cccefcb5a..821f0e44875f7 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ILocationOperations.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/ILocationOperations.cs @@ -1,15 +1,22 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// LocationOperations operations. @@ -17,8 +24,8 @@ namespace Microsoft.Azure.Management.Batch public partial interface ILocationOperations { /// - /// Gets the Batch service quotas for the specified subscription at - /// the given location. + /// Gets the Batch service quotas for the specified subscription at the + /// given location. /// /// /// The desired region for the quotas. @@ -38,6 +45,7 @@ public partial interface ILocationOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetQuotasWithHttpMessagesAsync(string locationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetQuotasWithHttpMessagesAsync(string locationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/LocationOperations.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/LocationOperations.cs index 7d384588f569d..7ff2522dff078 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/LocationOperations.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/LocationOperations.cs @@ -1,22 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { - using System.Linq; - using Microsoft.Rest; - using Microsoft.Rest.Azure; + using Azure; + using Management; + using Rest; + using Rest.Azure; using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; /// /// LocationOperations operations. /// - internal partial class LocationOperations : Microsoft.Rest.IServiceOperations, ILocationOperations + internal partial class LocationOperations : IServiceOperations, ILocationOperations { /// /// Initializes a new instance of the LocationOperations class. @@ -29,11 +38,11 @@ internal partial class LocationOperations : Microsoft.Rest.IServiceOperations internal LocationOperations(BatchManagementClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -54,74 +63,77 @@ internal LocationOperations(BatchManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// - /// + /// /// Thrown when unable to deserialize the response /// - /// + /// + /// Thrown when a required parameter is null + /// + /// /// Thrown when a required parameter is null /// /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetQuotasWithHttpMessagesAsync(string locationName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetQuotasWithHttpMessagesAsync(string locationName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (locationName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "locationName"); + throw new ValidationException(ValidationRules.CannotBeNull, "locationName"); } - if (this.Client.ApiVersion == null) + if (Client.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("locationName", locationName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "GetQuotas", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetQuotas", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/quotas").ToString(); _url = _url.Replace("{locationName}", System.Uri.EscapeDataString(locationName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { - _url += "?" + string.Join("&", _queryParameters); + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); + var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } if (customHeaders != null) { @@ -138,35 +150,35 @@ internal LocationOperations(BatchManagementClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -174,15 +186,15 @@ internal LocationOperations(BatchManagementClient client) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_httpResponse.Headers.Contains("x-ms-request-id")) { ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -192,7 +204,7 @@ internal LocationOperations(BatchManagementClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -205,7 +217,7 @@ internal LocationOperations(BatchManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { @@ -214,15 +226,16 @@ internal LocationOperations(BatchManagementClient client) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/LocationOperationsExtensions.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/LocationOperationsExtensions.cs index de407e78608a6..ce9076963c495 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/LocationOperationsExtensions.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/LocationOperationsExtensions.cs @@ -1,16 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch { + using Azure; + using Management; + using Rest; + using Rest.Azure; + using Models; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for LocationOperations. @@ -29,7 +33,7 @@ public static partial class LocationOperationsExtensions /// public static BatchLocationQuota GetQuotas(this ILocationOperations operations, string locationName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((ILocationOperations)s).GetQuotasAsync(locationName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetQuotasAsync(locationName).GetAwaiter().GetResult(); } /// @@ -45,7 +49,7 @@ public static BatchLocationQuota GetQuotas(this ILocationOperations operations, /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetQuotasAsync(this ILocationOperations operations, string locationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetQuotasAsync(this ILocationOperations operations, string locationName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetQuotasWithHttpMessagesAsync(locationName, null, cancellationToken).ConfigureAwait(false)) { @@ -55,3 +59,4 @@ public static BatchLocationQuota GetQuotas(this ILocationOperations operations, } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AccountKeyType.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AccountKeyType.cs index b1612fe49dbe1..010c12a45581b 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AccountKeyType.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AccountKeyType.cs @@ -1,23 +1,31 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for AccountKeyType. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum AccountKeyType { - [System.Runtime.Serialization.EnumMember(Value = "Primary")] + [EnumMember(Value = "Primary")] Primary, - [System.Runtime.Serialization.EnumMember(Value = "Secondary")] + [EnumMember(Value = "Secondary")] Secondary } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/ActivateApplicationPackageParameters.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/ActivateApplicationPackageParameters.cs index e9cfe3ff968a3..181a81e582668 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/ActivateApplicationPackageParameters.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/ActivateApplicationPackageParameters.cs @@ -1,13 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -36,21 +41,22 @@ public ActivateApplicationPackageParameters(string format) /// /// Gets or sets the format of the application package binary file. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "format")] + [JsonProperty(PropertyName = "format")] public string Format { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Format == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Format"); + throw new ValidationException(ValidationRules.CannotBeNull, "Format"); } } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AddApplicationParameters.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AddApplicationParameters.cs index c48703f4de00d..6fa66305c4717 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AddApplicationParameters.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AddApplicationParameters.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Newtonsoft.Json; using System.Linq; /// @@ -38,14 +42,15 @@ public AddApplicationParameters() { } /// Gets or sets a value indicating whether packages within the /// application may be overwritten using the same version string. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "allowUpdates")] + [JsonProperty(PropertyName = "allowUpdates")] public bool? AllowUpdates { get; set; } /// /// Gets or sets the display name for the application. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/Application.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/Application.cs index dc668b5f9423c..3c9ca8f0db09a 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/Application.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/Application.cs @@ -1,13 +1,19 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -34,7 +40,7 @@ public Application() { } /// string. /// The package to use if a client /// requests the application but does not specify a version. - public Application(string id = default(string), string displayName = default(string), System.Collections.Generic.IList packages = default(System.Collections.Generic.IList), bool? allowUpdates = default(bool?), string defaultVersion = default(string)) + public Application(string id = default(string), string displayName = default(string), IList packages = default(IList), bool? allowUpdates = default(bool?), string defaultVersion = default(string)) { Id = id; DisplayName = displayName; @@ -47,34 +53,35 @@ public Application() { } /// Gets or sets a string that uniquely identifies the application /// within the account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; set; } /// /// Gets or sets the display name for the application. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } /// /// Gets or sets the list of packages under this application. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "packages")] - public System.Collections.Generic.IList Packages { get; set; } + [JsonProperty(PropertyName = "packages")] + public IList Packages { get; set; } /// /// Gets or sets a value indicating whether packages within the /// application may be overwritten using the same version string. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "allowUpdates")] + [JsonProperty(PropertyName = "allowUpdates")] public bool? AllowUpdates { get; set; } /// /// Gets or sets the package to use if a client requests the /// application but does not specify a version. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "defaultVersion")] + [JsonProperty(PropertyName = "defaultVersion")] public string DefaultVersion { get; set; } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/ApplicationPackage.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/ApplicationPackage.cs index bbd9b63191398..e9800655bf7b6 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/ApplicationPackage.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/ApplicationPackage.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Newtonsoft.Json; using System.Linq; /// @@ -24,7 +28,7 @@ public ApplicationPackage() { } /// /// Initializes a new instance of the ApplicationPackage class. /// - /// The id of the application. + /// The ID of the application. /// The version of the application package. /// /// The current state of the application package. @@ -49,50 +53,50 @@ public ApplicationPackage() { } } /// - /// Gets or sets the id of the application. + /// Gets the ID of the application. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [JsonProperty(PropertyName = "id")] + public string Id { get; protected set; } /// - /// Gets or sets the version of the application package. + /// Gets the version of the application package. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "version")] - public string Version { get; set; } + [JsonProperty(PropertyName = "version")] + public string Version { get; protected set; } /// - /// Gets or sets the current state of the application package. - /// Possible values include: 'pending', 'active', 'unmapped' + /// Gets the current state of the application package. Possible values + /// include: 'pending', 'active', 'unmapped' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "state")] - public PackageState? State { get; set; } + [JsonProperty(PropertyName = "state")] + public PackageState? State { get; protected set; } /// - /// Gets or sets the format of the application package, if the package - /// is active. + /// Gets the format of the application package, if the package is + /// active. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "format")] - public string Format { get; set; } + [JsonProperty(PropertyName = "format")] + public string Format { get; protected set; } /// - /// Gets or sets the storage URL at which the application package is - /// stored. + /// Gets the storage URL at which the application package is stored. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "storageUrl")] - public string StorageUrl { get; set; } + [JsonProperty(PropertyName = "storageUrl")] + public string StorageUrl { get; protected set; } /// - /// Gets or sets the UTC time at which the storage URL will expire. + /// Gets the UTC time at which the storage URL will expire. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "storageUrlExpiry")] - public System.DateTime? StorageUrlExpiry { get; set; } + [JsonProperty(PropertyName = "storageUrlExpiry")] + public System.DateTime? StorageUrlExpiry { get; protected set; } /// - /// Gets or sets the time at which the package was last activated, if - /// the package is active. + /// Gets the time at which the package was last activated, if the + /// package is active. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastActivationTime")] - public System.DateTime? LastActivationTime { get; set; } + [JsonProperty(PropertyName = "lastActivationTime")] + public System.DateTime? LastActivationTime { get; protected set; } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AutoStorageBaseProperties.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AutoStorageBaseProperties.cs index 11719f3ea75cd..225b315592924 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AutoStorageBaseProperties.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AutoStorageBaseProperties.cs @@ -1,13 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -23,7 +28,7 @@ public AutoStorageBaseProperties() { } /// /// Initializes a new instance of the AutoStorageBaseProperties class. /// - /// The resource id of the storage + /// The resource ID of the storage /// account to be used for auto storage account. public AutoStorageBaseProperties(string storageAccountId) { @@ -31,24 +36,25 @@ public AutoStorageBaseProperties(string storageAccountId) } /// - /// Gets or sets the resource id of the storage account to be used for + /// Gets or sets the resource ID of the storage account to be used for /// auto storage account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountId")] + [JsonProperty(PropertyName = "storageAccountId")] public string StorageAccountId { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (StorageAccountId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageAccountId"); + throw new ValidationException(ValidationRules.CannotBeNull, "StorageAccountId"); } } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AutoStorageProperties.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AutoStorageProperties.cs index 29099a8a211f8..5902d82fa1b97 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AutoStorageProperties.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/AutoStorageProperties.cs @@ -1,13 +1,18 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -24,7 +29,7 @@ public AutoStorageProperties() { } /// /// Initializes a new instance of the AutoStorageProperties class. /// - /// The resource id of the storage + /// The resource ID of the storage /// account to be used for auto storage account. /// The UTC time at which storage keys were /// last synchronized with the Batch account. @@ -35,31 +40,32 @@ public AutoStorageProperties(string storageAccountId, System.DateTime lastKeySyn } /// - /// Gets or sets the resource id of the storage account to be used for + /// Gets or sets the resource ID of the storage account to be used for /// auto storage account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "storageAccountId")] + [JsonProperty(PropertyName = "storageAccountId")] public string StorageAccountId { get; set; } /// /// Gets or sets the UTC time at which storage keys were last /// synchronized with the Batch account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "lastKeySync")] + [JsonProperty(PropertyName = "lastKeySync")] public System.DateTime LastKeySync { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (StorageAccountId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "StorageAccountId"); + throw new ValidationException(ValidationRules.CannotBeNull, "StorageAccountId"); } } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccount.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccount.cs index e9e32da54b609..ff6baf06f945d 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccount.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccount.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Contains information about an Azure Batch account. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class BatchAccount : Resource { /// @@ -24,13 +32,7 @@ public BatchAccount() { } /// /// Initializes a new instance of the BatchAccount class. /// - /// The core quota for this Batch - /// account. - /// The pool quota for this Batch - /// account. - /// The active job and job - /// schedule quota for this Batch account. - /// The id of the resource + /// The ID of the resource /// The name of the resource /// The type of the resource /// The location of the resource @@ -40,13 +42,25 @@ public BatchAccount() { } /// The provisioned state of the /// resource. Possible values include: 'Invalid', 'Creating', /// 'Deleting', 'Succeeded', 'Failed', 'Cancelled' + /// The allocation mode to use for + /// creating pools in the Batch account. + /// A reference to the Azure key vault + /// associated with the Batch account. /// The properties and status of any auto - /// storage account associated with the account. - public BatchAccount(int coreQuota, int poolQuota, int activeJobAndJobScheduleQuota, string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string accountEndpoint = default(string), ProvisioningState? provisioningState = default(ProvisioningState?), AutoStorageProperties autoStorage = default(AutoStorageProperties)) + /// storage account associated with the Batch account. + /// The core quota for this Batch + /// account. + /// The pool quota for this Batch + /// account. + /// The active job and job + /// schedule quota for this Batch account. + public BatchAccount(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string accountEndpoint = default(string), ProvisioningState provisioningState = default(ProvisioningState), PoolAllocationMode? poolAllocationMode = default(PoolAllocationMode?), KeyVaultReference keyVaultReference = default(KeyVaultReference), AutoStorageProperties autoStorage = default(AutoStorageProperties), int coreQuota = default(int), int poolQuota = default(int), int activeJobAndJobScheduleQuota = default(int)) : base(id, name, type, location, tags) { AccountEndpoint = accountEndpoint; ProvisioningState = provisioningState; + PoolAllocationMode = poolAllocationMode; + KeyVaultReference = keyVaultReference; AutoStorage = autoStorage; CoreQuota = coreQuota; PoolQuota = poolQuota; @@ -57,55 +71,76 @@ public BatchAccount() { } /// Gets the endpoint used by this account to interact with the Batch /// services. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.accountEndpoint")] - public string AccountEndpoint { get; private set; } + [JsonProperty(PropertyName = "properties.accountEndpoint")] + public string AccountEndpoint { get; protected set; } /// - /// Gets or sets the provisioned state of the resource. Possible - /// values include: 'Invalid', 'Creating', 'Deleting', 'Succeeded', - /// 'Failed', 'Cancelled' + /// Gets the provisioned state of the resource. Possible values + /// include: 'Invalid', 'Creating', 'Deleting', 'Succeeded', 'Failed', + /// 'Cancelled' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.provisioningState")] - public ProvisioningState? ProvisioningState { get; set; } + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState ProvisioningState { get; protected set; } /// - /// Gets or sets the properties and status of any auto storage account - /// associated with the account. + /// Gets the allocation mode to use for creating pools in the Batch + /// account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoStorage")] - public AutoStorageProperties AutoStorage { get; set; } + /// + /// Possible values include: 'BatchService', 'UserSubscription' + /// + [JsonProperty(PropertyName = "properties.poolAllocationMode")] + public PoolAllocationMode? PoolAllocationMode { get; protected set; } /// - /// Gets or sets the core quota for this Batch account. + /// Gets a reference to the Azure key vault associated with the Batch + /// account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.coreQuota")] - public int CoreQuota { get; set; } + [JsonProperty(PropertyName = "properties.keyVaultReference")] + public KeyVaultReference KeyVaultReference { get; protected set; } /// - /// Gets or sets the pool quota for this Batch account. + /// Gets the properties and status of any auto storage account + /// associated with the Batch account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.poolQuota")] - public int PoolQuota { get; set; } + [JsonProperty(PropertyName = "properties.autoStorage")] + public AutoStorageProperties AutoStorage { get; protected set; } /// - /// Gets or sets the active job and job schedule quota for this Batch - /// account. + /// Gets the core quota for this Batch account. + /// + [JsonProperty(PropertyName = "properties.coreQuota")] + public int CoreQuota { get; protected set; } + + /// + /// Gets the pool quota for this Batch account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.activeJobAndJobScheduleQuota")] - public int ActiveJobAndJobScheduleQuota { get; set; } + [JsonProperty(PropertyName = "properties.poolQuota")] + public int PoolQuota { get; protected set; } + + /// + /// Gets the active job and job schedule quota for this Batch account. + /// + [JsonProperty(PropertyName = "properties.activeJobAndJobScheduleQuota")] + public int ActiveJobAndJobScheduleQuota { get; protected set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.AutoStorage != null) + if (KeyVaultReference != null) { - this.AutoStorage.Validate(); + KeyVaultReference.Validate(); + } + if (AutoStorage != null) + { + AutoStorage.Validate(); } } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountCreateHeaders.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountCreateHeaders.cs new file mode 100644 index 0000000000000..82cb8543b221e --- /dev/null +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountCreateHeaders.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Batch.Models +{ + using Azure; + using Management; + using Batch; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Create operation. + /// + public partial class BatchAccountCreateHeaders + { + /// + /// Initializes a new instance of the BatchAccountCreateHeaders class. + /// + public BatchAccountCreateHeaders() { } + + /// + /// Initializes a new instance of the BatchAccountCreateHeaders class. + /// + /// The URL of the resource used to check the + /// status of the asynchronous operation. + /// Suggested delay to check the status of the + /// asynchronous operation. The value is an integer that represents the + /// seconds. + public BatchAccountCreateHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + } + + /// + /// Gets or sets the URL of the resource used to check the status of + /// the asynchronous operation. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets suggested delay to check the status of the + /// asynchronous operation. The value is an integer that represents the + /// seconds. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountCreateParameters.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountCreateParameters.cs index 066b5b501cf20..d692a854bf465 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountCreateParameters.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountCreateParameters.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Parameters supplied to the Create operation. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class BatchAccountCreateParameters { /// @@ -32,47 +40,80 @@ public BatchAccountCreateParameters() { } /// account. /// The properties related to auto storage /// account. - public BatchAccountCreateParameters(string location, System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), AutoStorageBaseProperties autoStorage = default(AutoStorageBaseProperties)) + /// The allocation mode to use for + /// creating pools in the Batch account. + /// A reference to the Azure key vault + /// associated with the Batch account. + public BatchAccountCreateParameters(string location, IDictionary tags = default(IDictionary), AutoStorageBaseProperties autoStorage = default(AutoStorageBaseProperties), PoolAllocationMode? poolAllocationMode = default(PoolAllocationMode?), KeyVaultReference keyVaultReference = default(KeyVaultReference)) { Location = location; Tags = tags; AutoStorage = autoStorage; + PoolAllocationMode = poolAllocationMode; + KeyVaultReference = keyVaultReference; } /// /// Gets or sets the region in which to create the account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + [JsonProperty(PropertyName = "location")] public string Location { get; set; } /// /// Gets or sets the user specified tags associated with the account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] - public System.Collections.Generic.IDictionary Tags { get; set; } + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } /// /// Gets or sets the properties related to auto storage account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoStorage")] + [JsonProperty(PropertyName = "properties.autoStorage")] public AutoStorageBaseProperties AutoStorage { get; set; } + /// + /// Gets or sets the allocation mode to use for creating pools in the + /// Batch account. + /// + /// + /// The pool allocation mode also affects how clients may authenticate + /// to the Batch Service API. If the mode is BatchService, clients may + /// authenticate using access keys or Azure Active Directory. If the + /// mode is UserSubscription, clients must use Azure Active Directory. + /// The default is BatchService. Possible values include: + /// 'BatchService', 'UserSubscription' + /// + [JsonProperty(PropertyName = "properties.poolAllocationMode")] + public PoolAllocationMode? PoolAllocationMode { get; set; } + + /// + /// Gets or sets a reference to the Azure key vault associated with the + /// Batch account. + /// + [JsonProperty(PropertyName = "properties.keyVaultReference")] + public KeyVaultReference KeyVaultReference { get; set; } + /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Location == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Location"); + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + if (AutoStorage != null) + { + AutoStorage.Validate(); } - if (this.AutoStorage != null) + if (KeyVaultReference != null) { - this.AutoStorage.Validate(); + KeyVaultReference.Validate(); } } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountDeleteHeaders.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountDeleteHeaders.cs new file mode 100644 index 0000000000000..191eb024a878c --- /dev/null +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountDeleteHeaders.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Batch.Models +{ + using Azure; + using Management; + using Batch; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines headers for Delete operation. + /// + public partial class BatchAccountDeleteHeaders + { + /// + /// Initializes a new instance of the BatchAccountDeleteHeaders class. + /// + public BatchAccountDeleteHeaders() { } + + /// + /// Initializes a new instance of the BatchAccountDeleteHeaders class. + /// + /// The URL of the resource used to check the + /// status of the asynchronous operation. + /// Suggested delay to check the status of the + /// asynchronous operation. The value is an integer that represents the + /// seconds. + public BatchAccountDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + { + Location = location; + RetryAfter = retryAfter; + } + + /// + /// Gets or sets the URL of the resource used to check the status of + /// the asynchronous operation. + /// + [JsonProperty(PropertyName = "Location")] + public string Location { get; set; } + + /// + /// Gets or sets suggested delay to check the status of the + /// asynchronous operation. The value is an integer that represents the + /// seconds. + /// + [JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter { get; set; } + + } +} + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountKeys.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountKeys.cs index b782765cabd0b..538919e052aad 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountKeys.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountKeys.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Newtonsoft.Json; using System.Linq; /// @@ -34,16 +38,17 @@ public BatchAccountKeys() { } } /// - /// Gets or sets the primary key associated with the account. + /// Gets the primary key associated with the account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "primary")] - public string Primary { get; set; } + [JsonProperty(PropertyName = "primary")] + public string Primary { get; protected set; } /// - /// Gets or sets the secondary key associated with the account. + /// Gets the secondary key associated with the account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "secondary")] - public string Secondary { get; set; } + [JsonProperty(PropertyName = "secondary")] + public string Secondary { get; protected set; } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountRegenerateKeyParameters.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountRegenerateKeyParameters.cs index 1f920b414125e..c8ff4eb7d4033 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountRegenerateKeyParameters.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountRegenerateKeyParameters.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Newtonsoft.Json; using System.Linq; /// @@ -33,16 +37,16 @@ public BatchAccountRegenerateKeyParameters(AccountKeyType keyName) } /// - /// Gets or sets the type of account key to regenerate. Possible - /// values include: 'Primary', 'Secondary' + /// Gets or sets the type of account key to regenerate. Possible values + /// include: 'Primary', 'Secondary' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "keyName")] + [JsonProperty(PropertyName = "keyName")] public AccountKeyType KeyName { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() @@ -50,3 +54,4 @@ public virtual void Validate() } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountUpdateParameters.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountUpdateParameters.cs index 41fe929c20dc7..d29b591de572e 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountUpdateParameters.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchAccountUpdateParameters.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Rest; + using Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Parameters supplied to the Update operation. /// - [Microsoft.Rest.Serialization.JsonTransformation] + [JsonTransformation] public partial class BatchAccountUpdateParameters { /// @@ -30,36 +38,69 @@ public BatchAccountUpdateParameters() { } /// account. /// The properties related to auto storage /// account. - public BatchAccountUpdateParameters(System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), AutoStorageBaseProperties autoStorage = default(AutoStorageBaseProperties)) + /// The allocation mode to use for + /// creating pools in the Batch account. + /// A reference to the Azure key vault + /// associated with the Batch account. + public BatchAccountUpdateParameters(IDictionary tags = default(IDictionary), AutoStorageBaseProperties autoStorage = default(AutoStorageBaseProperties), PoolAllocationMode? poolAllocationMode = default(PoolAllocationMode?), KeyVaultReference keyVaultReference = default(KeyVaultReference)) { Tags = tags; AutoStorage = autoStorage; + PoolAllocationMode = poolAllocationMode; + KeyVaultReference = keyVaultReference; } /// /// Gets or sets the user specified tags associated with the account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] - public System.Collections.Generic.IDictionary Tags { get; set; } + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } /// /// Gets or sets the properties related to auto storage account. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties.autoStorage")] + [JsonProperty(PropertyName = "properties.autoStorage")] public AutoStorageBaseProperties AutoStorage { get; set; } + /// + /// Gets or sets the allocation mode to use for creating pools in the + /// Batch account. + /// + /// + /// The pool allocation mode also affects how clients may authenticate + /// to the Batch Service API. If the mode is BatchService, clients may + /// authenticate using access keys or Azure Active Directory. If the + /// mode is UserSubscription, clients must use Azure Active Directory. + /// The default is BatchService. Possible values include: + /// 'BatchService', 'UserSubscription' + /// + [JsonProperty(PropertyName = "properties.poolAllocationMode")] + public PoolAllocationMode? PoolAllocationMode { get; set; } + + /// + /// Gets or sets a reference to the Azure key vault associated with the + /// Batch account. + /// + [JsonProperty(PropertyName = "properties.keyVaultReference")] + public KeyVaultReference KeyVaultReference { get; set; } + /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { - if (this.AutoStorage != null) + if (AutoStorage != null) + { + AutoStorage.Validate(); + } + if (KeyVaultReference != null) { - this.AutoStorage.Validate(); + KeyVaultReference.Validate(); } } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchLocationQuota.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchLocationQuota.cs index d1364afdd1156..a8a87ff448c9b 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchLocationQuota.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/BatchLocationQuota.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Newtonsoft.Json; using System.Linq; /// @@ -23,19 +27,20 @@ public BatchLocationQuota() { } /// /// Initializes a new instance of the BatchLocationQuota class. /// - /// The number of Batch accounts that may - /// be created under the subscription in the specified region. + /// The number of Batch accounts that may be + /// created under the subscription in the specified region. public BatchLocationQuota(int? accountQuota = default(int?)) { AccountQuota = accountQuota; } /// - /// Gets or sets the number of Batch accounts that may be created - /// under the subscription in the specified region. + /// Gets the number of Batch accounts that may be created under the + /// subscription in the specified region. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "accountQuota")] - public int? AccountQuota { get; set; } + [JsonProperty(PropertyName = "accountQuota")] + public int? AccountQuota { get; protected set; } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/KeyVaultReference.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/KeyVaultReference.cs new file mode 100644 index 0000000000000..ee43fb650b073 --- /dev/null +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/KeyVaultReference.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Batch.Models +{ + using Azure; + using Management; + using Batch; + using Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Identifies the Azure key vault associated with a Batch account. + /// + public partial class KeyVaultReference + { + /// + /// Initializes a new instance of the KeyVaultReference class. + /// + public KeyVaultReference() { } + + /// + /// Initializes a new instance of the KeyVaultReference class. + /// + /// The resource ID of the Azure key vault associated + /// with the Batch account. + /// The Url of the Azure key vault associated with + /// the Batch account. + public KeyVaultReference(string id, string url) + { + Id = id; + Url = url; + } + + /// + /// Gets or sets the resource ID of the Azure key vault associated with + /// the Batch account. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// Gets or sets the Url of the Azure key vault associated with the + /// Batch account. + /// + [JsonProperty(PropertyName = "url")] + public string Url { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Id == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Id"); + } + if (Url == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Url"); + } + } + } +} + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/PackageState.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/PackageState.cs index 96b5e4fa96792..bc54ceea61cd7 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/PackageState.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/PackageState.cs @@ -1,25 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for PackageState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum PackageState { - [System.Runtime.Serialization.EnumMember(Value = "pending")] + [EnumMember(Value = "pending")] Pending, - [System.Runtime.Serialization.EnumMember(Value = "active")] + [EnumMember(Value = "active")] Active, - [System.Runtime.Serialization.EnumMember(Value = "unmapped")] + [EnumMember(Value = "unmapped")] Unmapped } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/Page.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/Page.cs index 7b974ff177459..9954bc71ae856 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/Page.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/Page.cs @@ -1,46 +1,55 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Rest; + using Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; /// /// Defines a page in Azure responses. /// /// Type of the page content items - [Newtonsoft.Json.JsonObject] - public class Page : Microsoft.Rest.Azure.IPage + [JsonObject] + public class Page : IPage { /// /// Gets the link to the next page. /// - [Newtonsoft.Json.JsonProperty("nextLink")] - public System.String NextPageLink { get; private set; } + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } - [Newtonsoft.Json.JsonProperty("value")] - private System.Collections.Generic.IList Items{ get; set; } + [JsonProperty("value")] + private IList Items{ get; set; } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - public System.Collections.Generic.IEnumerator GetEnumerator() + public IEnumerator GetEnumerator() { - return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); } /// /// Returns an enumerator that iterates through the collection. /// /// A an enumerator that can be used to iterate through the collection. - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/PoolAllocationMode.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/PoolAllocationMode.cs new file mode 100644 index 0000000000000..ea9457c50785c --- /dev/null +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/PoolAllocationMode.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.Batch.Models +{ + using Azure; + using Management; + using Batch; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for PoolAllocationMode. + /// + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + public enum PoolAllocationMode + { + [EnumMember(Value = "BatchService")] + BatchService, + [EnumMember(Value = "UserSubscription")] + UserSubscription + } +} + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/ProvisioningState.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/ProvisioningState.cs index 5b8e55c96b6e6..dc281acbcfca2 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/ProvisioningState.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/ProvisioningState.cs @@ -1,31 +1,39 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; /// /// Defines values for ProvisioningState. /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] + [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum ProvisioningState { - [System.Runtime.Serialization.EnumMember(Value = "Invalid")] + [EnumMember(Value = "Invalid")] Invalid, - [System.Runtime.Serialization.EnumMember(Value = "Creating")] + [EnumMember(Value = "Creating")] Creating, - [System.Runtime.Serialization.EnumMember(Value = "Deleting")] + [EnumMember(Value = "Deleting")] Deleting, - [System.Runtime.Serialization.EnumMember(Value = "Succeeded")] + [EnumMember(Value = "Succeeded")] Succeeded, - [System.Runtime.Serialization.EnumMember(Value = "Failed")] + [EnumMember(Value = "Failed")] Failed, - [System.Runtime.Serialization.EnumMember(Value = "Cancelled")] + [EnumMember(Value = "Cancelled")] Cancelled } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/Resource.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/Resource.cs index b88ad83c9281b..7c88e191ba427 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/Resource.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/Resource.cs @@ -1,19 +1,27 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Rest; + using Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// A definition of an Azure resource. /// - public partial class Resource : Microsoft.Rest.Azure.IResource + public partial class Resource : IResource { /// /// Initializes a new instance of the Resource class. @@ -23,12 +31,12 @@ public Resource() { } /// /// Initializes a new instance of the Resource class. /// - /// The id of the resource + /// The ID of the resource /// The name of the resource /// The type of the resource /// The location of the resource /// The tags of the resource - public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary)) { Id = id; Name = name; @@ -38,34 +46,35 @@ public Resource() { } } /// - /// Gets the id of the resource + /// Gets the ID of the resource /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] - public string Id { get; private set; } + [JsonProperty(PropertyName = "id")] + public string Id { get; protected set; } /// /// Gets the name of the resource /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] - public string Name { get; private set; } + [JsonProperty(PropertyName = "name")] + public string Name { get; protected set; } /// /// Gets the type of the resource /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + [JsonProperty(PropertyName = "type")] + public string Type { get; protected set; } /// - /// Gets or sets the location of the resource + /// Gets the location of the resource /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [JsonProperty(PropertyName = "location")] + public string Location { get; protected set; } /// - /// Gets or sets the tags of the resource + /// Gets the tags of the resource /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] - public System.Collections.Generic.IDictionary Tags { get; set; } + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; protected set; } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/UpdateApplicationParameters.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/UpdateApplicationParameters.cs index fe98e84a36bf3..e6c072a1af0f2 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/UpdateApplicationParameters.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Generated/Models/UpdateApplicationParameters.cs @@ -1,13 +1,17 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. -// +// // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.Batch.Models { + using Azure; + using Management; + using Batch; + using Newtonsoft.Json; using System.Linq; /// @@ -43,21 +47,22 @@ public UpdateApplicationParameters() { } /// Gets or sets a value indicating whether packages within the /// application may be overwritten using the same version string. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "allowUpdates")] + [JsonProperty(PropertyName = "allowUpdates")] public bool? AllowUpdates { get; set; } /// /// Gets or sets the package to use if a client requests the /// application but does not specify a version. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "defaultVersion")] + [JsonProperty(PropertyName = "defaultVersion")] public string DefaultVersion { get; set; } /// /// Gets or sets the display name for the application. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "displayName")] + [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } } } + diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Properties/AssemblyInfo.cs b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Properties/AssemblyInfo.cs index f22e1d2c04144..d5ec8acfb5b42 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Properties/AssemblyInfo.cs +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/Properties/AssemblyInfo.cs @@ -8,8 +8,8 @@ [assembly: AssemblyTitle("Microsoft Azure Batch Management Library")] [assembly: AssemblyDescription("Provides management functions for Microsoft Azure Batch services.")] -[assembly: AssemblyVersion("2.0.0.0")] -[assembly: AssemblyFileVersion("2.1.0.0")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] diff --git a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/project.json b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/project.json index 26f05612bd679..f6d44f93b74f2 100644 --- a/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/project.json +++ b/src/ResourceManagement/Batch/Microsoft.Azure.Management.Batch/project.json @@ -1,5 +1,5 @@ { - "version": "3.0.0", + "version": "4.0.0", "title": "Microsoft Azure Batch Management Library", "description": "Provides management capabilities for Azure Batch service accounts.", "authors": [ "Microsoft" ], @@ -30,11 +30,11 @@ } }, "netstandard1.5": { - "imports": ["dnxcore50"], + "imports": [ "dnxcore50" ], "dependencies": { "Microsoft.NETCore.Platforms": "1.0.1", "Microsoft.CSharp": "4.0.1", - "System.Threading.Thread": "4.0.0", + "System.Threading.Thread": "4.0.0", "System.Threading.Tasks": "4.0.11", "System.Collections": "4.0.11", "System.Runtime.Serialization.Primitives": "4.1.1", @@ -43,7 +43,7 @@ } }, "netstandard1.1": { - "imports": ["dnxcore50"], + "imports": [ "dnxcore50" ], "dependencies": { "System.Runtime.Serialization.Primitives": "4.1.1" } diff --git a/src/ResourceManagement/Batch/RegenerateBatch.cmd b/src/ResourceManagement/Batch/RegenerateBatch.cmd index a39c5d7c3dca2..35c8a9b816eb0 100644 --- a/src/ResourceManagement/Batch/RegenerateBatch.cmd +++ b/src/ResourceManagement/Batch/RegenerateBatch.cmd @@ -1,5 +1,5 @@ setlocal -..\..\..\tools\autorest.gen.cmd %1 Microsoft.Azure.Management.Batch 0.17.0-Nightly20160824 ./Microsoft.Azure.Management.Batch/Generated MICROSOFT_MIT_NO_VERSION "-ft 1" +..\..\..\tools\autorest.gen.cmd %1 Microsoft.Azure.Management.Batch 1.0.0-Nightly20170129 ./Microsoft.Azure.Management.Batch/Generated MICROSOFT_MIT_NO_VERSION "-ft 1" endlocal \ No newline at end of file diff --git a/src/ResourceManagement/Batch/changelog.md b/src/ResourceManagement/Batch/changelog.md index 161a939500750..ad1d6e5e77423 100644 --- a/src/ResourceManagement/Batch/changelog.md +++ b/src/ResourceManagement/Batch/changelog.md @@ -1,5 +1,10 @@ ## Microsoft.Azure.Management.Batch release notes +### Changes in 4.0.0 +- Added option to create a Batch account which allocates pool nodes in the user's subscription. This is done with `PoolAllocationMode = UserSubscription`. When using this mode, a `KeyVaultReference` must also be supplied. +- Changed classes which appear only in responses to be immutable. +- This version targets REST API version 2017-01-01. + ### Changes in 3.0.0 - Renamed `AccountResource` to `BatchAccount`. - Renamed `AccountOperations` to `BatchAccountOperations`. The `IBatchManagementClient.Account` property was also renamed to `IBatchManagementClient.BatchAccount`.