From 4d3a9705db59381f775639bf0692719d6f91cd68 Mon Sep 17 00:00:00 2001 From: JoyerJin <116236375+JoyerJin@users.noreply.github.com> Date: Fri, 15 Nov 2024 17:34:30 +0800 Subject: [PATCH 1/2] Update model creation parameter location or order --- .../ApiManagementClient.cs | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/src/ApiManagement/ApiManagement.ServiceManagement/ApiManagementClient.cs b/src/ApiManagement/ApiManagement.ServiceManagement/ApiManagementClient.cs index 76d3534bbdbc..1a2041cf6191 100644 --- a/src/ApiManagement/ApiManagement.ServiceManagement/ApiManagementClient.cs +++ b/src/ApiManagement/ApiManagement.ServiceManagement/ApiManagementClient.cs @@ -1403,7 +1403,7 @@ public PsApiManagementApi ApiCreateRevision( } else { - apiCreateParams = new ApiCreateOrUpdateParameter(api.Path); + apiCreateParams = new ApiCreateOrUpdateParameter(path: api.Path); apiCreateParams.SourceApiId = Utils.GetApiIdFullPath(apiId, sourceRevisionId); } @@ -1909,8 +1909,9 @@ public PsApiManagementProduct ProductCreate( int? subscriptionsLimit, PsApiManagementProductState? state) { - var productContract = new ProductContract(title) - { + var productContract = new ProductContract() + { + DisplayName = title, ApprovalRequired = approvalRequired, Description = description, SubscriptionRequired = subscriptionRequired, @@ -2086,14 +2087,14 @@ public PsApiManagementSubscription SubscriptionCreate( if (productId != null) { createParameters = new SubscriptionCreateParameters( - Utils.GetProductIdFullPath(productId), - name); + scope: Utils.GetProductIdFullPath(productId), + displayName: name); } else { createParameters = new SubscriptionCreateParameters( - scope, - name); + scope: scope, + displayName: name); } if (primaryKey != null) @@ -2393,7 +2394,7 @@ public PsApiManagementGroup GroupCreate( PsApiManagementGroupType? type, string externalId) { - var groupCreateParameters = new GroupCreateParameters(name) + var groupCreateParameters = new GroupCreateParameters(displayName: name) { Description = description }; @@ -3219,7 +3220,12 @@ public PsApiManagementOpenIdConnectProvider OpenIdProviderCreate( string clientSecret, string description) { - var openIdProviderCreateParameters = new OpenidConnectProviderContract(name, metadataEndpointUri, clientId); + var openIdProviderCreateParameters = new OpenidConnectProviderContract() + { + DisplayName = name, + MetadataEndpoint = metadataEndpointUri, + ClientId = clientId + }; if (!string.IsNullOrWhiteSpace(clientSecret)) { @@ -3498,7 +3504,7 @@ public PsApiManagementIdentityProvider IdentityProviderCreate( string profileEditPolicyName, string signinTenant) { - var identityProviderCreateParameters = new IdentityProviderCreateContract(clientId, clientSecret); + var identityProviderCreateParameters = new IdentityProviderCreateContract(clientId: clientId, clientSecret: clientSecret); if (allowedTenants != null) { identityProviderCreateParameters.AllowedTenants = allowedTenants; @@ -3674,7 +3680,7 @@ public PsApiManagementBackend BackendCreate( PsApiManagementBackendProxy proxy, PsApiManagementServiceFabric serviceFabric) { - var backendCreateParams = new BackendContract(url, protocol); + var backendCreateParams = new BackendContract(url: url, protocol: protocol); if (!string.IsNullOrEmpty(resourceId)) { backendCreateParams.ResourceId = resourceId; @@ -3878,7 +3884,7 @@ public PsApiManagementCache CacheCreate( string resourceid, string UseFromLocation) { - var cacheCreateParameters = new CacheContract(connectionString, UseFromLocation); + var cacheCreateParameters = new CacheContract(connectionString: connectionString, useFromLocation: UseFromLocation); if (description != null) { cacheCreateParameters.Description = description; @@ -3988,7 +3994,7 @@ public PsApiManagementDiagnostic DiagnosticCreate( PsApiManagementPipelineDiagnosticSetting frontend, PsApiManagementPipelineDiagnosticSetting backend) { - var diagnosticContract = new DiagnosticContract(Utils.GetLoggerIdFullPath(loggerId)); + var diagnosticContract = new DiagnosticContract(loggerId: Utils.GetLoggerIdFullPath(loggerId)); if (!string.IsNullOrEmpty(alwaysLog)) { diagnosticContract.AlwaysLog = Utils.GetAlwaysLog(alwaysLog); From 36444cf2e73efcc0f6c5a7780f268f0240cb4e47 Mon Sep 17 00:00:00 2001 From: JoyerJin <116236375+JoyerJin@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:32:30 +0800 Subject: [PATCH 2/2] Update ChangeLog.md --- src/ApiManagement/ApiManagement/ChangeLog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ApiManagement/ApiManagement/ChangeLog.md b/src/ApiManagement/ApiManagement/ChangeLog.md index 5ad32ac8c714..4a95446a6006 100644 --- a/src/ApiManagement/ApiManagement/ChangeLog.md +++ b/src/ApiManagement/ApiManagement/ChangeLog.md @@ -18,6 +18,7 @@ - Additional information about change #1 --> ## Upcoming Release +* Fixed model creation parameters of ApiCreateOrUpdateParameter, ProductContract, SubscriptionCreateParameters, GroupCreateParameters, OpenidConnectProviderContract, IdentityProviderCreateContract, BackendContract, CacheContract and DiagnosticContract with [#26672]. ## Version 4.0.5 * Removed Microsoft.Azure.Management.ApiManagement 8.0.0.0-preview