Skip to content

Commit 7b62ab9

Browse files
committed
Removed Json, removed asJob from GET, updated Markdown
1 parent 0b0eb20 commit 7b62ab9

File tree

8 files changed

+329
-333
lines changed

8 files changed

+329
-333
lines changed

src/ResourceManager/IotCentral/Commands.IotCentral.Test/SessionRecords/Microsoft.Azure.Commands.IotCentral.Test.ScenarioTests.IotCentralTests/TestIotCentralAppLifecycleManagement.json

Lines changed: 265 additions & 265 deletions
Large diffs are not rendered by default.

src/ResourceManager/IotCentral/Commands.IotCentral/Common/IotCentralUtils.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,14 @@ namespace Microsoft.Azure.Commands.IotCentral.Common
2222
{
2323
public static class IotCentralUtils
2424
{
25-
public static T2 ConvertObject<T1, T2>(T1 iotCentralObject)
26-
{
27-
var serialized = JsonConvert.SerializeObject(iotCentralObject);
28-
return JsonConvert.DeserializeObject<T2>(serialized);
29-
}
30-
3125
public static PSIotCentralApp ToPSIotCentralApp(App iotCentralApp)
3226
{
33-
return ConvertObject<App, PSIotCentralApp>(iotCentralApp);
27+
return new PSIotCentralApp(iotCentralApp);
3428
}
3529

3630
public static IEnumerable<PSIotCentralApp> ToPSIotCentralApps(IEnumerable<App> iotCentralApps)
3731
{
38-
return ConvertObject<IEnumerable<App>, IEnumerable<PSIotCentralApp>>(iotCentralApps.ToList());
32+
return iotCentralApps.Select(app => ToPSIotCentralApp(app));
3933
}
4034

4135
public static AppPatch CreateAppPatch(App iotCentralApp)

src/ResourceManager/IotCentral/Commands.IotCentral/Models/PSIotCentralApp.cs

Lines changed: 52 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// ----------------------------------------------------------------------------------
1414

1515
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
16+
using Microsoft.Azure.Management.IotCentral.Models;
17+
using Microsoft.WindowsAzure.Commands.Common.Attributes;
1618
using Newtonsoft.Json;
1719
using System.Collections.Generic;
1820

@@ -38,73 +40,74 @@ private ResourceIdentifier Identifier
3840
}
3941
}
4042

43+
public PSIotCentralApp(App iotCentralApp){
44+
this.ResourceId = iotCentralApp.Id;
45+
this.Name = iotCentralApp.Name;
46+
this.Type = iotCentralApp.Type;
47+
this.Location = iotCentralApp.Location;
48+
this.Tag = iotCentralApp.Tags;
49+
this.Sku = new PSIotCentralAppSkuInfo() { Name = iotCentralApp.Sku.Name };
50+
this.ApplicationId = iotCentralApp.ApplicationId;
51+
this.DisplayName = iotCentralApp.DisplayName;
52+
this.Subdomain = iotCentralApp.Subdomain;
53+
this.Template = iotCentralApp.Template;
54+
}
55+
4156
/// <summary>
42-
/// The Resource Id.
57+
/// The Resource name.
4358
/// </summary>
44-
[JsonProperty(PropertyName = "id")]
45-
public string ResourceId { get; private set; }
59+
[Ps1Xml(Label = "Resource Name", Target = ViewControl.Table)]
60+
public string Name { get; private set; }
4661

4762
/// <summary>
48-
/// The Resource name.
63+
/// Gets or sets the subdomain of the application.
4964
/// </summary>
50-
[JsonProperty(PropertyName = "name")]
51-
public string Name { get; private set; }
65+
[Ps1Xml(Label = "Subdomain", Target = ViewControl.Table)]
66+
public string Subdomain { get; set; }
5267

5368
/// <summary>
54-
/// The Resource type.
69+
/// Gets or sets the display name of the application.
5570
/// </summary>
56-
[JsonProperty(PropertyName = "type")]
57-
public string Type { get; private set; }
71+
[Ps1Xml(Label = "Display Name", Target = ViewControl.Table)]
72+
public string DisplayName { get; set; }
5873

5974
/// <summary>
6075
/// The Resource location.
6176
/// </summary>
62-
[JsonProperty(PropertyName = "location")]
77+
[Ps1Xml(Label = "Location", Target = ViewControl.Table)]
6378
public string Location { get; set; }
6479

80+
/// <summary>
81+
/// Gets or sets the ID of the application template, which is a
82+
/// blueprint that defines the characteristics and behaviors of an
83+
/// application. Optional; if not specified, defaults to a blank
84+
/// blueprint and allows the application to be defined from scratch.
85+
/// </summary>
86+
[Ps1Xml(Label = "Template", Target = ViewControl.Table)]
87+
public string Template { get; set; }
88+
6589
/// <summary>
6690
/// The Resource tags.
6791
/// </summary>
68-
[JsonProperty(PropertyName = "tags")]
92+
[Ps1Xml(Label = "Tags", Target = ViewControl.Table)]
6993
public IDictionary<string, string> Tag { get; set; }
7094

7195
/// <summary>
7296
/// Gets or sets a valid instance SKU.
7397
/// </summary>
74-
[JsonProperty(PropertyName = "sku")]
98+
[Ps1Xml(Label = "Sku Name", Target = ViewControl.Table, ScriptBlock = "$_.Sku.Name")]
7599
public PSIotCentralAppSkuInfo Sku { get; set; }
76100

77101
/// <summary>
78-
/// Gets the ID of the application.
79-
/// </summary>
80-
[JsonProperty(PropertyName = "properties.applicationId")]
81-
public string ApplicationId { get; private set; }
82-
83-
/// <summary>
84-
/// Gets or sets the display name of the application.
85-
/// </summary>
86-
[JsonProperty(PropertyName = "properties.displayName")]
87-
public string DisplayName { get; set; }
88-
89-
/// <summary>
90-
/// Gets or sets the subdomain of the application.
91-
/// </summary>
92-
[JsonProperty(PropertyName = "properties.subdomain")]
93-
public string Subdomain { get; set; }
94-
95-
/// <summary>
96-
/// Gets or sets the ID of the application template, which is a
97-
/// blueprint that defines the characteristics and behaviors of an
98-
/// application. Optional; if not specified, defaults to a blank
99-
/// blueprint and allows the application to be defined from scratch.
102+
/// The Resource type.
100103
/// </summary>
101-
[JsonProperty(PropertyName = "properties.template")]
102-
public string Template { get; set; }
104+
[Ps1Xml(Label = "Type", Target = ViewControl.Table)]
105+
public string Type { get; private set; }
103106

104107
/// <summary>
105108
/// The subscription identifier.
106109
/// </summary>
107-
[JsonProperty(PropertyName = "subscriptionid")]
110+
[Ps1Xml(Label = "Subscription Id", Target = ViewControl.Table)]
108111
public string SubscriptionId
109112
{
110113
get
@@ -116,7 +119,7 @@ public string SubscriptionId
116119
/// <summary>
117120
/// The resource group name
118121
/// </summary>
119-
[JsonProperty(PropertyName = "resourcegroup")]
122+
[Ps1Xml(Label = "Resource Group Name", Target = ViewControl.Table)]
120123
public string ResourceGroupName
121124
{
122125
get
@@ -125,5 +128,16 @@ public string ResourceGroupName
125128
}
126129
}
127130

131+
/// <summary>
132+
/// The Resource Id.
133+
/// </summary>
134+
[Ps1Xml(Label = "Resource Id", Target = ViewControl.Table)]
135+
public string ResourceId { get; private set; }
136+
137+
/// <summary>
138+
/// Gets the ID of the application.
139+
/// </summary>
140+
[Ps1Xml(Label = "Application Id", Target = ViewControl.Table)]
141+
public string ApplicationId { get; private set; }
128142
}
129143
}

src/ResourceManager/IotCentral/Commands.IotCentral/Models/PSIotCentralAppSkuInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ public class PSIotCentralAppSkuInfo
2222
/// Gets or sets the name of the SKU. Possible values include: 'S1'
2323
/// </summary>
2424
[JsonProperty(PropertyName = "name")]
25-
public PSIotCentralAppSku Name { get; set; }
25+
public string Name { get; set; }
2626
}
2727
}

src/ResourceManager/IotCentral/Commands.IotCentral/help/Get-AzureRmIotCentralApp.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ Get-AzureRmIotCentralApp [-ResourceGroupName] <String> [-Name] <String>
2626

2727
### ResourceIdParameterSet
2828
```
29-
Get-AzureRmIotCentralApp -ResourceId <String> [-DefaultProfile <IAzureContextContainer>]
30-
[<CommonParameters>]
29+
Get-AzureRmIotCentralApp -ResourceId <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
3130
```
3231

3332
## DESCRIPTION
@@ -212,11 +211,9 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
212211
## INPUTS
213212
214213
### System.String
215-
216214
## OUTPUTS
217215
218216
### Microsoft.Azure.Commands.IotCentral.Models.PSIotCentralApp
219-
220217
## NOTES
221218
222219
## RELATED LINKS

src/ResourceManager/IotCentral/Commands.IotCentral/help/New-AzureRmIotCentralApp.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Creates a new IoT Central Application.
1313
## SYNTAX
1414

1515
```
16-
New-AzureRmIotCentralApp [-Subdomain] <String> [-DisplayName <String>] [-Template <String>]
17-
[-Sku <PSIotCentralAppSku>] [-Location <String>] [-Tag <Hashtable>] [-ResourceGroupName] <String>
18-
[-Name] <String> [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
16+
New-AzureRmIotCentralApp [-Subdomain] <String> [-DisplayName <String>] [-Template <String>] [-Sku <String>]
17+
[-Location <String>] [-Tag <Hashtable>] [-AsJob] [-ResourceGroupName] <String> [-Name] <String>
18+
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
1919
```
2020

2121
## DESCRIPTION
@@ -264,13 +264,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
264264
## INPUTS
265265
266266
### System.String
267-
267+
### System.Nullable`1[[Microsoft.Azure.Commands.IotCentral.Models.PSIotCentralAppSku, Microsoft.Azure.Commands.IotCentral, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]
268268
### System.Collections.Hashtable
269-
270269
## OUTPUTS
271270

272271
### Microsoft.Azure.Commands.IotCentral.Models.PSIotCentralApp
273-
274272
## NOTES
275273

276274
## RELATED LINKS

src/ResourceManager/IotCentral/Commands.IotCentral/help/Remove-AzureRmIotCentralApp.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Remove-AzureRmIotCentralApp [-PassThru] -InputObject <PSIotCentralApp> [-AsJob]
2626

2727
### InteractiveIotCentralParameterSet
2828
```
29-
Remove-AzureRmIotCentralApp [-PassThru] [-ResourceGroupName] <String> [-Name] <String> [-AsJob]
29+
Remove-AzureRmIotCentralApp [-PassThru] [-AsJob] [-ResourceGroupName] <String> [-Name] <String>
3030
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
3131
```
3232

@@ -105,7 +105,7 @@ Accept wildcard characters: False
105105
```
106106
107107
### -PassThru
108-
Set to receive boolean success output from Cmdlet.
108+
{{Fill PassThru Description}}
109109
110110
```yaml
111111
Type: SwitchParameter
@@ -186,13 +186,10 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
186186
## INPUTS
187187
188188
### System.String
189-
190189
### Microsoft.Azure.Commands.IotCentral.Models.PSIotCentralApp
191-
192190
## OUTPUTS
193191
194192
### System.Boolean
195-
196193
## NOTES
197194
198195
## RELATED LINKS

src/ResourceManager/IotCentral/Commands.IotCentral/help/Set-AzureRmIotCentralApp.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ Set-AzureRmIotCentralApp [-DisplayName <String>] [-Tag <Hashtable>] -InputObject
2626

2727
### InteractiveIotCentralParameterSet
2828
```
29-
Set-AzureRmIotCentralApp [-DisplayName <String>] [-Tag <Hashtable>] [-ResourceGroupName] <String>
30-
[-Name] <String> [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
29+
Set-AzureRmIotCentralApp [-DisplayName <String>] [-Tag <Hashtable>] [-AsJob] [-ResourceGroupName] <String>
30+
[-Name] <String> [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
3131
```
3232

3333
## DESCRIPTION
@@ -217,15 +217,11 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
217217
## INPUTS
218218
219219
### System.String
220-
221220
### System.Collections.Hashtable
222-
223221
### Microsoft.Azure.Commands.IotCentral.Models.PSIotCentralApp
224-
225222
## OUTPUTS
226223
227224
### Microsoft.Azure.Commands.IotCentral.Models.PSIotCentralApp
228-
229225
## NOTES
230226
231227
## RELATED LINKS

0 commit comments

Comments
 (0)