diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/AppPatch.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/AppPatch.cs index 3cbd09426950..1e5769cedb3c 100644 --- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/AppPatch.cs +++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Generated/Models/AppPatch.cs @@ -35,6 +35,7 @@ public AppPatch() /// Initializes a new instance of the AppPatch class. /// /// Instance tags + /// A valid instance SKU. /// The ID of the application. /// The display name of the /// application. @@ -44,9 +45,10 @@ public AppPatch() /// application. Optional; if not specified, defaults to a blank /// blueprint and allows the application to be defined from /// scratch. - public AppPatch(IDictionary tags = default(IDictionary), string applicationId = default(string), string displayName = default(string), string subdomain = default(string), string template = default(string)) + public AppPatch(IDictionary tags = default(IDictionary), AppSkuInfo sku = default(AppSkuInfo), string applicationId = default(string), string displayName = default(string), string subdomain = default(string), string template = default(string)) { Tags = tags; + Sku = sku; ApplicationId = applicationId; DisplayName = displayName; Subdomain = subdomain; @@ -65,6 +67,12 @@ public AppPatch() [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } + /// + /// Gets or sets a valid instance SKU. + /// + [JsonProperty(PropertyName = "sku")] + public AppSkuInfo Sku { get; set; } + /// /// Gets the ID of the application. /// @@ -92,5 +100,18 @@ public AppPatch() [JsonProperty(PropertyName = "properties.template")] public string Template { get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Sku != null) + { + Sku.Validate(); + } + } } } diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Microsoft.Azure.Management.IotCentral.csproj b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Microsoft.Azure.Management.IotCentral.csproj index fc621e049ee0..7eb936a97c19 100644 --- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Microsoft.Azure.Management.IotCentral.csproj +++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Microsoft.Azure.Management.IotCentral.csproj @@ -8,11 +8,11 @@ Provides management capabilities for Microsoft Azure IotCentral. Microsoft Azure IotCentral Management Microsoft.Azure.Management.IotCentral - 2.1.0 + 2.2.0 Microsoft Azure IotCentral;IotCentral management;IotCentral; diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Properties/AssemblyInfo.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Properties/AssemblyInfo.cs index b87ec0d1f3a7..852680e5f015 100644 --- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Properties/AssemblyInfo.cs +++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/Properties/AssemblyInfo.cs @@ -7,8 +7,8 @@ [assembly: AssemblyTitle("Microsoft Azure IotCentral Management Library")] [assembly: AssemblyDescription("Provides management functionality for Microsoft Azure IotCentral Resources.")] -[assembly: AssemblyVersion("2.1.0.0")] -[assembly: AssemblyFileVersion("2.1.0.0")] +[assembly: AssemblyVersion("2.2.0.0")] +[assembly: AssemblyFileVersion("2.2.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/generate.ps1 b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/generate.ps1 index 982b3628cbf4..e1e96c29bfec 100644 --- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/generate.ps1 +++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/src/generate.ps1 @@ -1 +1 @@ -Start-AutoRestCodeGeneration -ResourceProvider "iotcentral/resource-manager" -AutoRestVersion "latest" -SdkGenerationDirectory "$PSScriptRoot\Generated" \ No newline at end of file +Start-AutoRestCodeGeneration -ResourceProvider "iotcentral/resource-manager" -AutoRestVersion "v2" -SdkGenerationDirectory "$PSScriptRoot\Generated" \ No newline at end of file diff --git a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/tests/ScenarioTests/IotCentralLifeCycleTests.cs b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/tests/ScenarioTests/IotCentralLifeCycleTests.cs index dfbf99da0d7a..2c8cbadd965c 100644 --- a/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/tests/ScenarioTests/IotCentralLifeCycleTests.cs +++ b/sdk/iotcentral/Microsoft.Azure.Management.IotCentral/tests/ScenarioTests/IotCentralLifeCycleTests.cs @@ -15,6 +15,7 @@ namespace IotCentral.Tests.ScenarioTests using Newtonsoft.Json.Linq; using Xunit; using Microsoft.Rest; + using Microsoft.Rest.Azure; public class IotCentralLifeCycleTests : IotCentralTestBase { @@ -147,32 +148,6 @@ public void TestAppWhenNullAppSkuInfo() Assert.True(exceptionThrown); } - [Fact] - public void TestAppWhenInvalidSubdomain() - { - var exceptionThrown = false; - try - { - App app = new App() - { - Location = IotCentralTestUtilities.DefaultLocation, - Sku = new AppSkuInfo() - { - Name = "ST1" - }, - Subdomain = "SOME-INVALID-SUBDOMAIN", - DisplayName = IotCentralTestUtilities.DefaultUpdateResourceName - }; - app.Validate(); - } - catch (Exception ex) - { - exceptionThrown = true; - Assert.Equal(typeof(ValidationException), ex.GetType()); - } - Assert.True(exceptionThrown); - } - [Fact] public void TestAppSkuInfoWhenNullInput() { @@ -207,24 +182,6 @@ public void TestOperationInputsWhenNullInput() Assert.True(exceptionThrown); } - [Fact] - public void TestOperationInputsWhenInvalidInput() - { - var exceptionThrown = false; - try - { - var nameInput = "SOMEINVALIDINPUT"; - OperationInputs operationInput = new OperationInputs(nameInput); - operationInput.Validate(); - } - catch (Exception ex) - { - exceptionThrown = true; - Assert.Equal(typeof(ValidationException), ex.GetType()); - } - Assert.True(exceptionThrown); - } - [Fact] public void TestResourceWhenNullLocation() {