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

[ApiManagement] Fix model creation parameters #26714

Merged
merged 2 commits into from
Nov 18, 2024
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 @@ -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