Skip to content

Commit 4ad1ac1

Browse files
authored
[ApiManagement] Remove Microsoft.Azure.Management.ApiManagement 8.0.0.0-preview and add ApiManagement.Management.Sdk (#26174)
* ApiManagement SDK * autorest powershell generated with issues * fix product response issue and other types * ApiManagment Changelog * Model property rename PublicIpAddressId
1 parent 8e72c4d commit 4ad1ac1

File tree

776 files changed

+185525
-66
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

776 files changed

+185525
-66
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<PsModuleName>ApiManagement</PsModuleName>
4+
</PropertyGroup>
5+
<Import Project="$(MSBuildThisFileDirectory)..\..\Az.props" />
6+
<PropertyGroup>
7+
<TargetFramework>netstandard2.0</TargetFramework>
8+
<AssemblyName>Microsoft.Azure.PowerShell.ApiManagement.Management.Sdk</AssemblyName>
9+
<RootNamespace>Microsoft.Azure.Management.ApiManagement</RootNamespace>
10+
<NoWarn>$(NoWarn);CS0108;CS1573</NoWarn>
11+
</PropertyGroup>
12+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.Post.props" />
13+
</Project>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+

2+
namespace Microsoft.Azure.Management.ApiManagement.Models
3+
{
4+
/// <summary>
5+
/// API details.
6+
/// </summary>
7+
public static class ApiRevisionExtensions
8+
{
9+
public static string ApiRevisionIdentifier(this string apiId, string revisionId)
10+
{
11+
if (!string.IsNullOrEmpty(apiId) && !string.IsNullOrEmpty(revisionId))
12+
{
13+
return $"{apiId};rev={revisionId}";
14+
}
15+
16+
return null;
17+
}
18+
19+
public static string ApiRevisionIdentifierFullPath(this string apiId, string revisionId)
20+
{
21+
if (!string.IsNullOrEmpty(apiId) && !string.IsNullOrEmpty(revisionId))
22+
{
23+
return $"/apis/{apiId};rev={revisionId}";
24+
}
25+
return null;
26+
}
27+
}
28+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace Microsoft.Azure.Management.ApiManagement.Customization.Models
8+
{
9+
public static class DiagnosticContractExtension
10+
{
11+
public static string LoggerIdIdentifier(this string loggerId)
12+
{
13+
if (!string.IsNullOrEmpty(loggerId))
14+
{
15+
return $"/loggers/{loggerId}";
16+
}
17+
return null;
18+
}
19+
}
20+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
5+
namespace Microsoft.Azure.Management.ApiManagement.Models
6+
{
7+
/// <summary>
8+
/// Logger Contract extension.
9+
/// </summary>
10+
public partial class LoggerContract
11+
{
12+
public string CredentialsPropertyName
13+
{
14+
get
15+
{
16+
if (this.Credentials != null)
17+
{
18+
if (this.LoggerType.Equals(Models.LoggerType.AzureEventHub))
19+
{
20+
if (this.Credentials.TryGetValue(LoggerConstants.EventHubPropertyName, out string propertyName))
21+
{
22+
return propertyName?.Replace("{", "").Replace("}", "");
23+
}
24+
}
25+
else if (this.LoggerType.Equals(Models.LoggerType.ApplicationInsights))
26+
{
27+
if (this.Credentials.TryGetValue(LoggerConstants.ApplicationInsightsPropertyName, out string propertyName))
28+
{
29+
return propertyName?.Replace("{", "").Replace("}", "");
30+
}
31+
}
32+
}
33+
34+
return null;
35+
}
36+
}
37+
}
38+
39+
public class LoggerConstants
40+
{
41+
/// <summary>
42+
/// Property required for EventHub Logger Create Contract
43+
/// </summary>
44+
public const string EventHubPropertyName = "connectionString";
45+
46+
/// <summary>
47+
/// Property required for ApplicationInsights Logger Create Contract
48+
/// </summary>
49+
public const string ApplicationInsightsPropertyName = "instrumentationKey";
50+
}
51+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
5+
namespace Microsoft.Azure.Management.ApiManagement.Models
6+
{
7+
using System.Text.RegularExpressions;
8+
9+
/// <summary>
10+
/// Subscription details.
11+
/// </summary>
12+
public partial class OperationContract
13+
{
14+
private static readonly Regex OperationIdPathRegex = new Regex(@"/subscriptions/(?<subName>.+)/resourceGroups/(?<rgName>.+)/providers/Microsoft.ApiManagement/service/(?<serviceName>.+)/apis/(?<aid>.+)/operations/(?<oid>.+)");
15+
16+
public string ApiIdentifier
17+
{
18+
get
19+
{
20+
if (!string.IsNullOrWhiteSpace(this.Id))
21+
{
22+
var match = OperationIdPathRegex.Match(this.Id);
23+
if (match.Success)
24+
{
25+
var aidGroup = match.Groups["aid"];
26+
if (aidGroup != null && aidGroup.Success)
27+
{
28+
return aidGroup.Value;
29+
}
30+
}
31+
}
32+
33+
return this.Id;
34+
}
35+
}
36+
}
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
5+
namespace Microsoft.Azure.Management.ApiManagement.Models
6+
{
7+
using System;
8+
using System.Text.RegularExpressions;
9+
10+
/// <summary>
11+
/// Portal Delegation Settings.
12+
/// </summary>
13+
public partial class PortalDelegationSettings
14+
{
15+
const int ValidateKeyLength = 64;
16+
17+
public static string GenerateValidationKey()
18+
{
19+
var bytes = new byte[ValidateKeyLength];
20+
Random rnd = new Random();
21+
rnd.NextBytes(bytes);
22+
23+
return Convert.ToBase64String(bytes);
24+
}
25+
}
26+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
5+
namespace Microsoft.Azure.Management.ApiManagement.Models
6+
{
7+
using System;
8+
using Newtonsoft.Json.Linq;
9+
10+
public partial class SchemaContract
11+
{
12+
/// <summary>
13+
/// Gets the Wsdl Schema from the Document JObject
14+
/// </summary>
15+
public string WsdlSchema
16+
{
17+
get
18+
{
19+
if (!string.IsNullOrWhiteSpace(this.ContentType) &&
20+
this.ContentType.Equals("application/vnd.ms-azure-apim.xsd+xml", StringComparison.OrdinalIgnoreCase))
21+
{
22+
23+
return this.Value;
24+
}
25+
return null;
26+
}
27+
}
28+
}
29+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for
3+
// license information.
4+
5+
namespace Microsoft.Azure.Management.ApiManagement.Models
6+
{
7+
using System.Linq;
8+
9+
/// <summary>
10+
/// Subscription details.
11+
/// </summary>
12+
public partial class SubscriptionContract
13+
{
14+
public string ScopeIdentifier
15+
{
16+
get
17+
{
18+
if (!string.IsNullOrEmpty(this.Scope))
19+
{
20+
return this.Scope.Split(new[] { '/' }).Last();
21+
}
22+
23+
return null;
24+
}
25+
}
26+
27+
public string OwnerIdentifier
28+
{
29+
get
30+
{
31+
if (!string.IsNullOrEmpty(this.OwnerId))
32+
{
33+
return this.OwnerId.Split(new[] { '/' }).Last();
34+
}
35+
36+
return null;
37+
}
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)