Skip to content

Commit 433046f

Browse files
Migrate CostManagement from generation to main (Azure#26820)
* Move CostManagement to main * Update ChangeLog.md --------- Co-authored-by: Yabo Hu <[email protected]>
1 parent fde504c commit 433046f

18 files changed

+208
-32
lines changed

src/CostManagement/CostManagement.Autorest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ directive:
197197
"description": "Has comparison expression for a dimension",
198198
"$ref": "#/definitions/QueryComparisonExpression"
199199
},
200-
"tag": {
200+
"tags": {
201201
"description": "Has comparison expression for a tag",
202202
"$ref": "#/definitions/QueryComparisonExpression"
203203
}

src/CostManagement/CostManagement.Autorest/build-module.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ if(-not $Isolated -and -not $Debugger) {
6767
$binFolder = Join-Path $PSScriptRoot 'bin'
6868
$objFolder = Join-Path $PSScriptRoot 'obj'
6969

70+
$isAzure = [System.Convert]::ToBoolean('true')
71+
7072
if(-not $Debugger) {
7173
Write-Host -ForegroundColor Green 'Cleaning build folders...'
7274
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
@@ -143,7 +145,7 @@ if($NoDocs) {
143145
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
144146
}
145147
$null = New-Item -ItemType Directory -Force -Path $docsFolder
146-
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
148+
$addComplexInterfaceInfo = !$isAzure
147149
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
148150
}
149151

@@ -178,5 +180,4 @@ if (-not $DisableAfterBuildTasks){
178180
}
179181
}
180182

181-
182-
Write-Host -ForegroundColor Green '-------------Done-------------'
183+
Write-Host -ForegroundColor Green '-------------Done-------------'

src/CostManagement/CostManagement.Autorest/generate-portal-ux.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,16 @@ function New-MetadataForParameterSet()
248248
$cmdletName = Get-MappedCmdletFromFunctionName $ParameterSetInfo.Name
249249
$description = (Get-CmdletAttribute -CmdletInfo $ParameterSetInfo -AttributeName "DescriptionAttribute").Description
250250
[object[]]$example = New-ExampleForParameterSet $ParameterSetInfo
251+
if ($Null -eq $example)
252+
{
253+
$example = @()
254+
}
255+
251256
[string[]]$signature = New-ParameterArrayInParameterSet $ParameterSetInfo
257+
if ($Null -eq $signature)
258+
{
259+
$signature = @()
260+
}
252261

253262
return @{
254263
Path = $httpPath

src/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public partial interface IQueryFilter :
9595
Required = false,
9696
ReadOnly = false,
9797
Description = @"Has comparison expression for a tag",
98-
SerializedName = @"tag",
98+
SerializedName = @"tags",
9999
PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression) })]
100100
Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryComparisonExpression Tag { get; set; }
101101

src/CostManagement/CostManagement.Autorest/generated/api/Models/Api20211001/QueryFilter.json.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ internal QueryFilter(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.J
8181
{_or = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray>("or"), out var __jsonOr) ? If( __jsonOr as Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonArray, out var __q) ? new global::System.Func<Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter[]>(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.IQueryFilter) (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilter.FromJson(__p) )) ))() : null : Or;}
8282
{_not = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject>("not"), out var __jsonNot) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryFilter.FromJson(__jsonNot) : Not;}
8383
{_dimensions = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject>("dimensions"), out var __jsonDimensions) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpression.FromJson(__jsonDimensions) : Dimensions;}
84-
{_tag = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject>("tag"), out var __jsonTag) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpression.FromJson(__jsonTag) : Tag;}
84+
{_tag = If( json?.PropertyT<Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonObject>("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Models.Api20211001.QueryComparisonExpression.FromJson(__jsonTags) : Tag;}
8585
AfterFromJson(json);
8686
}
8787

@@ -124,7 +124,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode T
124124
}
125125
AddIf( null != this._not ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) this._not.ToJson(null,serializationMode) : null, "not" ,container.Add );
126126
AddIf( null != this._dimensions ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) this._dimensions.ToJson(null,serializationMode) : null, "dimensions" ,container.Add );
127-
AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tag" ,container.Add );
127+
AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.CostManagement.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add );
128128
AfterToJson(ref container);
129129
return container;
130130
}

src/CostManagement/CostManagement/Az.CostManagement.psd1

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 9/25/2024
6+
# Generated on: 12/3/2024
77
#
88

99
@{
@@ -51,16 +51,16 @@ DotNetFrameworkVersion = '4.7.2'
5151
# ProcessorArchitecture = ''
5252

5353
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '3.0.4'; })
54+
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '4.0.0'; })
5555

5656
# Assemblies that must be loaded prior to importing this module
5757
RequiredAssemblies = 'CostManagement.Autorest/bin/Az.CostManagement.private.dll'
5858

5959
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60-
# ScriptsToProcess = @()
60+
ScriptsToProcess = @()
6161

6262
# Type files (.ps1xml) to be loaded when importing this module
63-
# TypesToProcess = @()
63+
TypesToProcess = @()
6464

6565
# Format files (.ps1xml) to be loaded when importing this module
6666
FormatsToProcess = 'CostManagement.Autorest/Az.CostManagement.format.ps1xml'
@@ -103,7 +103,7 @@ PrivateData = @{
103103
PSData = @{
104104

105105
# Tags applied to this module. These help with module discovery in online galleries.
106-
Tags = 'Azure','ResourceManager','ARM','PSModule','Cost'
106+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Cost'
107107

108108
# A URL to the license for this module.
109109
LicenseUri = 'https://aka.ms/azps-license'
@@ -128,7 +128,7 @@ PrivateData = @{
128128

129129
} # End of PSData hashtable
130130

131-
} # End of PrivateData hashtable
131+
} # End of PrivateData hashtable
132132

133133
# HelpInfo URI of this module
134134
# HelpInfoURI = ''

src/CostManagement/CostManagement/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020

2121
## Upcoming Release
22+
* Fixed bug tags in query filter cannot be properly serialized [#22326]
2223

2324
## Version 0.3.3
2425
* Fixed an error that values in row could be null when grouping by the value of TagKey in Invoke-AzCostManagementQuery cmdlet. Fix in 0.3.1 accidentally removed from 0.3.2, added it back. [#25948]

src/CostManagement/CostManagement/help/Get-AzCostManagementExport.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,19 @@ The operation to get the export for the defined scope by export name.
1515
### List (Default)
1616
```
1717
Get-AzCostManagementExport -Scope <String> [-Expand <String>] [-DefaultProfile <PSObject>]
18-
[<CommonParameters>]
18+
[-ProgressAction <ActionPreference>] [<CommonParameters>]
1919
```
2020

2121
### Get
2222
```
2323
Get-AzCostManagementExport -Name <String> -Scope <String> [-Expand <String>] [-DefaultProfile <PSObject>]
24-
[<CommonParameters>]
24+
[-ProgressAction <ActionPreference>] [<CommonParameters>]
2525
```
2626

2727
### GetViaIdentity
2828
```
2929
Get-AzCostManagementExport -InputObject <ICostManagementIdentity> [-Expand <String>]
30-
[-DefaultProfile <PSObject>] [<CommonParameters>]
30+
[-DefaultProfile <PSObject>] [-ProgressAction <ActionPreference>] [<CommonParameters>]
3131
```
3232

3333
## DESCRIPTION
@@ -128,6 +128,21 @@ Accept pipeline input: False
128128
Accept wildcard characters: False
129129
```
130130
131+
### -ProgressAction
132+
{{ Fill ProgressAction Description }}
133+
134+
```yaml
135+
Type: System.Management.Automation.ActionPreference
136+
Parameter Sets: (All)
137+
Aliases: proga
138+
139+
Required: False
140+
Position: Named
141+
Default value: None
142+
Accept pipeline input: False
143+
Accept wildcard characters: False
144+
```
145+
131146
### -Scope
132147
This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.
133148

src/CostManagement/CostManagement/help/Get-AzCostManagementExportExecutionHistory.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ The operation to get the execution history of an export for the defined scope an
1515
### Get (Default)
1616
```
1717
Get-AzCostManagementExportExecutionHistory -ExportName <String> -Scope <String> [-DefaultProfile <PSObject>]
18-
[<CommonParameters>]
18+
[-ProgressAction <ActionPreference>] [<CommonParameters>]
1919
```
2020

2121
### GetViaIdentity
2222
```
2323
Get-AzCostManagementExportExecutionHistory -InputObject <ICostManagementIdentity> [-DefaultProfile <PSObject>]
24-
[<CommonParameters>]
24+
[-ProgressAction <ActionPreference>] [<CommonParameters>]
2525
```
2626

2727
## DESCRIPTION
@@ -107,6 +107,21 @@ Accept pipeline input: True (ByValue)
107107
Accept wildcard characters: False
108108
```
109109
110+
### -ProgressAction
111+
{{ Fill ProgressAction Description }}
112+
113+
```yaml
114+
Type: System.Management.Automation.ActionPreference
115+
Parameter Sets: (All)
116+
Aliases: proga
117+
118+
Required: False
119+
Position: Named
120+
Default value: None
121+
Accept pipeline input: False
122+
Accept wildcard characters: False
123+
```
124+
110125
### -Scope
111126
This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.
112127

src/CostManagement/CostManagement/help/Invoke-AzCostManagementExecuteExport.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ The operation to execute an export.
1515
### Execute (Default)
1616
```
1717
Invoke-AzCostManagementExecuteExport -ExportName <String> -Scope <String> [-DefaultProfile <PSObject>]
18-
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
18+
[-PassThru] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
1919
```
2020

2121
### ExecuteViaIdentity
2222
```
2323
Invoke-AzCostManagementExecuteExport -InputObject <ICostManagementIdentity> [-DefaultProfile <PSObject>]
24-
[-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]
24+
[-PassThru] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]
2525
```
2626

2727
## DESCRIPTION
@@ -108,6 +108,21 @@ Accept pipeline input: False
108108
Accept wildcard characters: False
109109
```
110110
111+
### -ProgressAction
112+
{{ Fill ProgressAction Description }}
113+
114+
```yaml
115+
Type: System.Management.Automation.ActionPreference
116+
Parameter Sets: (All)
117+
Aliases: proga
118+
119+
Required: False
120+
Position: Named
121+
Default value: None
122+
Accept pipeline input: False
123+
Accept wildcard characters: False
124+
```
125+
111126
### -Scope
112127
This parameter defines the scope of costmanagement from different perspectives 'Subscription','ResourceGroup' and 'Provide Service'.
113128

0 commit comments

Comments
 (0)