Skip to content

Commit

Permalink
.NET SDK Resource Provider:'Storage' (#5523)
Browse files Browse the repository at this point in the history
REST Spec PR 'Azure/azure-rest-api-specs#5434'
REST Spec PR Author 'blueww'
REST Spec PR Last commit
  • Loading branch information
adxsdknet authored and dsgouda committed Mar 21, 2019
1 parent e1e3060 commit d5f5a14
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ internal BlobContainersOperations(StorageManagementClient client)
HttpStatusCode _statusCode = _httpResponse.StatusCode;
cancellationToken.ThrowIfCancellationRequested();
string _responseContent = null;
if ((int)_statusCode != 201)
if ((int)_statusCode != 200 && (int)_statusCode != 201)
{
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
try
Expand Down Expand Up @@ -551,6 +551,24 @@ internal BlobContainersOperations(StorageManagementClient client)
_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<BlobContainer>(_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);
Expand Down
9 changes: 4 additions & 5 deletions src/SDKs/Storage/Management.Storage/Generated/Models/Sku.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ public Sku()
/// <param name="name">Gets or sets the SKU name. Required for account
/// creation; optional for update. Note that in older versions, SKU
/// name was called accountType. Possible values include:
/// 'Standard_LRS', 'Standard_GRS', 'Standard_GZRS', 'Standard_RAGRS',
/// 'Standard_RAGZRS', 'Standard_ZRS', 'Premium_LRS',
/// 'Premium_ZRS'</param>
/// 'Standard_LRS', 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS',
/// 'Premium_LRS', 'Premium_ZRS'</param>
/// <param name="tier">Gets the SKU tier. This is based on the SKU
/// name. Possible values include: 'Standard', 'Premium'</param>
/// <param name="resourceType">The type of the resource, usually it is
Expand Down Expand Up @@ -73,8 +72,8 @@ public Sku()
/// Gets or sets the SKU name. Required for account creation; optional
/// for update. Note that in older versions, SKU name was called
/// accountType. Possible values include: 'Standard_LRS',
/// 'Standard_GRS', 'Standard_GZRS', 'Standard_RAGRS',
/// 'Standard_RAGZRS', 'Standard_ZRS', 'Premium_LRS', 'Premium_ZRS'
/// 'Standard_GRS', 'Standard_RAGRS', 'Standard_ZRS', 'Premium_LRS',
/// 'Premium_ZRS'
/// </summary>
[JsonProperty(PropertyName = "name")]
public SkuName Name { get; set; }
Expand Down
12 changes: 0 additions & 12 deletions src/SDKs/Storage/Management.Storage/Generated/Models/SkuName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ public enum SkuName
StandardLRS,
[EnumMember(Value = "Standard_GRS")]
StandardGRS,
[EnumMember(Value = "Standard_GZRS")]
StandardGZRS,
[EnumMember(Value = "Standard_RAGRS")]
StandardRAGRS,
[EnumMember(Value = "Standard_RAGZRS")]
StandardRAGZRS,
[EnumMember(Value = "Standard_ZRS")]
StandardZRS,
[EnumMember(Value = "Premium_LRS")]
Expand All @@ -53,12 +49,8 @@ internal static string ToSerializedValue(this SkuName value)
return "Standard_LRS";
case SkuName.StandardGRS:
return "Standard_GRS";
case SkuName.StandardGZRS:
return "Standard_GZRS";
case SkuName.StandardRAGRS:
return "Standard_RAGRS";
case SkuName.StandardRAGZRS:
return "Standard_RAGZRS";
case SkuName.StandardZRS:
return "Standard_ZRS";
case SkuName.PremiumLRS:
Expand All @@ -77,12 +69,8 @@ internal static string ToSerializedValue(this SkuName value)
return SkuName.StandardLRS;
case "Standard_GRS":
return SkuName.StandardGRS;
case "Standard_GZRS":
return SkuName.StandardGZRS;
case "Standard_RAGRS":
return SkuName.StandardRAGRS;
case "Standard_RAGZRS":
return SkuName.StandardRAGZRS;
case "Standard_ZRS":
return SkuName.StandardZRS;
case "Premium_LRS":
Expand Down

0 comments on commit d5f5a14

Please sign in to comment.