Skip to content

Commit

Permalink
Merge pull request Azure#26714 from Azure/joyer/apimgnt-sdk-fix
Browse files Browse the repository at this point in the history
[ApiManagement] Fix model creation parameters
  • Loading branch information
VeryEarly authored Nov 18, 2024
2 parents 66a1da0 + 36444cf commit 3a84203
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -2393,7 +2394,7 @@ public PsApiManagementGroup GroupCreate(
PsApiManagementGroupType? type,
string externalId)
{
var groupCreateParameters = new GroupCreateParameters(name)
var groupCreateParameters = new GroupCreateParameters(displayName: name)
{
Description = description
};
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/ApiManagement/ApiManagement/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3a84203

Please sign in to comment.