Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace ApiManagement.Tests.ManagementApiTests
{
public class TenantGitTests : TestBase
{
[Fact(Skip = "ReRecord due to CR change")]
[Fact]
public async Task ValidateSaveDeploy()
{
Environment.SetEnvironmentVariable("AZURE_TEST_MODE", "Playback");
Expand Down Expand Up @@ -42,14 +42,15 @@ public async Task ValidateSaveDeploy()

// save changes in current database to configuration database
var saveConfigurationParameters = new SaveConfigurationParameter("master");
var getSaveResponse = testBase.client.TenantConfiguration.Save(
OperationResultContract getSaveResponse = testBase.client.TenantConfiguration.Save(
testBase.rgName,
testBase.serviceName,
saveConfigurationParameters);

Assert.NotNull(getSaveResponse);
Assert.NotNull(getSaveResponse.Status);
Assert.NotNull(getSaveResponse.ResultInfo);
Assert.Null(getSaveResponse.Error);
Assert.Equal(AsyncOperationStatus.Succeeded, getSaveResponse.Status);

// get the sync state of the repository after Save
Expand All @@ -63,23 +64,25 @@ public async Task ValidateSaveDeploy()

// validate changes in current database to configuration database
var deployConfigurationParameters = new DeployConfigurationParameters("master");
var getValidateResponse = testBase.client.TenantConfiguration.Validate(
OperationResultContract getValidateResponse = testBase.client.TenantConfiguration.Validate(
testBase.rgName,
testBase.serviceName,
deployConfigurationParameters);

Assert.NotNull(getValidateResponse);
Assert.NotNull(getSaveResponse.ResultInfo);
Assert.Null(getSaveResponse.Error);
Assert.Equal(AsyncOperationStatus.Succeeded, getSaveResponse.Status);

// deploy changes in current database to configuration database
var getDeployResponse = testBase.client.TenantConfiguration.Deploy(
OperationResultContract getDeployResponse = testBase.client.TenantConfiguration.Deploy(
testBase.rgName,
testBase.serviceName,
deployConfigurationParameters);

Assert.NotNull(getDeployResponse);
Assert.NotNull(getDeployResponse.ResultInfo);
Assert.Null(getSaveResponse.Error);
Assert.Equal(AsyncOperationStatus.Succeeded, getDeployResponse.Status);

// get the sync state of the repository
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ public partial interface IProductApiOperations
/// service instance.
/// </param>
/// <param name='apiId'>
/// API identifier. Must be unique in the current API Management
/// service instance.
/// API revision identifier. Must be unique in the current API
/// Management service instance. Non-current revision has ;rev=n as a
/// suffix where n is the revision number.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
Expand Down Expand Up @@ -101,8 +102,9 @@ public partial interface IProductApiOperations
/// service instance.
/// </param>
/// <param name='apiId'>
/// API identifier. Must be unique in the current API Management
/// service instance.
/// API revision identifier. Must be unique in the current API
/// Management service instance. Non-current revision has ;rev=n as a
/// suffix where n is the revision number.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
Expand Down Expand Up @@ -134,8 +136,9 @@ public partial interface IProductApiOperations
/// service instance.
/// </param>
/// <param name='apiId'>
/// API identifier. Must be unique in the current API Management
/// service instance.
/// API revision identifier. Must be unique in the current API
/// Management service instance. Non-current revision has ;rev=n as a
/// suffix where n is the revision number.
/// </param>
/// <param name='customHeaders'>
/// The headers that will be added to request.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// <auto-generated>
// 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.
// </auto-generated>

namespace Microsoft.Azure.Management.ApiManagement.Models
{
using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

/// <summary>
/// Error Body contract.
/// </summary>
public partial class ErrorResponseBody
{
/// <summary>
/// Initializes a new instance of the ErrorResponseBody class.
/// </summary>
public ErrorResponseBody()
{
CustomInit();
}

/// <summary>
/// Initializes a new instance of the ErrorResponseBody class.
/// </summary>
/// <param name="code">Service-defined error code. This code serves as
/// a sub-status for the HTTP error code specified in the
/// response.</param>
/// <param name="message">Human-readable representation of the
/// error.</param>
/// <param name="details">The list of invalid fields send in request,
/// in case of validation error.</param>
public ErrorResponseBody(string code = default(string), string message = default(string), IList<ErrorFieldContract> details = default(IList<ErrorFieldContract>))
{
Code = code;
Message = message;
Details = details;
CustomInit();
}

/// <summary>
/// An initialization method that performs custom operations like setting defaults
/// </summary>
partial void CustomInit();

/// <summary>
/// Gets or sets service-defined error code. This code serves as a
/// sub-status for the HTTP error code specified in the response.
/// </summary>
[JsonProperty(PropertyName = "code")]
public string Code { get; set; }

/// <summary>
/// Gets or sets human-readable representation of the error.
/// </summary>
[JsonProperty(PropertyName = "message")]
public string Message { get; set; }

/// <summary>
/// Gets or sets the list of invalid fields send in request, in case of
/// validation error.
/// </summary>
[JsonProperty(PropertyName = "details")]
public IList<ErrorFieldContract> Details { get; set; }

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public OperationResultContract()
/// the TenantConfiguration_Validate operation. It contains the log the
/// entities which will be updated/created/deleted as part of the
/// TenantConfiguration_Deploy operation.</param>
public OperationResultContract(string id = default(string), AsyncOperationStatus? status = default(AsyncOperationStatus?), System.DateTime? started = default(System.DateTime?), System.DateTime? updated = default(System.DateTime?), string resultInfo = default(string), ErrorResponse error = default(ErrorResponse), IList<OperationResultLogItemContract> actionLog = default(IList<OperationResultLogItemContract>))
public OperationResultContract(string id = default(string), AsyncOperationStatus? status = default(AsyncOperationStatus?), System.DateTime? started = default(System.DateTime?), System.DateTime? updated = default(System.DateTime?), string resultInfo = default(string), ErrorResponseBody error = default(ErrorResponseBody), IList<OperationResultLogItemContract> actionLog = default(IList<OperationResultLogItemContract>))
{
Id = id;
Status = status;
Expand Down Expand Up @@ -106,7 +106,7 @@ public OperationResultContract()
/// Gets or sets error Body Contract
/// </summary>
[JsonProperty(PropertyName = "error")]
public ErrorResponse Error { get; set; }
public ErrorResponseBody Error { get; set; }

/// <summary>
/// Gets this property if only provided as part of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,9 @@ internal ProductApiOperations(ApiManagementClient client)
/// instance.
/// </param>
/// <param name='apiId'>
/// API identifier. Must be unique in the current API Management service
/// instance.
/// API revision identifier. Must be unique in the current API Management
/// service instance. Non-current revision has ;rev=n as a suffix where n is
/// the revision number.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
Expand Down Expand Up @@ -380,17 +381,17 @@ internal ProductApiOperations(ApiManagementClient client)
}
if (apiId != null)
{
if (apiId.Length > 80)
if (apiId.Length > 256)
{
throw new ValidationException(ValidationRules.MaxLength, "apiId", 80);
throw new ValidationException(ValidationRules.MaxLength, "apiId", 256);
}
if (apiId.Length < 1)
{
throw new ValidationException(ValidationRules.MinLength, "apiId", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(apiId, "(^[\\w]+$)|(^[\\w][\\w\\-]+[\\w]$)"))
if (!System.Text.RegularExpressions.Regex.IsMatch(apiId, "^[^*#&+:<>?]+$"))
{
throw new ValidationException(ValidationRules.Pattern, "apiId", "(^[\\w]+$)|(^[\\w][\\w\\-]+[\\w]$)");
throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$");
}
}
if (Client.ApiVersion == null)
Expand Down Expand Up @@ -545,8 +546,9 @@ internal ProductApiOperations(ApiManagementClient client)
/// instance.
/// </param>
/// <param name='apiId'>
/// API identifier. Must be unique in the current API Management service
/// instance.
/// API revision identifier. Must be unique in the current API Management
/// service instance. Non-current revision has ;rev=n as a suffix where n is
/// the revision number.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
Expand Down Expand Up @@ -619,17 +621,17 @@ internal ProductApiOperations(ApiManagementClient client)
}
if (apiId != null)
{
if (apiId.Length > 80)
if (apiId.Length > 256)
{
throw new ValidationException(ValidationRules.MaxLength, "apiId", 80);
throw new ValidationException(ValidationRules.MaxLength, "apiId", 256);
}
if (apiId.Length < 1)
{
throw new ValidationException(ValidationRules.MinLength, "apiId", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(apiId, "(^[\\w]+$)|(^[\\w][\\w\\-]+[\\w]$)"))
if (!System.Text.RegularExpressions.Regex.IsMatch(apiId, "^[^*#&+:<>?]+$"))
{
throw new ValidationException(ValidationRules.Pattern, "apiId", "(^[\\w]+$)|(^[\\w][\\w\\-]+[\\w]$)");
throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$");
}
}
if (Client.ApiVersion == null)
Expand Down Expand Up @@ -819,8 +821,9 @@ internal ProductApiOperations(ApiManagementClient client)
/// instance.
/// </param>
/// <param name='apiId'>
/// API identifier. Must be unique in the current API Management service
/// instance.
/// API revision identifier. Must be unique in the current API Management
/// service instance. Non-current revision has ;rev=n as a suffix where n is
/// the revision number.
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
Expand Down Expand Up @@ -890,17 +893,17 @@ internal ProductApiOperations(ApiManagementClient client)
}
if (apiId != null)
{
if (apiId.Length > 80)
if (apiId.Length > 256)
{
throw new ValidationException(ValidationRules.MaxLength, "apiId", 80);
throw new ValidationException(ValidationRules.MaxLength, "apiId", 256);
}
if (apiId.Length < 1)
{
throw new ValidationException(ValidationRules.MinLength, "apiId", 1);
}
if (!System.Text.RegularExpressions.Regex.IsMatch(apiId, "(^[\\w]+$)|(^[\\w][\\w\\-]+[\\w]$)"))
if (!System.Text.RegularExpressions.Regex.IsMatch(apiId, "^[^*#&+:<>?]+$"))
{
throw new ValidationException(ValidationRules.Pattern, "apiId", "(^[\\w]+$)|(^[\\w][\\w\\-]+[\\w]$)");
throw new ValidationException(ValidationRules.Pattern, "apiId", "^[^*#&+:<>?]+$");
}
}
if (Client.ApiVersion == null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ public static partial class ProductApiOperationsExtensions
/// instance.
/// </param>
/// <param name='apiId'>
/// API identifier. Must be unique in the current API Management service
/// instance.
/// API revision identifier. Must be unique in the current API Management
/// service instance. Non-current revision has ;rev=n as a suffix where n is
/// the revision number.
/// </param>
public static bool CheckEntityExists(this IProductApiOperations operations, string resourceGroupName, string serviceName, string productId, string apiId)
{
Expand All @@ -120,8 +121,9 @@ public static bool CheckEntityExists(this IProductApiOperations operations, stri
/// instance.
/// </param>
/// <param name='apiId'>
/// API identifier. Must be unique in the current API Management service
/// instance.
/// API revision identifier. Must be unique in the current API Management
/// service instance. Non-current revision has ;rev=n as a suffix where n is
/// the revision number.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
Expand Down Expand Up @@ -151,8 +153,9 @@ public static bool CheckEntityExists(this IProductApiOperations operations, stri
/// instance.
/// </param>
/// <param name='apiId'>
/// API identifier. Must be unique in the current API Management service
/// instance.
/// API revision identifier. Must be unique in the current API Management
/// service instance. Non-current revision has ;rev=n as a suffix where n is
/// the revision number.
/// </param>
public static ApiContract CreateOrUpdate(this IProductApiOperations operations, string resourceGroupName, string serviceName, string productId, string apiId)
{
Expand All @@ -176,8 +179,9 @@ public static ApiContract CreateOrUpdate(this IProductApiOperations operations,
/// instance.
/// </param>
/// <param name='apiId'>
/// API identifier. Must be unique in the current API Management service
/// instance.
/// API revision identifier. Must be unique in the current API Management
/// service instance. Non-current revision has ;rev=n as a suffix where n is
/// the revision number.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
Expand Down Expand Up @@ -207,8 +211,9 @@ public static ApiContract CreateOrUpdate(this IProductApiOperations operations,
/// instance.
/// </param>
/// <param name='apiId'>
/// API identifier. Must be unique in the current API Management service
/// instance.
/// API revision identifier. Must be unique in the current API Management
/// service instance. Non-current revision has ;rev=n as a suffix where n is
/// the revision number.
/// </param>
public static void Delete(this IProductApiOperations operations, string resourceGroupName, string serviceName, string productId, string apiId)
{
Expand All @@ -232,8 +237,9 @@ public static void Delete(this IProductApiOperations operations, string resource
/// instance.
/// </param>
/// <param name='apiId'>
/// API identifier. Must be unique in the current API Management service
/// instance.
/// API revision identifier. Must be unique in the current API Management
/// service instance. Non-current revision has ;rev=n as a suffix where n is
/// the revision number.
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<Description>Provides ApiManagement management capabilities for Microsoft Azure.</Description>
<AssemblyTitle>Microsoft Azure API Management Management</AssemblyTitle>
<AssemblyName>Microsoft.Azure.Management.ApiManagement</AssemblyName>
<Version>4.0.2-preview</Version>
<Version>4.0.3-preview</Version>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the AssmeblyFileVersion to 4.0.3 here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

<PackageTags>Microsoft Azure ApiManagement management;API Management;</PackageTags>
<PackageReleaseNotes>Refer https://aka.ms/apimdotnetsdkchangelog for release notes.</PackageReleaseNotes>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyDescription("Provides Api management capabilities for Microsoft Azure.")]

[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.3.0")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("Azure .NET SDK")]
Expand Down
7 changes: 0 additions & 7 deletions src/SDKs/ApiManagement/Management.ApiManagement/generate.cmd

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Start-AutoRestCodeGeneration -ResourceProvider "apimanagement/resource-manager" -AutoRestVersion "latest"
5 changes: 5 additions & 0 deletions src/SDKs/ApiManagement/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Microsoft.Azure.Management.ApiManagment release notes

### Changes in 4.0.3-preview

- Fixed contract for Error in OperationResultContract
- Fixed validation for adding Apis to Product

### Changes in 4.0.2-preview

- Fixed Contract for ErrorResponse for Management Apis
Expand Down
Loading