diff --git a/src/ResourceManagement/Network/Network.Tests/Helpers/ResourcesManagementTestUtilities.cs b/src/ResourceManagement/Network/Network.Tests/Helpers/ResourcesManagementTestUtilities.cs index 335232db80972..7f74850992d55 100644 --- a/src/ResourceManagement/Network/Network.Tests/Helpers/ResourcesManagementTestUtilities.cs +++ b/src/ResourceManagement/Network/Network.Tests/Helpers/ResourcesManagementTestUtilities.cs @@ -13,7 +13,6 @@ // limitations under the License. // -using Microsoft.Azure.Subscriptions; using ResourceGroups.Tests; namespace Microsoft.Azure.Test diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/DeploymentOperationsOperations.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/DeploymentOperationsOperations.cs index daf75bb8315dd..7fe8a841afa33 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/DeploymentOperationsOperations.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/DeploymentOperationsOperations.cs @@ -136,8 +136,11 @@ internal DeploymentOperationsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -287,8 +290,11 @@ internal DeploymentOperationsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -407,8 +413,11 @@ internal DeploymentOperationsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/DeploymentsOperations.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/DeploymentsOperations.cs index 41243a74dd8db..ba2257800ca2d 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/DeploymentsOperations.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/DeploymentsOperations.cs @@ -127,8 +127,11 @@ internal DeploymentsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -265,8 +268,11 @@ internal DeploymentsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Serialize Request string requestContent = JsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); httpRequest.Content = new StringContent(requestContent, Encoding.UTF8); @@ -426,8 +432,11 @@ internal DeploymentsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Serialize Request string requestContent = JsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); httpRequest.Content = new StringContent(requestContent, Encoding.UTF8); @@ -579,8 +588,11 @@ internal DeploymentsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -729,8 +741,11 @@ internal DeploymentsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -849,8 +864,11 @@ internal DeploymentsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/FeaturesOperations.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/FeaturesOperations.cs index 775bc29204967..ba7c7cc1a7bf1 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/FeaturesOperations.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/FeaturesOperations.cs @@ -108,8 +108,11 @@ internal FeaturesOperations(FeatureClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -242,8 +245,11 @@ internal FeaturesOperations(FeatureClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -385,8 +391,11 @@ internal FeaturesOperations(FeatureClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -528,8 +537,11 @@ internal FeaturesOperations(FeatureClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -649,8 +661,11 @@ internal FeaturesOperations(FeatureClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -769,8 +784,11 @@ internal FeaturesOperations(FeatureClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/ISubscriptionClient.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/ISubscriptionClient.cs index f643b24cb641a..523b0d59190b2 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/ISubscriptionClient.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/ISubscriptionClient.cs @@ -1,4 +1,4 @@ -namespace Microsoft.Azure.Subscriptions +namespace Microsoft.Azure.Management.Resources { using System; using System.Collections.Generic; diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/ISubscriptionsOperations.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/ISubscriptionsOperations.cs index 7e13f00e9cdff..d813ffdea8399 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/ISubscriptionsOperations.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/ISubscriptionsOperations.cs @@ -1,4 +1,4 @@ -namespace Microsoft.Azure.Subscriptions +namespace Microsoft.Azure.Management.Resources { using System; using System.Collections.Generic; diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/ITenantsOperations.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/ITenantsOperations.cs index e48c16f317ee2..9b86921fb0582 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/ITenantsOperations.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/ITenantsOperations.cs @@ -1,4 +1,4 @@ -namespace Microsoft.Azure.Subscriptions +namespace Microsoft.Azure.Management.Resources { using System; using System.Collections.Generic; diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/ManagementLocksOperations.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/ManagementLocksOperations.cs index ad2d370b70792..486587bc69173 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/ManagementLocksOperations.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/ManagementLocksOperations.cs @@ -135,8 +135,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Serialize Request string requestContent = JsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); httpRequest.Content = new StringContent(requestContent, Encoding.UTF8); @@ -333,8 +336,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Serialize Request string requestContent = JsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); httpRequest.Content = new StringContent(requestContent, Encoding.UTF8); @@ -522,8 +528,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -651,8 +660,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Serialize Request string requestContent = JsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); httpRequest.Content = new StringContent(requestContent, Encoding.UTF8); @@ -795,8 +807,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -916,8 +931,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1065,8 +1083,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1194,8 +1215,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1372,8 +1396,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1498,8 +1525,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1631,8 +1661,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1751,8 +1784,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1871,8 +1907,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1991,8 +2030,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -2111,8 +2153,11 @@ internal ManagementLocksOperations(AuthorizationClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/Models/Subscription.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/Models/Subscription.cs index 59838656b46e6..6bc54359dc1b1 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/Models/Subscription.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/Models/Subscription.cs @@ -1,4 +1,4 @@ -namespace Microsoft.Azure.Subscriptions.Models +namespace Microsoft.Azure.Management.Resources.Models { using System; using System.Collections.Generic; diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/Models/TenantIdDescription.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/Models/TenantIdDescription.cs index 1522b64c4c23a..4457c4f83cb4c 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/Models/TenantIdDescription.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/Models/TenantIdDescription.cs @@ -1,4 +1,4 @@ -namespace Microsoft.Azure.Subscriptions.Models +namespace Microsoft.Azure.Management.Resources.Models { using System; using System.Collections.Generic; diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/ProvidersOperations.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/ProvidersOperations.cs index a7e416a74663e..6d0448cbda8d5 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/ProvidersOperations.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/ProvidersOperations.cs @@ -118,8 +118,11 @@ internal ProvidersOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -252,8 +255,11 @@ internal ProvidersOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -385,8 +391,11 @@ internal ProvidersOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -519,8 +528,11 @@ internal ProvidersOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -639,8 +651,11 @@ internal ProvidersOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/ResourceGroupsOperations.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/ResourceGroupsOperations.cs index abc821d68d73a..eaad511bc85b2 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/ResourceGroupsOperations.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/ResourceGroupsOperations.cs @@ -134,8 +134,11 @@ internal ResourceGroupsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -268,8 +271,11 @@ internal ResourceGroupsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -432,8 +438,11 @@ internal ResourceGroupsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Serialize Request string requestContent = JsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); httpRequest.Content = new StringContent(requestContent, Encoding.UTF8); @@ -598,8 +607,11 @@ internal ResourceGroupsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -719,8 +731,11 @@ internal ResourceGroupsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -865,8 +880,11 @@ internal ResourceGroupsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Serialize Request string requestContent = JsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); httpRequest.Content = new StringContent(requestContent, Encoding.UTF8); @@ -1010,8 +1028,11 @@ internal ResourceGroupsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1130,8 +1151,11 @@ internal ResourceGroupsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1250,8 +1274,11 @@ internal ResourceGroupsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/ResourceProviderOperationDetailsOperations.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/ResourceProviderOperationDetailsOperations.cs index f6c20c753be78..c69842e40d936 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/ResourceProviderOperationDetailsOperations.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/ResourceProviderOperationDetailsOperations.cs @@ -121,8 +121,11 @@ internal ResourceProviderOperationDetailsOperations(ResourceManagementClient cli } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/ResourcesOperations.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/ResourcesOperations.cs index 550408d4ab029..25df4213b31cb 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/ResourcesOperations.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/ResourcesOperations.cs @@ -126,8 +126,11 @@ internal ResourcesOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Serialize Request string requestContent = JsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); httpRequest.Content = new StringContent(requestContent, Encoding.UTF8); @@ -258,8 +261,11 @@ internal ResourcesOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -431,8 +437,11 @@ internal ResourcesOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -599,8 +608,11 @@ internal ResourcesOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -810,8 +822,11 @@ internal ResourcesOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Serialize Request string requestContent = JsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); httpRequest.Content = new StringContent(requestContent, Encoding.UTF8); @@ -993,8 +1008,11 @@ internal ResourcesOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1119,8 +1137,11 @@ internal ResourcesOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionClient.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionClient.cs index 7065066beefad..85a2a706c73f3 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionClient.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionClient.cs @@ -1,4 +1,4 @@ -namespace Microsoft.Azure.Subscriptions +namespace Microsoft.Azure.Management.Resources { using System; using System.Collections.Generic; diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionClientExtensions.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionClientExtensions.cs index 0b1e75715c4b8..9b2e7ee53a1a0 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionClientExtensions.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionClientExtensions.cs @@ -1,4 +1,4 @@ -namespace Microsoft.Azure.Subscriptions +namespace Microsoft.Azure.Management.Resources { using System; using System.Collections; diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionsOperations.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionsOperations.cs index 2e1bc11e3bb4f..b7c9a115ea6ad 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionsOperations.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionsOperations.cs @@ -1,4 +1,4 @@ -namespace Microsoft.Azure.Subscriptions +namespace Microsoft.Azure.Management.Resources { using System; using System.Collections.Generic; @@ -111,8 +111,11 @@ internal SubscriptionsOperations(SubscriptionClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -236,8 +239,11 @@ internal SubscriptionsOperations(SubscriptionClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -356,8 +362,11 @@ internal SubscriptionsOperations(SubscriptionClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionsOperationsExtensions.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionsOperationsExtensions.cs index a0eb16b052d53..24dc09c249b13 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionsOperationsExtensions.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/SubscriptionsOperationsExtensions.cs @@ -1,4 +1,4 @@ -namespace Microsoft.Azure.Subscriptions +namespace Microsoft.Azure.Management.Resources { using System; using System.Collections; diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/TagsOperations.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/TagsOperations.cs index ec0e6ad4b772b..85fc6705a878c 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/TagsOperations.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/TagsOperations.cs @@ -127,8 +127,11 @@ internal TagsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -257,8 +260,11 @@ internal TagsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -397,8 +403,11 @@ internal TagsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -537,8 +546,11 @@ internal TagsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -649,8 +661,11 @@ internal TagsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -769,8 +784,11 @@ internal TagsOperations(ResourceManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/TenantsOperations.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/TenantsOperations.cs index 75a3ea62e2fc4..106ce17eadb9e 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/TenantsOperations.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/TenantsOperations.cs @@ -1,4 +1,4 @@ -namespace Microsoft.Azure.Subscriptions +namespace Microsoft.Azure.Management.Resources { using System; using System.Collections.Generic; @@ -107,8 +107,11 @@ internal TenantsOperations(SubscriptionClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -227,8 +230,11 @@ internal TenantsOperations(SubscriptionClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { diff --git a/src/ResourceManagement/Resource/ResourceManagement/Generated/TenantsOperationsExtensions.cs b/src/ResourceManagement/Resource/ResourceManagement/Generated/TenantsOperationsExtensions.cs index 8ca6f0770effd..0b5ba7d7fa373 100644 --- a/src/ResourceManagement/Resource/ResourceManagement/Generated/TenantsOperationsExtensions.cs +++ b/src/ResourceManagement/Resource/ResourceManagement/Generated/TenantsOperationsExtensions.cs @@ -1,4 +1,4 @@ -namespace Microsoft.Azure.Subscriptions +namespace Microsoft.Azure.Management.Resources { using System; using System.Collections; diff --git a/src/ResourceManagement/Resource/ResourceManagement/generate.cmd b/src/ResourceManagement/Resource/ResourceManagement/generate.cmd new file mode 100644 index 0000000000000..db20494323a9e --- /dev/null +++ b/src/ResourceManagement/Resource/ResourceManagement/generate.cmd @@ -0,0 +1,24 @@ +:: +:: Microsoft Azure SDK for Net - Generate library code +:: Copyright (C) Microsoft Corporation. All Rights Reserved. +:: + +set autoRestVersion=0.11.0-Nightly20150727 +set source=-Source https://www.myget.org/F/autorest/api/v2 + +set resSpecUrl="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-resources/2014-04-01-preview/swagger/resources.json?token=AFvFAUt8kd8h4EHb6NQ9pfECnwPrhv9wks5Vv8qQwA==" +set authSpecUrl="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-authorization/2015-01-01/swagger/authorization.json?token=AFvFAdC1UDb8X4apaW2jBlybnEIsDIEjks5Vv_eWwA==" +set featureSpecUrl="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-features/2014-08-01-preview/swagger/features.json?token=AFvFAdK0vX5j75nicb0DQY5ihN425UExks5Vv_fGwA==" +set subscriptionSpecUrl="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-subscriptions/2014-04-01-preview/swagger/subscriptions.json?token=AFvFAbQmNVtX9zfhY0EO8vcXdF6iOyyKks5Vv_flwA==" + +set repoRoot=%~dp0..\..\..\.. +set autoRestExe=%repoRoot%\packages\autorest.%autoRestVersion%\tools\AutoRest.exe +set generateFolder=%~dp0Generated +%repoRoot%\tools\nuget.exe install autorest %source% -Version %autoRestVersion% -o %repoRoot%\packages + +if exist %generateFolder% rd /S /Q %generateFolder% + +%autoRestExe% -Modeler Swagger -CodeGenerator Azure.CSharp -Namespace Microsoft.Azure.Management.Resources -Input %resSpecUrl% -outputDirectory %generateFolder% -Header NONE +%autoRestExe% -Modeler Swagger -CodeGenerator Azure.CSharp -Namespace Microsoft.Azure.Management.Resources -Input %authSpecUrl% -outputDirectory %generateFolder% -Header NONE +%autoRestExe% -Modeler Swagger -CodeGenerator Azure.CSharp -Namespace Microsoft.Azure.Management.Resources -Input %featureSpecUrl% -outputDirectory %generateFolder% -Header NONE +%autoRestExe% -Modeler Swagger -CodeGenerator Azure.CSharp -Namespace Microsoft.Azure.Management.Resources -Input %subscriptionSpecUrl% -outputDirectory %generateFolder% -Header NONE \ No newline at end of file diff --git a/src/ResourceManagement/Resource/Resources.Tests/ScenarioTests/DeploymentTests.ScenarioTests.cs b/src/ResourceManagement/Resource/Resources.Tests/ScenarioTests/DeploymentTests.ScenarioTests.cs index 313b82582098d..f27d44fd79192 100644 --- a/src/ResourceManagement/Resource/Resources.Tests/ScenarioTests/DeploymentTests.ScenarioTests.cs +++ b/src/ResourceManagement/Resource/Resources.Tests/ScenarioTests/DeploymentTests.ScenarioTests.cs @@ -17,14 +17,12 @@ using System.IO; using System.Linq; using System.Net; -using System.Runtime.Serialization.Formatters; using Microsoft.Azure.Management.Resources; using Microsoft.Azure.Management.Resources.Models; using Microsoft.Azure.Test; -using Newtonsoft.Json; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; using Newtonsoft.Json.Linq; using Xunit; -using Microsoft.Rest.ClientRuntime.Azure.TestFramework; namespace ResourceGroups.Tests { diff --git a/src/ResourceManagement/Resource/Resources.Tests/ScenarioTests/SubscriptionTests.ScenarioTests.cs b/src/ResourceManagement/Resource/Resources.Tests/ScenarioTests/SubscriptionTests.ScenarioTests.cs index a5ea6a8dd35c2..5ffb7f7c34202 100644 --- a/src/ResourceManagement/Resource/Resources.Tests/ScenarioTests/SubscriptionTests.ScenarioTests.cs +++ b/src/ResourceManagement/Resource/Resources.Tests/ScenarioTests/SubscriptionTests.ScenarioTests.cs @@ -16,11 +16,10 @@ using System.Linq; using System.Net; using Microsoft.Azure.Management.Resources; -using Microsoft.Azure.Subscriptions; using Microsoft.Azure.Test; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; using Microsoft.Rest.TransientFaultHandling; using Xunit; -using Microsoft.Rest.ClientRuntime.Azure.TestFramework; namespace ResourceGroups.Tests { diff --git a/src/ResourceManagement/Resource/Resources.Tests/ScenarioTests/TenantTests.ScenarioTests.cs b/src/ResourceManagement/Resource/Resources.Tests/ScenarioTests/TenantTests.ScenarioTests.cs index c3486bca02eb7..d31edcac61bd3 100644 --- a/src/ResourceManagement/Resource/Resources.Tests/ScenarioTests/TenantTests.ScenarioTests.cs +++ b/src/ResourceManagement/Resource/Resources.Tests/ScenarioTests/TenantTests.ScenarioTests.cs @@ -15,11 +15,11 @@ using System.Linq; using System.Net; -using Microsoft.Azure.Subscriptions; +using Microsoft.Azure.Management.Resources; using Microsoft.Azure.Test; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; using Microsoft.Rest.TransientFaultHandling; using Xunit; -using Microsoft.Rest.ClientRuntime.Azure.TestFramework; namespace ResourceGroups.Tests { diff --git a/src/ResourceManagement/Resource/Resources.Tests/SpecTestSupport.Resources/ResourcesManagementTestUtilities.cs b/src/ResourceManagement/Resource/Resources.Tests/SpecTestSupport.Resources/ResourcesManagementTestUtilities.cs index 9667394da0c54..1196ad3b9902e 100644 --- a/src/ResourceManagement/Resource/Resources.Tests/SpecTestSupport.Resources/ResourcesManagementTestUtilities.cs +++ b/src/ResourceManagement/Resource/Resources.Tests/SpecTestSupport.Resources/ResourcesManagementTestUtilities.cs @@ -13,16 +13,16 @@ // limitations under the License. // -using Microsoft.Azure.Subscriptions; using ResourceGroups.Tests; +using Microsoft.Azure.Management.Resources; +using Microsoft.Azure.Management.Resources.Models; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using System; +using System.Linq; namespace Microsoft.Azure.Test { - using Microsoft.Azure.Management.Resources; - using Microsoft.Azure.Management.Resources.Models; - using Microsoft.Rest.ClientRuntime.Azure.TestFramework; - using System; - using System.Linq; + public static class ResourcesManagementTestUtilities { diff --git a/src/ResourceManagement/Storage/StorageManagement/Generated/StorageAccountsOperations.cs b/src/ResourceManagement/Storage/StorageManagement/Generated/StorageAccountsOperations.cs index e9e13ac73bda0..02d117910f457 100644 --- a/src/ResourceManagement/Storage/StorageManagement/Generated/StorageAccountsOperations.cs +++ b/src/ResourceManagement/Storage/StorageManagement/Generated/StorageAccountsOperations.cs @@ -117,8 +117,11 @@ internal StorageAccountsOperations(StorageManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Serialize Request string requestContent = JsonConvert.SerializeObject(accountName, this.Client.SerializationSettings); httpRequest.Content = new StringContent(requestContent, Encoding.UTF8); @@ -316,8 +319,11 @@ internal StorageAccountsOperations(StorageManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Serialize Request string requestContent = JsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); httpRequest.Content = new StringContent(requestContent, Encoding.UTF8); @@ -465,8 +471,11 @@ internal StorageAccountsOperations(StorageManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -599,8 +608,11 @@ internal StorageAccountsOperations(StorageManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -761,8 +773,11 @@ internal StorageAccountsOperations(StorageManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Serialize Request string requestContent = JsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); httpRequest.Content = new StringContent(requestContent, Encoding.UTF8); @@ -908,8 +923,11 @@ internal StorageAccountsOperations(StorageManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1034,8 +1052,11 @@ internal StorageAccountsOperations(StorageManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1170,8 +1191,11 @@ internal StorageAccountsOperations(StorageManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1323,8 +1347,11 @@ internal StorageAccountsOperations(StorageManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Serialize Request string requestContent = JsonConvert.SerializeObject(regenerateKey, this.Client.SerializationSettings); httpRequest.Content = new StringContent(requestContent, Encoding.UTF8); @@ -1448,8 +1475,11 @@ internal StorageAccountsOperations(StorageManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { @@ -1570,8 +1600,11 @@ internal StorageAccountsOperations(StorageManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { diff --git a/src/ResourceManagement/Storage/StorageManagement/Generated/UsageOperations.cs b/src/ResourceManagement/Storage/StorageManagement/Generated/UsageOperations.cs index 071dbe1108042..2c30d264998da 100644 --- a/src/ResourceManagement/Storage/StorageManagement/Generated/UsageOperations.cs +++ b/src/ResourceManagement/Storage/StorageManagement/Generated/UsageOperations.cs @@ -108,8 +108,11 @@ internal UsageOperations(StorageManagementClient client) } // Set Credentials - cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(httpRequest, cancellationToken).ConfigureAwait(false); + } // Send Request if (shouldTrace) { diff --git a/src/ResourceManagement/Storage/StorageManagement/StorageManagementClient.json b/src/ResourceManagement/Storage/StorageManagement/StorageManagementClient.json deleted file mode 100644 index eef5e41e772dd..0000000000000 --- a/src/ResourceManagement/Storage/StorageManagement/StorageManagementClient.json +++ /dev/null @@ -1,768 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "StorageManagementClient", - "version": "2015-05-01-preview" - }, - "host": "management.azure.com", - "schemes": [ - "https" - ], - "consumes": [ - "application/json", - "text/json" - ], - "produces": [ - "application/json", - "text/json" - ], - "paths": { - "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability": { - "post": { - "tags": [ - "StorageAccounts" - ], - "operationId": "StorageAccounts_CheckNameAvailability", - "description": "Checks that account name is valid and is not in use.", - "parameters": [ - { - "name": "accountName", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/StorageAccountCheckNameAvailabilityParameters" - }, - "description": "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. " - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/CheckNameAvailabilityResult" - } - } - } - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}": { - "put": { - "tags": [ - "StorageAccounts" - ], - "operationId": "StorageAccounts_Create", - "description": "Asynchronously creates a new storage account with the specified parameters. Existing accounts cannot be updated with this API and should instead use the Update Storage Account API. If an account is already created and subsequent PUT request is issued with exact same set of properties, then HTTP 200 would be returned. ", - "parameters": [ - { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group within the user’s subscription." - }, - { - "name": "accountName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. " - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/StorageAccountCreateParameters" - }, - "description": "The parameters to provide for the created account." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/StorageAccount" - } - }, - "202": { - "description": "" - } - }, - "x-ms-long-running-operation": true - }, - "delete": { - "tags": [ - "StorageAccounts" - ], - "operationId": "StorageAccounts_Delete", - "description": "Deletes a storage account in Microsoft Azure.", - "parameters": [ - { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group within the user’s subscription." - }, - { - "name": "accountName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. " - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "" - }, - "204": { - "description": "" - } - } - }, - "get": { - "tags": [ - "StorageAccounts" - ], - "operationId": "StorageAccounts_GetProperties", - "description": "Returns the properties for the specified storage account including but not limited to name, account type, location, and account status. The ListKeys operation should be used to retrieve storage keys.", - "parameters": [ - { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group within the user’s subscription." - }, - { - "name": "accountName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. " - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/StorageAccount" - } - } - } - }, - "patch": { - "tags": [ - "StorageAccounts" - ], - "operationId": "StorageAccounts_Update", - "description": "Updates the account type or tags for a storage account. It can also be used to add a custom domain (note that custom domains cannot be added via the Create operation). Only one custom domain is supported per storage account. This API can only be used to update one of tags, accountType, or customDomain per call. To update multiple of these properties, call the API multiple times with one change per call. This call does not change the storage keys for the account. If you want to change storage account keys, use the RegenerateKey operation. The location and name of the storage account cannot be changed after creation.", - "parameters": [ - { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group within the user’s subscription." - }, - { - "name": "accountName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. " - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/StorageAccountUpdateParameters" - }, - "description": "The parameters to update on the account. Note that only one property can be changed at a time using this API. " - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/StorageAccount" - } - } - } - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys": { - "post": { - "tags": [ - "StorageAccounts" - ], - "operationId": "StorageAccounts_ListKeys", - "description": "Lists the access keys for the specified storage account.", - "parameters": [ - { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group." - }, - { - "name": "accountName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the storage account." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/StorageAccountKeys" - } - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts": { - "get": { - "tags": [ - "StorageAccounts" - ], - "operationId": "StorageAccounts_List", - "description": "Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this.", - "parameters": [ - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/StorageAccountListResult" - } - } - }, - "x-ms-pageable": true - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts": { - "get": { - "tags": [ - "StorageAccounts" - ], - "operationId": "StorageAccounts_ListByResourceGroup", - "description": "Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this.", - "parameters": [ - { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group within the user’s subscription." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/StorageAccountListResult" - } - } - }, - "x-ms-pageable": true - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey": { - "post": { - "tags": [ - "StorageAccounts" - ], - "operationId": "StorageAccounts_RegenerateKey", - "description": "Regenerates the access keys for the specified storage account.", - "parameters": [ - { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group within the user’s subscription." - }, - { - "name": "accountName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. " - }, - { - "name": "regenerateKey", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/StorageAccountRegenerateKeyParameters" - }, - "description": "Specifies name of the key which should be regenerated." - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/StorageAccountKeys" - } - } - } - } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages": { - "get": { - "tags": [ - "Usage" - ], - "operationId": "Usage_List", - "description": "Gets the current usage count and the limit for the resources under the subscription.", - "parameters": [ - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "$ref": "#/parameters/SubscriptionIdParameter" - } - ], - "responses": { - "200": { - "description": "", - "schema": { - "$ref": "#/definitions/UsageListResult" - } - } - } - } - } - }, - "definitions": { - "StorageAccountCheckNameAvailabilityParameters": { - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "CheckNameAvailabilityResult": { - "properties": { - "nameAvailable": { - "type": "boolean", - "description": "Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used." - }, - "reason": { - "type": "string", - "description": "Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false.", - "enum": [ - "AccountNameInvalid", - "AlreadyExists" - ], - "x-ms-enum": "Reason" - }, - "message": { - "type": "string", - "description": "Gets an error message explaining the Reason value in more detail." - } - }, - "description": "The CheckNameAvailability operation response." - }, - "StorageAccountPropertiesCreateParameters": { - "properties": { - "accountType": { - "type": "string", - "description": "Gets or sets the account type.", - "enum": [ - "Standard_LRS", - "Standard_ZRS", - "Standard_GRS", - "Standard_RAGRS", - "Premium_LRS" - ], - "x-ms-enum": "AccountType" - } - } - }, - "StorageAccountCreateParameters": { - "properties": { - "properties": { - "$ref": "#/definitions/StorageAccountPropertiesCreateParameters" - } - }, - "allOf": [ - { - "$ref": "Resource" - } - ], - "description": "The parameters to provide for the account." - }, - "Endpoints": { - "properties": { - "blob": { - "type": "string", - "description": "Gets the blob endpoint." - }, - "queue": { - "type": "string", - "description": "Gets the queue endpoint." - }, - "table": { - "type": "string", - "description": "Gets the table endpoint." - } - }, - "description": "The URIs that are used to perform a retrieval of a public blob, queue or table object." - }, - "CustomDomain": { - "properties": { - "name": { - "type": "string", - "description": "Gets or sets the custom domain name. Name is the CNAME source." - }, - "useSubDomain": { - "type": "boolean", - "description": "Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates" - } - }, - "description": "The custom domain assigned to this storage account. This can be set via Update." - }, - "StorageAccountProperties": { - "properties": { - "provisioningState": { - "type": "string", - "description": "Gets the status of the storage account at the time the operation was called.", - "enum": [ - "Creating", - "ResolvingDNS", - "Succeeded" - ], - "x-ms-enum": "ProvisioningState" - }, - "accountType": { - "type": "string", - "description": "Gets the type of the storage account.", - "enum": [ - "Standard_LRS", - "Standard_ZRS", - "Standard_GRS", - "Standard_RAGRS", - "Premium_LRS" - ], - "x-ms-enum": "AccountType" - }, - "primaryEndpoints": { - "$ref": "#/definitions/Endpoints", - "description": "Gets the URLs that are used to perform a retrieval of a public blob, queue or table object.Note that StandardZRS and PremiumLRS accounts only return the blob endpoint." - }, - "primaryLocation": { - "type": "string", - "description": "Gets the location of the primary for the storage account." - }, - "statusOfPrimary": { - "type": "string", - "description": "Gets the status indicating whether the primary location of the storage account is available or unavailable.", - "enum": [ - "Available", - "Unavailable" - ], - "x-ms-enum": "AccountStatus" - }, - "lastGeoFailoverTime": { - "type": "string", - "format": "date-time", - "description": "Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is StandardGRS or StandardRAGRS." - }, - "secondaryLocation": { - "type": "string", - "description": "Gets the location of the geo replicated secondary for the storage account. Only available if the accountType is StandardGRS or StandardRAGRS." - }, - "statusOfSecondary": { - "type": "string", - "description": "Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the accountType is StandardGRS or StandardRAGRS.", - "enum": [ - "Available", - "Unavailable" - ], - "x-ms-enum": "AccountStatus" - }, - "creationTime": { - "type": "string", - "format": "date-time", - "description": "Gets the creation date and time of the storage account in UTC." - }, - "customDomain": { - "$ref": "#/definitions/CustomDomain", - "description": "Gets the user assigned custom domain assigned to this storage account." - }, - "secondaryEndpoints": { - "$ref": "#/definitions/Endpoints", - "description": "Gets the URLs that are used to perform a retrieval of a public blob, queue or table object from the secondary location of the storage account. Only available if the accountType is StandardRAGRS." - } - } - }, - "StorageAccount": { - "properties": { - "properties": { - "$ref": "#/definitions/StorageAccountProperties" - } - }, - "allOf": [ - { - "$ref": "Resource" - } - ], - "description": "The storage account." - }, - "StorageAccountKeys": { - "properties": { - "key1": { - "type": "string", - "description": "Gets the value of key 1." - }, - "key2": { - "type": "string", - "description": "Gets the value of key 2." - } - }, - "description": "The access keys for the storage account." - }, - "StorageAccountListResult": { - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/StorageAccount" - }, - "description": "Gets the list of storage accounts and their properties." - }, - "nextLink": { - "type": "string", - "description": "Gets the link to the next set of results. Currently this will always be empty as the API does not support pagination." - } - }, - "description": "The list storage accounts operation response." - }, - "StorageAccountPropertiesUpdateParameters": { - "properties": { - "accountType": { - "type": "string", - "description": "Gets or sets the account type. Note that StandardZRS and PremiumLRS accounts cannot be changed to other account types, and other account types cannot be changed to StandardZRS or PremiumLRS.", - "enum": [ - "Standard_LRS", - "Standard_ZRS", - "Standard_GRS", - "Standard_RAGRS", - "Premium_LRS" - ], - "x-ms-enum": "AccountType" - }, - "customDomain": { - "$ref": "#/definitions/CustomDomain", - "description": "User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name property." - } - } - }, - "StorageAccountUpdateParameters": { - "properties": { - "properties": { - "$ref": "#/definitions/StorageAccountPropertiesUpdateParameters" - } - }, - "allOf": [ - { - "$ref": "Resource" - } - ], - "description": "The parameters to update on the account." - }, - "StorageAccountRegenerateKeyParameters": { - "properties": { - "keyName": { - "type": "string", - "enum": [ - "key1", - "key2" - ], - "x-ms-enum": "KeyName" - } - } - }, - "UsageName": { - "properties": { - "value": { - "type": "string", - "description": "Gets a string describing the resource name." - }, - "localizedValue": { - "type": "string", - "description": "Gets a localized string describing the resource name." - } - }, - "description": "The Usage Names." - }, - "Usage": { - "properties": { - "unit": { - "type": "string", - "description": "Gets the unit of measurement.", - "enum": [ - "Count", - "Bytes", - "Seconds", - "Percent", - "CountsPerSecond", - "BytesPerSecond" - ], - "x-ms-enum": "UsageUnit" - }, - "currentValue": { - "type": "integer", - "format": "int32", - "description": "Gets the current count of the allocated resources in the subscription." - }, - "limit": { - "type": "integer", - "format": "int32", - "description": "Gets the maximum count of the resources that can be allocated in the subscription." - }, - "name": { - "$ref": "#/definitions/UsageName", - "description": "Gets the name of the type of usage." - } - }, - "description": "Describes Storage Resource Usage." - }, - "UsageListResult": { - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/Usage" - }, - "description": "Gets or sets the list Storage Resource Usages." - } - }, - "description": "The List Usages operation response." - }, - "Resource": { - "properties": { - "id": { - "readOnly": true, - "type": "string", - "description": "Resource Id" - }, - "name": { - "readOnly": true, - "type": "string", - "description": "Resource name" - }, - "type": { - "readOnly": true, - "type": "string", - "description": "Resource type" - }, - "location": { - "type": "string", - "description": "Resource location" - }, - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Resource tags" - } - }, - "required": [ - "location" - ], - "x-ms-external": true - }, - "SubResource": { - "properties": { - "id": { - "type": "string", - "description": "Resource Id" - } - }, - "x-ms-external": true - } - }, - "parameters": { - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." - }, - "ApiVersionParameter": { - "name": "api-version", - "in": "query", - "required": true, - "type": "string", - "description": "Client Api Version." - } - } -} \ No newline at end of file diff --git a/src/ResourceManagement/Storage/StorageManagement/generate.cmd b/src/ResourceManagement/Storage/StorageManagement/generate.cmd new file mode 100644 index 0000000000000..7b6fc83607cf7 --- /dev/null +++ b/src/ResourceManagement/Storage/StorageManagement/generate.cmd @@ -0,0 +1,17 @@ +:: +:: Microsoft Azure SDK for Net - Generate library code +:: Copyright (C) Microsoft Corporation. All Rights Reserved. +:: + +set autoRestVersion=0.11.0-Nightly20150727 +set specUrl="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-storage/2015-05-01-preview/swagger/storage.json?token=AFvFAVctRHBXqAdfxX2kk3jAvsCrCqxXks5Vv-IDwA==" +set source=-Source https://www.myget.org/F/autorest/api/v2 + +set repoRoot=%~dp0..\..\..\.. +set autoRestExe=%repoRoot%\packages\autorest.%autoRestVersion%\tools\AutoRest.exe +set generateFolder=%~dp0Generated + +%repoRoot%\tools\nuget.exe install autorest %source% -Version %autoRestVersion% -o %repoRoot%\packages + +if exist %generateFolder% rd /S /Q %generateFolder% +%autoRestExe% -Modeler Swagger -CodeGenerator Azure.CSharp -Namespace Microsoft.Azure.Management.Storage -Input %specUrl% -outputDirectory %generateFolder% -Header NONE \ No newline at end of file