diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperations.cs
index ec387a5bacf8..3f2e7cb3b734 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperations.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperations.cs
@@ -55,7 +55,7 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
/// List azure resource manager templates in a given artifact source.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -72,7 +72,7 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -93,10 +93,28 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -109,6 +127,13 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -203,14 +228,13 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -220,10 +244,6 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -272,7 +292,7 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
/// Get azure resource manager template.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -281,10 +301,7 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
/// The name of the artifact source.
///
///
- /// The name of the azure Resource Manager template.
- ///
- ///
- /// Specify the $expand query. Example: 'properties($select=displayName)'
+ /// The name of the azure resource manager template.
///
///
/// Headers that will be added to request.
@@ -292,7 +309,7 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -307,16 +324,34 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -333,6 +368,13 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -344,7 +386,6 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
tracingParameters.Add("labName", labName);
tracingParameters.Add("artifactSourceName", artifactSourceName);
tracingParameters.Add("name", name);
- tracingParameters.Add("expand", expand);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -357,10 +398,6 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
_url = _url.Replace("{artifactSourceName}", System.Uri.EscapeDataString(artifactSourceName));
_url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
List _queryParameters = new List();
- if (expand != null)
- {
- _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
- }
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
@@ -425,14 +462,13 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -442,10 +478,6 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -502,7 +534,7 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -598,14 +630,13 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -615,10 +646,6 @@ internal ArmTemplatesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperationsExtensions.cs
index afc94bbbd57a..70ec6e86fac9 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperationsExtensions.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArmTemplatesOperationsExtensions.cs
@@ -29,7 +29,7 @@ public static partial class ArmTemplatesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -52,7 +52,7 @@ public static partial class ArmTemplatesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -81,7 +81,7 @@ public static partial class ArmTemplatesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -90,14 +90,11 @@ public static partial class ArmTemplatesOperationsExtensions
/// The name of the artifact source.
///
///
- /// The name of the azure Resource Manager template.
+ /// The name of the azure resource manager template.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=displayName)'
- ///
- public static ArmTemplate Get(this IArmTemplatesOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string))
+ public static ArmTemplate Get(this IArmTemplatesOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name)
{
- return operations.GetAsync(resourceGroupName, labName, artifactSourceName, name, expand).GetAwaiter().GetResult();
+ return operations.GetAsync(resourceGroupName, labName, artifactSourceName, name).GetAwaiter().GetResult();
}
///
@@ -107,7 +104,7 @@ public static partial class ArmTemplatesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -116,17 +113,14 @@ public static partial class ArmTemplatesOperationsExtensions
/// The name of the artifact source.
///
///
- /// The name of the azure Resource Manager template.
- ///
- ///
- /// Specify the $expand query. Example: 'properties($select=displayName)'
+ /// The name of the azure resource manager template.
///
///
/// The cancellation token.
///
- public static async Task GetAsync(this IArmTemplatesOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IArmTemplatesOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, artifactSourceName, name, expand, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, artifactSourceName, name, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperations.cs
index 63061ca56f84..39402edf531e 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperations.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperations.cs
@@ -55,7 +55,7 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
/// List artifact sources in a given lab.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -69,7 +69,7 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -90,10 +90,28 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -102,6 +120,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -194,14 +219,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -211,10 +235,6 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -263,7 +283,7 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
/// Get artifact source.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -271,16 +291,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
///
/// The name of the artifact source.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=displayName)'
- ///
///
/// Headers that will be added to request.
///
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -295,16 +312,34 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -317,6 +352,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -327,7 +369,6 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("labName", labName);
tracingParameters.Add("name", name);
- tracingParameters.Add("expand", expand);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -339,10 +380,6 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
_url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
_url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
List _queryParameters = new List();
- if (expand != null)
- {
- _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
- }
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
@@ -407,14 +444,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -424,10 +460,6 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -476,7 +508,7 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
/// Create or replace an existing artifact source.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -493,7 +525,7 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -514,10 +546,28 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -526,13 +576,24 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
if (artifactSource == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "artifactSource");
}
- if (Client.ApiVersion == null)
+ if (artifactSource != null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ artifactSource.Validate();
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -626,14 +687,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 201)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -643,10 +703,6 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -713,7 +769,7 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
/// Delete artifact source.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -727,7 +783,7 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -745,10 +801,28 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -761,6 +835,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -846,14 +927,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 204)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -863,10 +943,6 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -894,10 +970,11 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
}
///
- /// Modify properties of artifact sources.
+ /// Allows modifying tags of artifact sources. All other properties will be
+ /// ignored.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -906,7 +983,8 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
/// The name of the artifact source.
///
///
- /// Properties of an artifact source.
+ /// Allows modifying tags of artifact sources. All other properties will be
+ /// ignored.
///
///
/// Headers that will be added to request.
@@ -914,7 +992,7 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -935,10 +1013,28 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -947,14 +1043,21 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
- if (artifactSource == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "artifactSource");
- }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (artifactSource == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "artifactSource");
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1047,14 +1150,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1064,10 +1166,6 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1124,7 +1222,7 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1220,14 +1318,13 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1237,10 +1334,6 @@ internal ArtifactSourcesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperationsExtensions.cs
index fe37b564812f..2ccba27821a8 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperationsExtensions.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactSourcesOperationsExtensions.cs
@@ -29,7 +29,7 @@ public static partial class ArtifactSourcesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -49,7 +49,7 @@ public static partial class ArtifactSourcesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -75,7 +75,7 @@ public static partial class ArtifactSourcesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -83,12 +83,9 @@ public static partial class ArtifactSourcesOperationsExtensions
///
/// The name of the artifact source.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=displayName)'
- ///
- public static ArtifactSource Get(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name, string expand = default(string))
+ public static ArtifactSource Get(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name)
{
- return operations.GetAsync(resourceGroupName, labName, name, expand).GetAwaiter().GetResult();
+ return operations.GetAsync(resourceGroupName, labName, name).GetAwaiter().GetResult();
}
///
@@ -98,7 +95,7 @@ public static partial class ArtifactSourcesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -106,15 +103,12 @@ public static partial class ArtifactSourcesOperationsExtensions
///
/// The name of the artifact source.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=displayName)'
- ///
///
/// The cancellation token.
///
- public static async Task GetAsync(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, expand, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -127,7 +121,7 @@ public static partial class ArtifactSourcesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -150,7 +144,7 @@ public static ArtifactSource CreateOrUpdate(this IArtifactSourcesOperations oper
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -179,7 +173,7 @@ public static ArtifactSource CreateOrUpdate(this IArtifactSourcesOperations oper
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -199,7 +193,7 @@ public static void Delete(this IArtifactSourcesOperations operations, string res
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -216,13 +210,14 @@ public static void Delete(this IArtifactSourcesOperations operations, string res
}
///
- /// Modify properties of artifact sources.
+ /// Allows modifying tags of artifact sources. All other properties will be
+ /// ignored.
///
///
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -231,7 +226,8 @@ public static void Delete(this IArtifactSourcesOperations operations, string res
/// The name of the artifact source.
///
///
- /// Properties of an artifact source.
+ /// Allows modifying tags of artifact sources. All other properties will be
+ /// ignored.
///
public static ArtifactSource Update(this IArtifactSourcesOperations operations, string resourceGroupName, string labName, string name, ArtifactSourceFragment artifactSource)
{
@@ -239,13 +235,14 @@ public static ArtifactSource Update(this IArtifactSourcesOperations operations,
}
///
- /// Modify properties of artifact sources.
+ /// Allows modifying tags of artifact sources. All other properties will be
+ /// ignored.
///
///
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -254,7 +251,8 @@ public static ArtifactSource Update(this IArtifactSourcesOperations operations,
/// The name of the artifact source.
///
///
- /// Properties of an artifact source.
+ /// Allows modifying tags of artifact sources. All other properties will be
+ /// ignored.
///
///
/// The cancellation token.
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperations.cs
index ab7a2811546d..ae16dc70e8e5 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperations.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperations.cs
@@ -55,7 +55,7 @@ internal ArtifactsOperations(DevTestLabsClient client)
/// List artifacts in a given artifact source.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -72,7 +72,7 @@ internal ArtifactsOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -93,10 +93,28 @@ internal ArtifactsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -109,6 +127,13 @@ internal ArtifactsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -203,14 +228,13 @@ internal ArtifactsOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -220,10 +244,6 @@ internal ArtifactsOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -272,7 +292,7 @@ internal ArtifactsOperations(DevTestLabsClient client)
/// Get artifact.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -283,16 +303,13 @@ internal ArtifactsOperations(DevTestLabsClient client)
///
/// The name of the artifact.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=title)'
- ///
///
/// Headers that will be added to request.
///
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -307,16 +324,34 @@ internal ArtifactsOperations(DevTestLabsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string artifactSourceName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -333,6 +368,13 @@ internal ArtifactsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -344,7 +386,6 @@ internal ArtifactsOperations(DevTestLabsClient client)
tracingParameters.Add("labName", labName);
tracingParameters.Add("artifactSourceName", artifactSourceName);
tracingParameters.Add("name", name);
- tracingParameters.Add("expand", expand);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -357,10 +398,6 @@ internal ArtifactsOperations(DevTestLabsClient client)
_url = _url.Replace("{artifactSourceName}", System.Uri.EscapeDataString(artifactSourceName));
_url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
List _queryParameters = new List();
- if (expand != null)
- {
- _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
- }
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
@@ -425,14 +462,13 @@ internal ArtifactsOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -442,10 +478,6 @@ internal ArtifactsOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -495,7 +527,7 @@ internal ArtifactsOperations(DevTestLabsClient client)
/// files to a storage account, and validates the generated artifact.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -515,7 +547,7 @@ internal ArtifactsOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -536,10 +568,28 @@ internal ArtifactsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -552,14 +602,21 @@ internal ArtifactsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
- if (generateArmTemplateRequest == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "generateArmTemplateRequest");
- }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (generateArmTemplateRequest == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "generateArmTemplateRequest");
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -654,14 +711,13 @@ internal ArtifactsOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -671,10 +727,6 @@ internal ArtifactsOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -731,7 +783,7 @@ internal ArtifactsOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -827,14 +879,13 @@ internal ArtifactsOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -844,10 +895,6 @@ internal ArtifactsOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperationsExtensions.cs
index 207fbb2fe011..11a403bb6e13 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperationsExtensions.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/ArtifactsOperationsExtensions.cs
@@ -29,7 +29,7 @@ public static partial class ArtifactsOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -52,7 +52,7 @@ public static partial class ArtifactsOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -81,7 +81,7 @@ public static partial class ArtifactsOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -92,12 +92,9 @@ public static partial class ArtifactsOperationsExtensions
///
/// The name of the artifact.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=title)'
- ///
- public static Artifact Get(this IArtifactsOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string))
+ public static Artifact Get(this IArtifactsOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name)
{
- return operations.GetAsync(resourceGroupName, labName, artifactSourceName, name, expand).GetAwaiter().GetResult();
+ return operations.GetAsync(resourceGroupName, labName, artifactSourceName, name).GetAwaiter().GetResult();
}
///
@@ -107,7 +104,7 @@ public static partial class ArtifactsOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -118,15 +115,12 @@ public static partial class ArtifactsOperationsExtensions
///
/// The name of the artifact.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=title)'
- ///
///
/// The cancellation token.
///
- public static async Task GetAsync(this IArtifactsOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IArtifactsOperations operations, string resourceGroupName, string labName, string artifactSourceName, string name, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, artifactSourceName, name, expand, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, artifactSourceName, name, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -140,7 +134,7 @@ public static partial class ArtifactsOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -167,7 +161,7 @@ public static ArmTemplateInfo GenerateArmTemplate(this IArtifactsOperations oper
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/BastionHostsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/BastionHostsOperations.cs
new file mode 100644
index 000000000000..9a236aa128c9
--- /dev/null
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/BastionHostsOperations.cs
@@ -0,0 +1,1488 @@
+//
+// 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.DevTestLabs
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Microsoft.Rest.Azure.OData;
+ 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;
+
+ ///
+ /// BastionHostsOperations operations.
+ ///
+ internal partial class BastionHostsOperations : IServiceOperations, IBastionHostsOperations
+ {
+ ///
+ /// Initializes a new instance of the BastionHostsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal BastionHostsOperations(DevTestLabsClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the DevTestLabsClient
+ ///
+ public DevTestLabsClient Client { get; private set; }
+
+ ///
+ /// List bastionhosts in a given virtual network.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// OData parameters to apply to the operation.
+ ///
+ ///
+ /// 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 Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (virtualNetworkName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("odataQuery", odataQuery);
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("virtualNetworkName", virtualNetworkName);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
+ _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName));
+ List _queryParameters = new List();
+ if (odataQuery != null)
+ {
+ var _odataFilter = odataQuery.ToString();
+ if (!string.IsNullOrEmpty(_odataFilter))
+ {
+ _queryParameters.Add(_odataFilter);
+ }
+ }
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ 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 (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Get bastionhost.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// 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 Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (virtualNetworkName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("virtualNetworkName", virtualNetworkName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
+ _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName));
+ _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ 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 (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Create or replace an existing bastionHost. This operation can take a while
+ /// to complete.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// Profile of a Bastion Host
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send Request
+ AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Delete bastionhost. This operation can take a while to complete.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ // Send request
+ AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, customHeaders, cancellationToken).ConfigureAwait(false);
+ return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Allows modifying tags of bastionhosts. All other properties will be
+ /// ignored.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// Allows modifying tags of bastionhosts. All other properties will be
+ /// ignored.
+ ///
+ ///
+ /// 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 Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHostFragment bastionHost, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (virtualNetworkName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (bastionHost == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "bastionHost");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("virtualNetworkName", virtualNetworkName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("bastionHost", bastionHost);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
+ _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName));
+ _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PATCH");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(bastionHost != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(bastionHost, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ 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 (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Create or replace an existing bastionHost. This operation can take a while
+ /// to complete.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// Profile of a Bastion Host
+ ///
+ ///
+ /// 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 Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (virtualNetworkName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (bastionHost == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "bastionHost");
+ }
+ if (bastionHost != null)
+ {
+ bastionHost.Validate();
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("virtualNetworkName", virtualNetworkName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("bastionHost", bastionHost);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
+ _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName));
+ _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("PUT");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ if(bastionHost != null)
+ {
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(bastionHost, Client.SerializationSettings);
+ _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
+ _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
+ }
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ 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 (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 201)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Delete bastionhost. This operation can take a while to complete.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// 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
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string labName, string virtualNetworkName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (resourceGroupName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
+ }
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
+ if (labName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labName");
+ }
+ if (virtualNetworkName == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "virtualNetworkName");
+ }
+ if (name == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "name");
+ }
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("resourceGroupName", resourceGroupName);
+ tracingParameters.Add("labName", labName);
+ tracingParameters.Add("virtualNetworkName", virtualNetworkName);
+ tracingParameters.Add("name", name);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualnetworks/{virtualNetworkName}/bastionhosts/{name}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName));
+ _url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
+ _url = _url.Replace("{virtualNetworkName}", System.Uri.EscapeDataString(virtualNetworkName));
+ _url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("DELETE");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ 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();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// List bastionhosts in a given virtual network.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// 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 Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (nextPageLink == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("nextPageLink", nextPageLink);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters);
+ }
+ // Construct URL
+ string _url = "{nextLink}";
+ _url = _url.Replace("{nextLink}", nextPageLink);
+ List _queryParameters = new List();
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ 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 (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/BastionHostsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/BastionHostsOperationsExtensions.cs
new file mode 100644
index 000000000000..e38085c4dad0
--- /dev/null
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/BastionHostsOperationsExtensions.cs
@@ -0,0 +1,444 @@
+//
+// 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.DevTestLabs
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Microsoft.Rest.Azure.OData;
+ using Models;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for BastionHostsOperations.
+ ///
+ public static partial class BastionHostsOperationsExtensions
+ {
+ ///
+ /// List bastionhosts in a given virtual network.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// OData parameters to apply to the operation.
+ ///
+ public static IPage List(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, ODataQuery odataQuery = default(ODataQuery))
+ {
+ return operations.ListAsync(resourceGroupName, labName, virtualNetworkName, odataQuery).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// List bastionhosts in a given virtual network.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// OData parameters to apply to the operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, odataQuery, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Get bastionhost.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ public static BastionHost Get(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name)
+ {
+ return operations.GetAsync(resourceGroupName, labName, virtualNetworkName, name).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Get bastionhost.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Create or replace an existing bastionHost. This operation can take a while
+ /// to complete.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// Profile of a Bastion Host
+ ///
+ public static BastionHost CreateOrUpdate(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost)
+ {
+ return operations.CreateOrUpdateAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create or replace an existing bastionHost. This operation can take a while
+ /// to complete.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// Profile of a Bastion Host
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task CreateOrUpdateAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Delete bastionhost. This operation can take a while to complete.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ public static void Delete(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name)
+ {
+ operations.DeleteAsync(resourceGroupName, labName, virtualNetworkName, name).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Delete bastionhost. This operation can take a while to complete.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task DeleteAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// Allows modifying tags of bastionhosts. All other properties will be
+ /// ignored.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// Allows modifying tags of bastionhosts. All other properties will be
+ /// ignored.
+ ///
+ public static BastionHost Update(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHostFragment bastionHost)
+ {
+ return operations.UpdateAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Allows modifying tags of bastionhosts. All other properties will be
+ /// ignored.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// Allows modifying tags of bastionhosts. All other properties will be
+ /// ignored.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task UpdateAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHostFragment bastionHost, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Create or replace an existing bastionHost. This operation can take a while
+ /// to complete.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// Profile of a Bastion Host
+ ///
+ public static BastionHost BeginCreateOrUpdate(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost)
+ {
+ return operations.BeginCreateOrUpdateAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Create or replace an existing bastionHost. This operation can take a while
+ /// to complete.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// Profile of a Bastion Host
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginCreateOrUpdateAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, BastionHost bastionHost, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, bastionHost, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Delete bastionhost. This operation can take a while to complete.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ public static void BeginDelete(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name)
+ {
+ operations.BeginDeleteAsync(resourceGroupName, labName, virtualNetworkName, name).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Delete bastionhost. This operation can take a while to complete.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// The name of the lab.
+ ///
+ ///
+ /// The name of the virtual network.
+ ///
+ ///
+ /// The name of the bastionhost.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task BeginDeleteAsync(this IBastionHostsOperations operations, string resourceGroupName, string labName, string virtualNetworkName, string name, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, labName, virtualNetworkName, name, null, cancellationToken).ConfigureAwait(false)).Dispose();
+ }
+
+ ///
+ /// List bastionhosts in a given virtual network.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ public static IPage ListNext(this IBastionHostsOperations operations, string nextPageLink)
+ {
+ return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// List bastionhosts in a given virtual network.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The NextLink from the previous successful call to List operation.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListNextAsync(this IBastionHostsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperations.cs
index e4131f6acdc6..0a300fc33992 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperations.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperations.cs
@@ -54,7 +54,7 @@ internal CostsOperations(DevTestLabsClient client)
/// Get cost.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -71,7 +71,7 @@ internal CostsOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -92,10 +92,28 @@ internal CostsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -108,6 +126,13 @@ internal CostsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -198,14 +223,13 @@ internal CostsOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -215,10 +239,6 @@ internal CostsOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -267,7 +287,7 @@ internal CostsOperations(DevTestLabsClient client)
/// Create or replace an existing cost.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -284,7 +304,7 @@ internal CostsOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -305,10 +325,28 @@ internal CostsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -317,14 +355,21 @@ internal CostsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
- if (labCost == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "labCost");
- }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (labCost == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "labCost");
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -417,14 +462,13 @@ internal CostsOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 201)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -434,10 +478,6 @@ internal CostsOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperationsExtensions.cs
index 499d0b1d761f..9e2d5e341302 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperationsExtensions.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CostsOperationsExtensions.cs
@@ -28,7 +28,7 @@ public static partial class CostsOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -51,7 +51,7 @@ public static partial class CostsOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -80,7 +80,7 @@ public static partial class CostsOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -103,7 +103,7 @@ public static LabCost CreateOrUpdate(this ICostsOperations operations, string re
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperations.cs
index 225a8c040b9a..e3eec1b3db8e 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperations.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperations.cs
@@ -55,7 +55,7 @@ internal CustomImagesOperations(DevTestLabsClient client)
/// List custom images in a given lab.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -69,7 +69,7 @@ internal CustomImagesOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -90,10 +90,28 @@ internal CustomImagesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -102,6 +120,13 @@ internal CustomImagesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -194,14 +219,13 @@ internal CustomImagesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -211,10 +235,6 @@ internal CustomImagesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -263,7 +283,7 @@ internal CustomImagesOperations(DevTestLabsClient client)
/// Get custom image.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -271,16 +291,13 @@ internal CustomImagesOperations(DevTestLabsClient client)
///
/// The name of the custom image.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=vm)'
- ///
///
/// Headers that will be added to request.
///
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -295,16 +312,34 @@ internal CustomImagesOperations(DevTestLabsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -317,6 +352,13 @@ internal CustomImagesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -327,7 +369,6 @@ internal CustomImagesOperations(DevTestLabsClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("labName", labName);
tracingParameters.Add("name", name);
- tracingParameters.Add("expand", expand);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -339,10 +380,6 @@ internal CustomImagesOperations(DevTestLabsClient client)
_url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
_url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
List _queryParameters = new List();
- if (expand != null)
- {
- _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
- }
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
@@ -407,14 +444,13 @@ internal CustomImagesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -424,10 +460,6 @@ internal CustomImagesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -477,7 +509,7 @@ internal CustomImagesOperations(DevTestLabsClient client)
/// to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -505,7 +537,7 @@ internal CustomImagesOperations(DevTestLabsClient client)
/// Delete custom image. This operation can take a while to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -527,10 +559,11 @@ internal CustomImagesOperations(DevTestLabsClient client)
}
///
- /// Modify properties of custom images.
+ /// Allows modifying tags of custom images. All other properties will be
+ /// ignored.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -539,7 +572,8 @@ internal CustomImagesOperations(DevTestLabsClient client)
/// The name of the custom image.
///
///
- /// A custom image.
+ /// Allows modifying tags of custom images. All other properties will be
+ /// ignored.
///
///
/// Headers that will be added to request.
@@ -547,7 +581,7 @@ internal CustomImagesOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -568,10 +602,28 @@ internal CustomImagesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -580,14 +632,21 @@ internal CustomImagesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
- if (customImage == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "customImage");
- }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (customImage == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "customImage");
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -680,14 +739,13 @@ internal CustomImagesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -697,10 +755,6 @@ internal CustomImagesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -750,7 +804,7 @@ internal CustomImagesOperations(DevTestLabsClient client)
/// to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -767,7 +821,7 @@ internal CustomImagesOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -788,10 +842,28 @@ internal CustomImagesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -800,6 +872,17 @@ internal CustomImagesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
if (customImage == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "customImage");
@@ -808,10 +891,6 @@ internal CustomImagesOperations(DevTestLabsClient client)
{
customImage.Validate();
}
- if (Client.ApiVersion == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
- }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -902,16 +981,15 @@ internal CustomImagesOperations(DevTestLabsClient client)
System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -921,10 +999,6 @@ internal CustomImagesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -991,7 +1065,7 @@ internal CustomImagesOperations(DevTestLabsClient client)
/// Delete custom image. This operation can take a while to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -1005,7 +1079,7 @@ internal CustomImagesOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1023,10 +1097,28 @@ internal CustomImagesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -1039,6 +1131,13 @@ internal CustomImagesOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1124,14 +1223,13 @@ internal CustomImagesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1141,10 +1239,6 @@ internal CustomImagesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1183,7 +1277,7 @@ internal CustomImagesOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1279,14 +1373,13 @@ internal CustomImagesOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1296,10 +1389,6 @@ internal CustomImagesOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperationsExtensions.cs
index d600fc47b4d0..68b9ffaface1 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperationsExtensions.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/CustomImagesOperationsExtensions.cs
@@ -29,7 +29,7 @@ public static partial class CustomImagesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -49,7 +49,7 @@ public static partial class CustomImagesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -75,7 +75,7 @@ public static partial class CustomImagesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -83,12 +83,9 @@ public static partial class CustomImagesOperationsExtensions
///
/// The name of the custom image.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=vm)'
- ///
- public static CustomImage Get(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, string expand = default(string))
+ public static CustomImage Get(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name)
{
- return operations.GetAsync(resourceGroupName, labName, name, expand).GetAwaiter().GetResult();
+ return operations.GetAsync(resourceGroupName, labName, name).GetAwaiter().GetResult();
}
///
@@ -98,7 +95,7 @@ public static partial class CustomImagesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -106,15 +103,12 @@ public static partial class CustomImagesOperationsExtensions
///
/// The name of the custom image.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=vm)'
- ///
///
/// The cancellation token.
///
- public static async Task GetAsync(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, expand, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, name, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -128,7 +122,7 @@ public static partial class CustomImagesOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -152,7 +146,7 @@ public static CustomImage CreateOrUpdate(this ICustomImagesOperations operations
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -181,7 +175,7 @@ public static CustomImage CreateOrUpdate(this ICustomImagesOperations operations
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -201,7 +195,7 @@ public static void Delete(this ICustomImagesOperations operations, string resour
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -218,13 +212,14 @@ public static void Delete(this ICustomImagesOperations operations, string resour
}
///
- /// Modify properties of custom images.
+ /// Allows modifying tags of custom images. All other properties will be
+ /// ignored.
///
///
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -233,7 +228,8 @@ public static void Delete(this ICustomImagesOperations operations, string resour
/// The name of the custom image.
///
///
- /// A custom image.
+ /// Allows modifying tags of custom images. All other properties will be
+ /// ignored.
///
public static CustomImage Update(this ICustomImagesOperations operations, string resourceGroupName, string labName, string name, CustomImageFragment customImage)
{
@@ -241,13 +237,14 @@ public static CustomImage Update(this ICustomImagesOperations operations, string
}
///
- /// Modify properties of custom images.
+ /// Allows modifying tags of custom images. All other properties will be
+ /// ignored.
///
///
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -256,7 +253,8 @@ public static CustomImage Update(this ICustomImagesOperations operations, string
/// The name of the custom image.
///
///
- /// A custom image.
+ /// Allows modifying tags of custom images. All other properties will be
+ /// ignored.
///
///
/// The cancellation token.
@@ -277,7 +275,7 @@ public static CustomImage Update(this ICustomImagesOperations operations, string
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -301,7 +299,7 @@ public static CustomImage BeginCreateOrUpdate(this ICustomImagesOperations opera
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -330,7 +328,7 @@ public static CustomImage BeginCreateOrUpdate(this ICustomImagesOperations opera
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -350,7 +348,7 @@ public static void BeginDelete(this ICustomImagesOperations operations, string r
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DevTestLabsClient.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DevTestLabsClient.cs
index 806b878deb1d..f8ba5a4afa2a 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DevTestLabsClient.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DevTestLabsClient.cs
@@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.DevTestLabs
using System.Net.Http;
///
- /// The DevTest Labs Client.
+ /// Microsoft DevTest Labs Client
///
public partial class DevTestLabsClient : ServiceClient, IDevTestLabsClient, IAzureClient
{
@@ -47,12 +47,12 @@ public partial class DevTestLabsClient : ServiceClient, IDevT
public ServiceClientCredentials Credentials { get; private set; }
///
- /// Client API version.
+ /// The API version to use for this operation.
///
public string ApiVersion { get; private set; }
///
- /// The subscription ID.
+ /// The ID of the target subscription.
///
public string SubscriptionId { get; set; }
@@ -84,11 +84,6 @@ public partial class DevTestLabsClient : ServiceClient, IDevT
///
public virtual ILabsOperations Labs { get; private set; }
- ///
- /// Gets the IOperations.
- ///
- public virtual IOperations Operations { get; private set; }
-
///
/// Gets the IGlobalSchedulesOperations.
///
@@ -149,11 +144,26 @@ public partial class DevTestLabsClient : ServiceClient, IDevT
///
public virtual ISchedulesOperations Schedules { get; private set; }
+ ///
+ /// Gets the ILabSecretsOperations.
+ ///
+ public virtual ILabSecretsOperations LabSecrets { get; private set; }
+
///
/// Gets the IServiceRunnersOperations.
///
public virtual IServiceRunnersOperations ServiceRunners { get; private set; }
+ ///
+ /// Gets the ISharedGalleriesOperations.
+ ///
+ public virtual ISharedGalleriesOperations SharedGalleries { get; private set; }
+
+ ///
+ /// Gets the ISharedImagesOperations.
+ ///
+ public virtual ISharedImagesOperations SharedImages { get; private set; }
+
///
/// Gets the IUsersOperations.
///
@@ -199,6 +209,16 @@ public partial class DevTestLabsClient : ServiceClient, IDevT
///
public virtual IVirtualNetworksOperations VirtualNetworks { get; private set; }
+ ///
+ /// Gets the IBastionHostsOperations.
+ ///
+ public virtual IBastionHostsOperations BastionHosts { get; private set; }
+
+ ///
+ /// Gets the IOperations.
+ ///
+ public virtual IOperations Operations { get; private set; }
+
///
/// Initializes a new instance of the DevTestLabsClient class.
///
@@ -442,7 +462,6 @@ private void Initialize()
{
ProviderOperations = new ProviderOperations(this);
Labs = new LabsOperations(this);
- Operations = new Operations(this);
GlobalSchedules = new GlobalSchedulesOperations(this);
ArtifactSources = new ArtifactSourcesOperations(this);
ArmTemplates = new ArmTemplatesOperations(this);
@@ -455,7 +474,10 @@ private void Initialize()
PolicySets = new PolicySetsOperations(this);
Policies = new PoliciesOperations(this);
Schedules = new SchedulesOperations(this);
+ LabSecrets = new LabSecretsOperations(this);
ServiceRunners = new ServiceRunnersOperations(this);
+ SharedGalleries = new SharedGalleriesOperations(this);
+ SharedImages = new SharedImagesOperations(this);
Users = new UsersOperations(this);
Disks = new DisksOperations(this);
Environments = new EnvironmentsOperations(this);
@@ -465,8 +487,10 @@ private void Initialize()
VirtualMachines = new VirtualMachinesOperations(this);
VirtualMachineSchedules = new VirtualMachineSchedulesOperations(this);
VirtualNetworks = new VirtualNetworksOperations(this);
+ BastionHosts = new BastionHostsOperations(this);
+ Operations = new Operations(this);
BaseUri = new System.Uri("https://management.azure.com");
- ApiVersion = "2018-09-15";
+ ApiVersion = "2021-09-01";
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
GenerateClientRequestId = true;
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperations.cs
index 1f6e18917d74..24b804097402 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperations.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperations.cs
@@ -55,7 +55,7 @@ internal DisksOperations(DevTestLabsClient client)
/// List disks in a given user profile.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -72,7 +72,7 @@ internal DisksOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -93,10 +93,28 @@ internal DisksOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -109,6 +127,13 @@ internal DisksOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -203,14 +228,13 @@ internal DisksOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -220,10 +244,6 @@ internal DisksOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -272,7 +292,7 @@ internal DisksOperations(DevTestLabsClient client)
/// Get disk.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -283,16 +303,13 @@ internal DisksOperations(DevTestLabsClient client)
///
/// The name of the disk.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=diskType)'
- ///
///
/// Headers that will be added to request.
///
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -307,16 +324,34 @@ internal DisksOperations(DevTestLabsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -333,6 +368,13 @@ internal DisksOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -344,7 +386,6 @@ internal DisksOperations(DevTestLabsClient client)
tracingParameters.Add("labName", labName);
tracingParameters.Add("userName", userName);
tracingParameters.Add("name", name);
- tracingParameters.Add("expand", expand);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -357,10 +398,6 @@ internal DisksOperations(DevTestLabsClient client)
_url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName));
_url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
List _queryParameters = new List();
- if (expand != null)
- {
- _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
- }
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
@@ -425,14 +462,13 @@ internal DisksOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -442,10 +478,6 @@ internal DisksOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -495,7 +527,7 @@ internal DisksOperations(DevTestLabsClient client)
/// complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -526,7 +558,7 @@ internal DisksOperations(DevTestLabsClient client)
/// Delete disk. This operation can take a while to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -551,10 +583,10 @@ internal DisksOperations(DevTestLabsClient client)
}
///
- /// Modify properties of disks.
+ /// Allows modifying tags of disks. All other properties will be ignored.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -566,7 +598,7 @@ internal DisksOperations(DevTestLabsClient client)
/// The name of the disk.
///
///
- /// A Disk.
+ /// Allows modifying tags of disks. All other properties will be ignored.
///
///
/// Headers that will be added to request.
@@ -574,7 +606,7 @@ internal DisksOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -595,10 +627,28 @@ internal DisksOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -611,14 +661,21 @@ internal DisksOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
- if (disk == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "disk");
- }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (disk == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "disk");
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -713,14 +770,13 @@ internal DisksOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -730,10 +786,6 @@ internal DisksOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -783,7 +835,7 @@ internal DisksOperations(DevTestLabsClient client)
/// operation can take a while to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -815,7 +867,7 @@ internal DisksOperations(DevTestLabsClient client)
/// This operation can take a while to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -847,7 +899,7 @@ internal DisksOperations(DevTestLabsClient client)
/// complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -867,7 +919,7 @@ internal DisksOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -888,10 +940,28 @@ internal DisksOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -904,13 +974,24 @@ internal DisksOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
if (disk == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "disk");
}
- if (Client.ApiVersion == null)
+ if (disk != null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ disk.Validate();
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -1004,16 +1085,15 @@ internal DisksOperations(DevTestLabsClient client)
System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1023,10 +1103,6 @@ internal DisksOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1093,7 +1169,7 @@ internal DisksOperations(DevTestLabsClient client)
/// Delete disk. This operation can take a while to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -1110,7 +1186,7 @@ internal DisksOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1128,10 +1204,28 @@ internal DisksOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -1148,6 +1242,13 @@ internal DisksOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1235,14 +1336,13 @@ internal DisksOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1252,10 +1352,6 @@ internal DisksOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1287,7 +1383,7 @@ internal DisksOperations(DevTestLabsClient client)
/// operation can take a while to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -1307,7 +1403,7 @@ internal DisksOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1325,10 +1421,28 @@ internal DisksOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -1341,14 +1455,21 @@ internal DisksOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
- if (attachDiskProperties == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "attachDiskProperties");
- }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (attachDiskProperties == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "attachDiskProperties");
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1443,14 +1564,13 @@ internal DisksOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1460,10 +1580,6 @@ internal DisksOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1495,7 +1611,7 @@ internal DisksOperations(DevTestLabsClient client)
/// This operation can take a while to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -1515,7 +1631,7 @@ internal DisksOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1533,10 +1649,28 @@ internal DisksOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -1549,14 +1683,21 @@ internal DisksOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
- if (detachDiskProperties == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "detachDiskProperties");
- }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (detachDiskProperties == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "detachDiskProperties");
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1651,14 +1792,13 @@ internal DisksOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 202)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1668,10 +1808,6 @@ internal DisksOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1710,7 +1846,7 @@ internal DisksOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1806,14 +1942,13 @@ internal DisksOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1823,10 +1958,6 @@ internal DisksOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperationsExtensions.cs
index f2e41ff0a3ca..7c8b5cb12fb4 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperationsExtensions.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/DisksOperationsExtensions.cs
@@ -29,7 +29,7 @@ public static partial class DisksOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -52,7 +52,7 @@ public static partial class DisksOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -81,7 +81,7 @@ public static partial class DisksOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -92,12 +92,9 @@ public static partial class DisksOperationsExtensions
///
/// The name of the disk.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=diskType)'
- ///
- public static Disk Get(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, string expand = default(string))
+ public static Disk Get(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name)
{
- return operations.GetAsync(resourceGroupName, labName, userName, name, expand).GetAwaiter().GetResult();
+ return operations.GetAsync(resourceGroupName, labName, userName, name).GetAwaiter().GetResult();
}
///
@@ -107,7 +104,7 @@ public static partial class DisksOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -118,15 +115,12 @@ public static partial class DisksOperationsExtensions
///
/// The name of the disk.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=diskType)'
- ///
///
/// The cancellation token.
///
- public static async Task GetAsync(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, userName, name, expand, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, userName, name, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -140,7 +134,7 @@ public static partial class DisksOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -167,7 +161,7 @@ public static Disk CreateOrUpdate(this IDisksOperations operations, string resou
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -199,7 +193,7 @@ public static Disk CreateOrUpdate(this IDisksOperations operations, string resou
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -222,7 +216,7 @@ public static void Delete(this IDisksOperations operations, string resourceGroup
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -242,13 +236,13 @@ public static void Delete(this IDisksOperations operations, string resourceGroup
}
///
- /// Modify properties of disks.
+ /// Allows modifying tags of disks. All other properties will be ignored.
///
///
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -260,7 +254,7 @@ public static void Delete(this IDisksOperations operations, string resourceGroup
/// The name of the disk.
///
///
- /// A Disk.
+ /// Allows modifying tags of disks. All other properties will be ignored.
///
public static Disk Update(this IDisksOperations operations, string resourceGroupName, string labName, string userName, string name, DiskFragment disk)
{
@@ -268,13 +262,13 @@ public static Disk Update(this IDisksOperations operations, string resourceGroup
}
///
- /// Modify properties of disks.
+ /// Allows modifying tags of disks. All other properties will be ignored.
///
///
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -286,7 +280,7 @@ public static Disk Update(this IDisksOperations operations, string resourceGroup
/// The name of the disk.
///
///
- /// A Disk.
+ /// Allows modifying tags of disks. All other properties will be ignored.
///
///
/// The cancellation token.
@@ -307,7 +301,7 @@ public static Disk Update(this IDisksOperations operations, string resourceGroup
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -334,7 +328,7 @@ public static void Attach(this IDisksOperations operations, string resourceGroup
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -364,7 +358,7 @@ public static void Attach(this IDisksOperations operations, string resourceGroup
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -391,7 +385,7 @@ public static void Detach(this IDisksOperations operations, string resourceGroup
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -421,7 +415,7 @@ public static void Detach(this IDisksOperations operations, string resourceGroup
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -448,7 +442,7 @@ public static Disk BeginCreateOrUpdate(this IDisksOperations operations, string
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -480,7 +474,7 @@ public static Disk BeginCreateOrUpdate(this IDisksOperations operations, string
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -503,7 +497,7 @@ public static void BeginDelete(this IDisksOperations operations, string resource
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -530,7 +524,7 @@ public static void BeginDelete(this IDisksOperations operations, string resource
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -557,7 +551,7 @@ public static void BeginAttach(this IDisksOperations operations, string resource
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -587,7 +581,7 @@ public static void BeginAttach(this IDisksOperations operations, string resource
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -614,7 +608,7 @@ public static void BeginDetach(this IDisksOperations operations, string resource
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperations.cs
index 3febf1fb06d9..806baa6ed9f7 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperations.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperations.cs
@@ -55,7 +55,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
/// List environments in a given user profile.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -72,7 +72,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -87,16 +87,34 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -109,6 +127,13 @@ internal EnvironmentsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -203,14 +228,13 @@ internal EnvironmentsOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -220,10 +244,6 @@ internal EnvironmentsOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -236,7 +256,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -249,7 +269,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -272,7 +292,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
/// Get environment.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -283,17 +303,13 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// The name of the environment.
///
- ///
- /// Specify the $expand query. Example:
- /// 'properties($select=deploymentProperties)'
- ///
///
/// Headers that will be added to request.
///
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -308,16 +324,34 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -334,6 +368,13 @@ internal EnvironmentsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -345,7 +386,6 @@ internal EnvironmentsOperations(DevTestLabsClient client)
tracingParameters.Add("labName", labName);
tracingParameters.Add("userName", userName);
tracingParameters.Add("name", name);
- tracingParameters.Add("expand", expand);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -358,10 +398,6 @@ internal EnvironmentsOperations(DevTestLabsClient client)
_url = _url.Replace("{userName}", System.Uri.EscapeDataString(userName));
_url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
List _queryParameters = new List();
- if (expand != null)
- {
- _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
- }
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
@@ -426,14 +462,13 @@ internal EnvironmentsOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -443,10 +478,6 @@ internal EnvironmentsOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -459,7 +490,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -472,7 +503,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -496,7 +527,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
/// to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -507,7 +538,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// The name of the environment.
///
- ///
+ ///
/// An environment, which is essentially an ARM template deployment.
///
///
@@ -516,10 +547,10 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, DtlEnvironment dtlEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Environment environment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
// Send Request
- AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, userName, name, dtlEnvironment, customHeaders, cancellationToken).ConfigureAwait(false);
+ AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, userName, name, environment, customHeaders, cancellationToken).ConfigureAwait(false);
return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false);
}
@@ -527,7 +558,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
/// Delete environment. This operation can take a while to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -552,10 +583,11 @@ internal EnvironmentsOperations(DevTestLabsClient client)
}
///
- /// Modify properties of environments.
+ /// Allows modifying tags of environments. All other properties will be
+ /// ignored.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -566,8 +598,9 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// The name of the environment.
///
- ///
- /// An environment, which is essentially an ARM template deployment.
+ ///
+ /// Allows modifying tags of environments. All other properties will be
+ /// ignored.
///
///
/// Headers that will be added to request.
@@ -575,7 +608,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -590,16 +623,34 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, DtlEnvironmentFragment dtlEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, EnvironmentFragment environment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -612,14 +663,21 @@ internal EnvironmentsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
- if (dtlEnvironment == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "dtlEnvironment");
- }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (environment == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "environment");
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -631,7 +689,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
tracingParameters.Add("labName", labName);
tracingParameters.Add("userName", userName);
tracingParameters.Add("name", name);
- tracingParameters.Add("dtlEnvironment", dtlEnvironment);
+ tracingParameters.Add("environment", environment);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters);
}
@@ -686,9 +744,9 @@ internal EnvironmentsOperations(DevTestLabsClient client)
// Serialize Request
string _requestContent = null;
- if(dtlEnvironment != null)
+ if(environment != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(dtlEnvironment, Client.SerializationSettings);
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(environment, Client.SerializationSettings);
_httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
}
@@ -714,14 +772,13 @@ internal EnvironmentsOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -731,10 +788,6 @@ internal EnvironmentsOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -747,7 +800,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -760,7 +813,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -784,7 +837,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
/// to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -795,7 +848,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// The name of the environment.
///
- ///
+ ///
/// An environment, which is essentially an ARM template deployment.
///
///
@@ -804,7 +857,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -819,16 +872,34 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, DtlEnvironment dtlEnvironment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string labName, string userName, string name, Environment environment, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -841,14 +912,25 @@ internal EnvironmentsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
- if (dtlEnvironment == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "dtlEnvironment");
- }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (environment == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "environment");
+ }
+ if (environment != null)
+ {
+ environment.Validate();
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -860,7 +942,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
tracingParameters.Add("labName", labName);
tracingParameters.Add("userName", userName);
tracingParameters.Add("name", name);
- tracingParameters.Add("dtlEnvironment", dtlEnvironment);
+ tracingParameters.Add("environment", environment);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters);
}
@@ -915,9 +997,9 @@ internal EnvironmentsOperations(DevTestLabsClient client)
// Serialize Request
string _requestContent = null;
- if(dtlEnvironment != null)
+ if(environment != null)
{
- _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(dtlEnvironment, Client.SerializationSettings);
+ _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(environment, Client.SerializationSettings);
_httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8);
_httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8");
}
@@ -941,16 +1023,15 @@ internal EnvironmentsOperations(DevTestLabsClient client)
System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -960,10 +1041,6 @@ internal EnvironmentsOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -976,7 +1053,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse();
+ var _result = new AzureOperationResponse();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -989,7 +1066,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1007,7 +1084,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
@@ -1030,7 +1107,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
/// Delete environment. This operation can take a while to complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -1047,7 +1124,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1065,10 +1142,28 @@ internal EnvironmentsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -1085,6 +1180,13 @@ internal EnvironmentsOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -1172,14 +1274,13 @@ internal EnvironmentsOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1189,10 +1290,6 @@ internal EnvironmentsOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1231,7 +1328,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1246,7 +1343,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (nextPageLink == null)
{
@@ -1327,14 +1424,13 @@ internal EnvironmentsOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1344,10 +1440,6 @@ internal EnvironmentsOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1360,7 +1452,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
throw ex;
}
// Create Result
- var _result = new AzureOperationResponse>();
+ var _result = new AzureOperationResponse>();
_result.Request = _httpRequest;
_result.Response = _httpResponse;
if (_httpResponse.Headers.Contains("x-ms-request-id"))
@@ -1373,7 +1465,7 @@ internal EnvironmentsOperations(DevTestLabsClient client)
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
try
{
- _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
}
catch (JsonException ex)
{
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperationsExtensions.cs
index 9869ea3e9494..210d812fe7d0 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperationsExtensions.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/EnvironmentsOperationsExtensions.cs
@@ -29,7 +29,7 @@ public static partial class EnvironmentsOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -40,7 +40,7 @@ public static partial class EnvironmentsOperationsExtensions
///
/// OData parameters to apply to the operation.
///
- public static IPage List(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, ODataQuery odataQuery = default(ODataQuery))
+ public static IPage List(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, ODataQuery odataQuery = default(ODataQuery))
{
return operations.ListAsync(resourceGroupName, labName, userName, odataQuery).GetAwaiter().GetResult();
}
@@ -52,7 +52,7 @@ public static partial class EnvironmentsOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -66,7 +66,7 @@ public static partial class EnvironmentsOperationsExtensions
///
/// The cancellation token.
///
- public static async Task> ListAsync(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListAsync(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, userName, odataQuery, null, cancellationToken).ConfigureAwait(false))
{
@@ -81,7 +81,7 @@ public static partial class EnvironmentsOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -92,13 +92,9 @@ public static partial class EnvironmentsOperationsExtensions
///
/// The name of the environment.
///
- ///
- /// Specify the $expand query. Example:
- /// 'properties($select=deploymentProperties)'
- ///
- public static DtlEnvironment Get(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, string expand = default(string))
+ public static Environment Get(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name)
{
- return operations.GetAsync(resourceGroupName, labName, userName, name, expand).GetAwaiter().GetResult();
+ return operations.GetAsync(resourceGroupName, labName, userName, name).GetAwaiter().GetResult();
}
///
@@ -108,7 +104,7 @@ public static partial class EnvironmentsOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -119,16 +115,12 @@ public static partial class EnvironmentsOperationsExtensions
///
/// The name of the environment.
///
- ///
- /// Specify the $expand query. Example:
- /// 'properties($select=deploymentProperties)'
- ///
///
/// The cancellation token.
///
- public static async Task GetAsync(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task GetAsync(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, userName, name, expand, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, labName, userName, name, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -142,7 +134,7 @@ public static partial class EnvironmentsOperationsExtensions
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -153,12 +145,12 @@ public static partial class EnvironmentsOperationsExtensions
///
/// The name of the environment.
///
- ///
+ ///
/// An environment, which is essentially an ARM template deployment.
///
- public static DtlEnvironment CreateOrUpdate(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, DtlEnvironment dtlEnvironment)
+ public static Environment CreateOrUpdate(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, Environment environment)
{
- return operations.CreateOrUpdateAsync(resourceGroupName, labName, userName, name, dtlEnvironment).GetAwaiter().GetResult();
+ return operations.CreateOrUpdateAsync(resourceGroupName, labName, userName, name, environment).GetAwaiter().GetResult();
}
///
@@ -169,7 +161,7 @@ public static DtlEnvironment CreateOrUpdate(this IEnvironmentsOperations operati
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -180,15 +172,15 @@ public static DtlEnvironment CreateOrUpdate(this IEnvironmentsOperations operati
///
/// The name of the environment.
///
- ///
+ ///
/// An environment, which is essentially an ARM template deployment.
///
///
/// The cancellation token.
///
- public static async Task CreateOrUpdateAsync(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, DtlEnvironment dtlEnvironment, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task CreateOrUpdateAsync(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, Environment environment, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, userName, name, dtlEnvironment, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, userName, name, environment, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -201,7 +193,7 @@ public static DtlEnvironment CreateOrUpdate(this IEnvironmentsOperations operati
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -224,7 +216,7 @@ public static void Delete(this IEnvironmentsOperations operations, string resour
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -244,13 +236,14 @@ public static void Delete(this IEnvironmentsOperations operations, string resour
}
///
- /// Modify properties of environments.
+ /// Allows modifying tags of environments. All other properties will be
+ /// ignored.
///
///
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -261,22 +254,24 @@ public static void Delete(this IEnvironmentsOperations operations, string resour
///
/// The name of the environment.
///
- ///
- /// An environment, which is essentially an ARM template deployment.
+ ///
+ /// Allows modifying tags of environments. All other properties will be
+ /// ignored.
///
- public static DtlEnvironment Update(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, DtlEnvironmentFragment dtlEnvironment)
+ public static Environment Update(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, EnvironmentFragment environment)
{
- return operations.UpdateAsync(resourceGroupName, labName, userName, name, dtlEnvironment).GetAwaiter().GetResult();
+ return operations.UpdateAsync(resourceGroupName, labName, userName, name, environment).GetAwaiter().GetResult();
}
///
- /// Modify properties of environments.
+ /// Allows modifying tags of environments. All other properties will be
+ /// ignored.
///
///
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -287,15 +282,16 @@ public static DtlEnvironment Update(this IEnvironmentsOperations operations, str
///
/// The name of the environment.
///
- ///
- /// An environment, which is essentially an ARM template deployment.
+ ///
+ /// Allows modifying tags of environments. All other properties will be
+ /// ignored.
///
///
/// The cancellation token.
///
- public static async Task UpdateAsync(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, DtlEnvironmentFragment dtlEnvironment, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task UpdateAsync(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, EnvironmentFragment environment, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, labName, userName, name, dtlEnvironment, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, labName, userName, name, environment, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -309,7 +305,7 @@ public static DtlEnvironment Update(this IEnvironmentsOperations operations, str
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -320,12 +316,12 @@ public static DtlEnvironment Update(this IEnvironmentsOperations operations, str
///
/// The name of the environment.
///
- ///
+ ///
/// An environment, which is essentially an ARM template deployment.
///
- public static DtlEnvironment BeginCreateOrUpdate(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, DtlEnvironment dtlEnvironment)
+ public static Environment BeginCreateOrUpdate(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, Environment environment)
{
- return operations.BeginCreateOrUpdateAsync(resourceGroupName, labName, userName, name, dtlEnvironment).GetAwaiter().GetResult();
+ return operations.BeginCreateOrUpdateAsync(resourceGroupName, labName, userName, name, environment).GetAwaiter().GetResult();
}
///
@@ -336,7 +332,7 @@ public static DtlEnvironment BeginCreateOrUpdate(this IEnvironmentsOperations op
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -347,15 +343,15 @@ public static DtlEnvironment BeginCreateOrUpdate(this IEnvironmentsOperations op
///
/// The name of the environment.
///
- ///
+ ///
/// An environment, which is essentially an ARM template deployment.
///
///
/// The cancellation token.
///
- public static async Task BeginCreateOrUpdateAsync(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, DtlEnvironment dtlEnvironment, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task BeginCreateOrUpdateAsync(this IEnvironmentsOperations operations, string resourceGroupName, string labName, string userName, string name, Environment environment, CancellationToken cancellationToken = default(CancellationToken))
{
- using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, userName, name, dtlEnvironment, null, cancellationToken).ConfigureAwait(false))
+ using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, labName, userName, name, environment, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
@@ -368,7 +364,7 @@ public static DtlEnvironment BeginCreateOrUpdate(this IEnvironmentsOperations op
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -391,7 +387,7 @@ public static void BeginDelete(this IEnvironmentsOperations operations, string r
/// The operations group for this extension method.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -419,7 +415,7 @@ public static void BeginDelete(this IEnvironmentsOperations operations, string r
///
/// The NextLink from the previous successful call to List operation.
///
- public static IPage ListNext(this IEnvironmentsOperations operations, string nextPageLink)
+ public static IPage ListNext(this IEnvironmentsOperations operations, string nextPageLink)
{
return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult();
}
@@ -436,7 +432,7 @@ public static IPage ListNext(this IEnvironmentsOperations operat
///
/// The cancellation token.
///
- public static async Task> ListNextAsync(this IEnvironmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
+ public static async Task> ListNextAsync(this IEnvironmentsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
{
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperations.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperations.cs
index 71ca5c312cf1..351978c507df 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperations.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperations.cs
@@ -55,7 +55,7 @@ internal FormulasOperations(DevTestLabsClient client)
/// List formulas in a given lab.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -69,7 +69,7 @@ internal FormulasOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -90,10 +90,28 @@ internal FormulasOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -102,6 +120,13 @@ internal FormulasOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -194,14 +219,13 @@ internal FormulasOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -211,10 +235,6 @@ internal FormulasOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -263,7 +283,7 @@ internal FormulasOperations(DevTestLabsClient client)
/// Get formula.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -271,16 +291,13 @@ internal FormulasOperations(DevTestLabsClient client)
///
/// The name of the formula.
///
- ///
- /// Specify the $expand query. Example: 'properties($select=description)'
- ///
///
/// Headers that will be added to request.
///
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -295,16 +312,34 @@ internal FormulasOperations(DevTestLabsClient client)
///
/// A response object containing the response body and response headers.
///
- public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string labName, string name, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.SubscriptionId == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -317,6 +352,13 @@ internal FormulasOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -327,7 +369,6 @@ internal FormulasOperations(DevTestLabsClient client)
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("labName", labName);
tracingParameters.Add("name", name);
- tracingParameters.Add("expand", expand);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters);
}
@@ -339,10 +380,6 @@ internal FormulasOperations(DevTestLabsClient client)
_url = _url.Replace("{labName}", System.Uri.EscapeDataString(labName));
_url = _url.Replace("{name}", System.Uri.EscapeDataString(name));
List _queryParameters = new List();
- if (expand != null)
- {
- _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand)));
- }
if (Client.ApiVersion != null)
{
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
@@ -407,14 +444,13 @@ internal FormulasOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -424,10 +460,6 @@ internal FormulasOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -477,7 +509,7 @@ internal FormulasOperations(DevTestLabsClient client)
/// complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -505,7 +537,7 @@ internal FormulasOperations(DevTestLabsClient client)
/// Delete formula.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -519,7 +551,7 @@ internal FormulasOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -537,10 +569,28 @@ internal FormulasOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -553,6 +603,13 @@ internal FormulasOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -638,14 +695,13 @@ internal FormulasOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200 && (int)_statusCode != 204)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -655,10 +711,6 @@ internal FormulasOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -686,10 +738,10 @@ internal FormulasOperations(DevTestLabsClient client)
}
///
- /// Modify properties of formulas.
+ /// Allows modifying tags of formulas. All other properties will be ignored.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -698,7 +750,7 @@ internal FormulasOperations(DevTestLabsClient client)
/// The name of the formula.
///
///
- /// A formula for creating a VM, specifying an image base and other parameters
+ /// Allows modifying tags of formulas. All other properties will be ignored.
///
///
/// Headers that will be added to request.
@@ -706,7 +758,7 @@ internal FormulasOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -727,10 +779,28 @@ internal FormulasOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -739,14 +809,21 @@ internal FormulasOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
- if (formula == null)
- {
- throw new ValidationException(ValidationRules.CannotBeNull, "formula");
- }
if (Client.ApiVersion == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
}
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (formula == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "formula");
+ }
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
string _invocationId = null;
@@ -839,14 +916,13 @@ internal FormulasOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -856,10 +932,6 @@ internal FormulasOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -909,7 +981,7 @@ internal FormulasOperations(DevTestLabsClient client)
/// complete.
///
///
- /// The name of the resource group.
+ /// The name of the resource group. The name is case insensitive.
///
///
/// The name of the lab.
@@ -926,7 +998,7 @@ internal FormulasOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -947,10 +1019,28 @@ internal FormulasOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
}
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
if (resourceGroupName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName");
}
+ if (resourceGroupName != null)
+ {
+ if (resourceGroupName.Length > 90)
+ {
+ throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90);
+ }
+ if (resourceGroupName.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
+ }
+ }
if (labName == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "labName");
@@ -959,13 +1049,24 @@ internal FormulasOperations(DevTestLabsClient client)
{
throw new ValidationException(ValidationRules.CannotBeNull, "name");
}
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
if (formula == null)
{
throw new ValidationException(ValidationRules.CannotBeNull, "formula");
}
- if (Client.ApiVersion == null)
+ if (formula != null)
{
- throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ formula.Validate();
}
// Tracing
bool _shouldTrace = ServiceClientTracing.IsEnabled;
@@ -1057,16 +1158,15 @@ internal FormulasOperations(DevTestLabsClient client)
System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
- if ((int)_statusCode != 200 && (int)_statusCode != 201)
+ if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1076,10 +1176,6 @@ internal FormulasOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
@@ -1154,7 +1250,7 @@ internal FormulasOperations(DevTestLabsClient client)
///
/// The cancellation token.
///
- ///
+ ///
/// Thrown when the operation returned an invalid status code
///
///
@@ -1250,14 +1346,13 @@ internal FormulasOperations(DevTestLabsClient client)
string _responseContent = null;
if ((int)_statusCode != 200)
{
- var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ var ex = new ErrorResponseException(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);
+ ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
if (_errorBody != null)
{
- ex = new CloudException(_errorBody.Message);
ex.Body = _errorBody;
}
}
@@ -1267,10 +1362,6 @@ internal FormulasOperations(DevTestLabsClient client)
}
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)
{
ServiceClientTracing.Error(_invocationId, ex);
diff --git a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperationsExtensions.cs b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperationsExtensions.cs
index ff69f07d4986..54d4710860f5 100644
--- a/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperationsExtensions.cs
+++ b/sdk/devtestlabs/Microsoft.Azure.Management.DevTestLabs/src/Generated/FormulasOperationsExtensions.cs
@@ -29,7 +29,7 @@ public static partial class FormulasOperationsExtensions
/// The operations group for this extension method.
///
///