Skip to content

Commit

Permalink
add custom property to include missing property and update cmdlet
Browse files Browse the repository at this point in the history
  • Loading branch information
carjackson-msft committed Aug 15, 2024
1 parent bccbdba commit cb49e52
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// 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.

namespace Microsoft.Azure.Management.CosmosDB.Models
{
using System.Linq;

/// <summary>
/// Properties in ServiceResourceCreateUpdateParameters.
/// </summary>
public partial class ServiceResourceCreateUpdateProperties
{
public ServiceResourceCreateUpdateProperties(string instanceSize = default(string), int? instanceCount = default(int?), string serviceType = default(string))

{
this.InstanceSize = instanceSize;
this.InstanceCount = instanceCount;
this.ServiceType = serviceType;
CustomInit();
}

/// <summary>
/// Gets or sets serviceType for the service. Possible values include: &#39;SqlDedicatedGateway&#39;, &#39;DataTransfer&#39;, &#39;GraphAPICompute&#39;, &#39;MaterializedViewsBuilder&#39;
/// </summary>
public string ServiceType { get; set; }
}
}
4 changes: 3 additions & 1 deletion src/CosmosDB/CosmosDB/Service/NewAzCosmosDBService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ public override void ExecuteCmdlet()
ResourceGroupName = resourceIdentifier.ResourceGroupName;
}

ServiceResourceCreateUpdateParameters parameters = new ServiceResourceCreateUpdateParameters(
ServiceResourceCreateUpdateProperties properties = new ServiceResourceCreateUpdateProperties(
instanceSize: InstanceSize, instanceCount: InstanceCount, serviceType: ServiceType.SqlDedicatedGateway);

ServiceResourceCreateUpdateParameters parameters = new ServiceResourceCreateUpdateParameters(properties);

ServiceResource serviceResults = CosmosDBManagementClient.Service.CreateWithHttpMessagesAsync(ResourceGroupName, AccountName, ServiceName, parameters).GetAwaiter().GetResult().Body;
WriteObject(new PSServiceGetResults(serviceResults));

Expand Down

0 comments on commit cb49e52

Please sign in to comment.