Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IotCentral] Update C# sdk, Change error to be CloudException, and remove regex check for IOTC app #10322

Merged
merged 3 commits into from
Mar 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions eng/mgmt/mgmtmetadata/iotcentral_resource-manager.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/iotcentral/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp.output-folder=C:\Users\pochen\Github\azure-sdk-for-net\sdk\iotcentral\Microsoft.Azure.Management.IotCentral\src\Generated
2020-01-02 19:34:34 UTC
cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/iotcentral/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp.output-folder=D:\azure-sdk-for-net\sdk\iotcentral\Microsoft.Azure.Management.IotCentral\src\Generated
2020-03-05 20:09:29 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
Commit: 4676d9187988aa6793ff704aa39c5f495b40f6e0
Commit: 57ba23526b8ef2ddd52165d54e20d66f5563e8f4
AutoRest information
Requested version: latest
Bootstrapper version: autorest@2.0.4407
Bootstrapper version: autorest@3.0.6187

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand Down Expand Up @@ -72,7 +72,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand Down Expand Up @@ -101,7 +101,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand All @@ -127,7 +127,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
Expand All @@ -143,7 +143,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand All @@ -166,7 +166,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand All @@ -189,7 +189,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand All @@ -212,7 +212,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand All @@ -231,7 +231,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand Down Expand Up @@ -264,7 +264,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand Down Expand Up @@ -293,7 +293,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand All @@ -319,7 +319,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.ValidationException">
Expand All @@ -338,7 +338,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand All @@ -360,7 +360,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand All @@ -382,7 +382,7 @@ public partial interface IAppsOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public partial interface IOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand All @@ -56,7 +56,7 @@ public partial interface IOperations
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
/// <exception cref="ErrorDetailsException">
/// <exception cref="Microsoft.Rest.Azure.CloudException">
/// Thrown when the operation returned an invalid status code
/// </exception>
/// <exception cref="Microsoft.Rest.SerializationException">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,6 @@ public override void Validate()
{
throw new ValidationException(ValidationRules.CannotBeNull, "Sku");
}
if (DisplayName != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(DisplayName, "^.{1,200}$"))
{
throw new ValidationException(ValidationRules.Pattern, "DisplayName", "^.{1,200}$");
}
}
if (Subdomain != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(Subdomain, "^[a-z0-9-]{1,63}$"))
{
throw new ValidationException(ValidationRules.Pattern, "Subdomain", "^[a-z0-9-]{1,63}$");
}
}
if (Sku != null)
{
Sku.Validate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,28 +92,5 @@ public AppPatch()
[JsonProperty(PropertyName = "properties.template")]
public string Template { get; set; }

/// <summary>
/// Validate the object.
/// </summary>
/// <exception cref="ValidationException">
/// Thrown if validation fails
/// </exception>
public virtual void Validate()
{
if (DisplayName != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(DisplayName, "^.{1,200}$"))
{
throw new ValidationException(ValidationRules.Pattern, "DisplayName", "^.{1,200}$");
}
}
if (Subdomain != null)
{
if (!System.Text.RegularExpressions.Regex.IsMatch(Subdomain, "^[a-z0-9-]{1,63}$"))
{
throw new ValidationException(ValidationRules.Pattern, "Subdomain", "^[a-z0-9-]{1,63}$");
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,25 @@ namespace Microsoft.Azure.Management.IotCentral.Models
/// <summary>
/// Details of error response.
/// </summary>
public partial class ErrorResponseBody
public partial class CloudErrorBody
{
/// <summary>
/// Initializes a new instance of the ErrorResponseBody class.
/// Initializes a new instance of the CloudErrorBody class.
/// </summary>
public ErrorResponseBody()
public CloudErrorBody()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the ErrorResponseBody class.
/// Initializes a new instance of the CloudErrorBody class.
/// </summary>
/// <param name="code">The error code.</param>
/// <param name="message">The error message.</param>
/// <param name="target">The target of the particular error.</param>
/// <param name="details">A list of additional details about the
/// error.</param>
public ErrorResponseBody(string code = default(string), string message = default(string), string target = default(string), IList<ErrorResponseBody> details = default(IList<ErrorResponseBody>))
public CloudErrorBody(string code = default(string), string message = default(string), string target = default(string), IList<CloudErrorBody> details = default(IList<CloudErrorBody>))
{
Code = code;
Message = message;
Expand Down Expand Up @@ -72,7 +72,7 @@ public ErrorResponseBody()
/// Gets or sets a list of additional details about the error.
/// </summary>
[JsonProperty(PropertyName = "details")]
public IList<ErrorResponseBody> Details { get; set; }
public IList<CloudErrorBody> Details { get; set; }

}
}

This file was deleted.

Loading