Skip to content

Commit

Permalink
Refresh autorest-selected modules from generation to main (Azure#24711)
Browse files Browse the repository at this point in the history
  • Loading branch information
azure-powershell-bot authored Apr 23, 2024
1 parent 268606d commit 95c0a36
Show file tree
Hide file tree
Showing 992 changed files with 40,197 additions and 9,700 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,28 +41,6 @@
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.BillingBenefits.Models.SavingsPlanUpdateAcceptedResponseHeaders</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.BillingBenefits.Models.SavingsPlanUpdateAcceptedResponseHeaders</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>Location</Label>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>Location</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.BillingBenefits.Models.Api30.ErrorDetail</Name>
<ViewSelectedBy>
Expand Down
160 changes: 21 additions & 139 deletions src/BillingBenefits/BillingBenefits.Autorest/Az.BillingBenefits.psd1
Original file line number Diff line number Diff line change
@@ -1,142 +1,24 @@
#
# Module manifest for module 'Az.BillingBenefits'
#
# Generated by: Microsoft Corporation
#
# Generated on: 1/19/2023
#

@{

# Script module or binary module file associated with this manifest.
RootModule = './Az.BillingBenefits.psm1'

# Version number of this module.
ModuleVersion = '0.1.0'

# Supported PSEditions
CompatiblePSEditions = 'Core', 'Desktop'

# ID used to uniquely identify this module
GUID = '7c220d70-27ec-4403-aedd-429aa925a6a6'

# Author of this module
Author = 'Microsoft Corporation'

# Company or vendor of this module
CompanyName = 'Microsoft Corporation'

# Copyright statement for this module
Copyright = 'Microsoft Corporation. All rights reserved.'

# Description of the functionality provided by this module
Description = 'Microsoft Azure PowerShell: BillingBenefits cmdlets'

# Minimum version of the PowerShell engine required by this module
PowerShellVersion = '5.1'

# Name of the PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
DotNetFrameworkVersion = '4.7.2'

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# ClrVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.11.0'; })

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = './bin/Az.BillingBenefits.private.dll'

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

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = './Az.BillingBenefits.format.ps1xml'

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = 'Get-AzBillingBenefitsReservationOrderAlias',
'Get-AzBillingBenefitsSavingsPlan',
'Get-AzBillingBenefitsSavingsPlanList',
'Get-AzBillingBenefitsSavingsPlanOrder',
'Get-AzBillingBenefitsSavingsPlanOrderAlias',
'Invoke-AzBillingBenefitsElevateSavingPlanOrder',
'Invoke-AzBillingBenefitsSavingsPlanPurchaseValidation',
'Invoke-AzBillingBenefitsSavingsPlanUpdateValidation',
'New-AzBillingBenefitsReservationOrderAlias',
'New-AzBillingBenefitsSavingsPlanOrderAlias',
'Update-AzBillingBenefitsSavingsPlan'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()

# Variables to export from this module
# VariablesToExport = @()

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = '*'

# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

GUID = '7c220d70-27ec-4403-aedd-429aa925a6a6'
RootModule = './Az.BillingBenefits.psm1'
ModuleVersion = '0.1.0'
CompatiblePSEditions = 'Core', 'Desktop'
Author = 'Microsoft Corporation'
CompanyName = 'Microsoft Corporation'
Copyright = 'Microsoft Corporation. All rights reserved.'
Description = 'Microsoft Azure PowerShell: BillingBenefits cmdlets'
PowerShellVersion = '5.1'
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.BillingBenefits.private.dll'
FormatsToProcess = './Az.BillingBenefits.format.ps1xml'
FunctionsToExport = 'Get-AzBillingBenefitsReservationOrderAlias', 'Get-AzBillingBenefitsSavingsPlan', 'Get-AzBillingBenefitsSavingsPlanList', 'Get-AzBillingBenefitsSavingsPlanOrder', 'Get-AzBillingBenefitsSavingsPlanOrderAlias', 'Invoke-AzBillingBenefitsElevateSavingPlanOrder', 'Invoke-AzBillingBenefitsSavingsPlanPurchaseValidation', 'Invoke-AzBillingBenefitsSavingsPlanUpdateValidation', 'New-AzBillingBenefitsReservationOrderAlias', 'New-AzBillingBenefitsSavingsPlanOrderAlias', 'Update-AzBillingBenefitsSavingsPlan', '*'
AliasesToExport = '*'
PrivateData = @{
PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'Azure','ResourceManager','ARM','PSModule','BillingBenefits'

# A URL to the license for this module.
LicenseUri = 'https://aka.ms/azps-license'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/Azure/azure-powershell'

# A URL to an icon representing this module.
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = '* First preview release for module Az.BillingBenefits'

# Prerelease string of this module
# Prerelease = ''

# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false

# External dependent modules of this module
# ExternalModuleDependencies = @()

} # End of PSData hashtable

} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'BillingBenefits'
LicenseUri = 'https://aka.ms/azps-license'
ProjectUri = 'https://github.com/Azure/azure-powershell'
ReleaseNotes = ''
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -47,37 +47,41 @@

# Ask for the shared functionality table
$VTable = Register-AzModule

# Tweaks the pipeline on module load
$instance.OnModuleLoad = $VTable.OnModuleLoad

# Following two delegates are added for telemetry
$instance.GetTelemetryId = $VTable.GetTelemetryId
$instance.Telemetry = $VTable.Telemetry


# Delegate to sanitize the output object
$instance.SanitizeOutput = $VTable.SanitizerHandler

# Delegate to get the telemetry info
$instance.GetTelemetryInfo = $VTable.GetTelemetryInfo

# Tweaks the pipeline per call
$instance.OnNewRequest = $VTable.OnNewRequest

# Gets shared parameter values
$instance.GetParameterValue = $VTable.GetParameterValue

# Allows shared module to listen to events from this module
$instance.EventListener = $VTable.EventListener

# Gets shared argument completers
$instance.ArgumentCompleter = $VTable.ArgumentCompleter

# The name of the currently selected Azure profile
$instance.ProfileName = $VTable.ProfileName


# Load the custom module
$customModulePath = Join-Path $PSScriptRoot './custom/Az.BillingBenefits.custom.psm1'
if(Test-Path $customModulePath) {
$null = Import-Module -Name $customModulePath
}

# Export nothing to clear implicit exports
Export-ModuleMember

Expand All @@ -97,12 +101,12 @@
# Load the last folder if no profile is selected
$profileDirectory = $directories | Select-Object -Last 1
}

if($profileDirectory) {
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
$exportsPath = $profileDirectory.FullName
}

if($exportsPath) {
Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
$cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
Expand Down
9 changes: 6 additions & 3 deletions src/BillingBenefits/BillingBenefits.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
This directory contains the PowerShell module for the BillingBenefits service.

---

## Info
- Modifiable: yes
- Generated: all
Expand Down Expand Up @@ -45,9 +44,9 @@ In this directory, run AutoRest:
> see https://aka.ms/autorest
``` yaml
branch: bab95d5636c7d47cc5584ea8dadb21199d229ca7
commit: bab95d5636c7d47cc5584ea8dadb21199d229ca7
require:
- $(this-folder)/../readme.azure.noprofile.md
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/billingbenefits/resource-manager/Microsoft.BillingBenefits/stable/2022-11-01/billingbenefits.json
module-version: 0.1.0
Expand All @@ -57,6 +56,10 @@ subject-prefix: $(service-name)
resourcegroup-append: true
nested-object-to-string: true

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
### No inline
- no-inline:
Expand Down
13 changes: 12 additions & 1 deletion src/BillingBenefits/BillingBenefits.Autorest/build-module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ $null = New-Item -ItemType Directory -Force -Path $examplesFolder

Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...'
$modelCmdlets = @()
$modelCmdletFolder = Join-Path (Join-Path $PSScriptRoot './custom') 'autogen-model-cmdlets'
if (Test-Path $modelCmdletFolder) {
$null = Remove-Item -Force -Recurse -Path $modelCmdletFolder
}
if ($modelCmdlets.Count -gt 0) {
. (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1')
CreateModelCmdlet($modelCmdlets)
Expand All @@ -139,7 +143,8 @@ if($NoDocs) {
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
}
$null = New-Item -ItemType Directory -Force -Path $docsFolder
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
}

Write-Host -ForegroundColor Green 'Creating format.ps1xml...'
Expand All @@ -158,4 +163,10 @@ Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFol
Write-Host -ForegroundColor Green 'Creating example stubs...'
Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder

if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
{
Write-Host -ForegroundColor Green 'Creating ux metadata...'
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
}

Write-Host -ForegroundColor Green '-------------Done-------------'
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,13 @@ function CreateModelCmdlet {
}

$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
$ModuleName = 'BillingBenefits'
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
$null = New-Item -ItemType Directory -Force -Path $OutputDir
if (''.length -gt 0) {
$ModuleName = ''
} else {
$ModuleName = 'Az.BillingBenefits'
}

$CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
$Content = ''
Expand Down Expand Up @@ -64,10 +68,10 @@ function CreateModelCmdlet {
$ObjectType = $Model
$ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
# remove duplicated module name
if ($ObjectType.StartsWith($ModuleName)) {
if ($ObjectType.StartsWith('BillingBenefits')) {
$ModulePrefix = ''
} else {
$ModulePrefix = $ModuleName
$ModulePrefix = 'BillingBenefits'
}
$OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir

Expand Down Expand Up @@ -158,7 +162,7 @@ Create an in-memory object for ${ObjectType}.
.Outputs
${ObjectTypeWithNamespace}
.Link
https://learn.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
https://learn.microsoft.com/powershell/module/${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
#>
function New-Az${ModulePrefix}${ObjectType}Object {
[OutputType('${ObjectTypeWithNamespace}')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ param(
[ValidateNotNull()]
[Microsoft.Azure.PowerShell.Cmdlets.BillingBenefits.Category('Azure')]
[System.Management.Automation.PSObject]
# The credentials, account, tenant, and subscription used for communication with Azure.
# The DefaultProfile parameter is not functional.
# Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
${DefaultProfile},

[Parameter(DontShow)]
Expand Down Expand Up @@ -121,7 +122,7 @@ begin {
$parameterSet = $PSCmdlet.ParameterSetName

if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString()
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString()
}
$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId
if ($preTelemetryId -eq '') {
Expand All @@ -143,6 +144,10 @@ begin {
}
$cmdInfo = Get-Command -Name $mapping[$parameterSet]
[Microsoft.Azure.PowerShell.Cmdlets.BillingBenefits.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
if ($null -ne $MyInvocation.MyCommand -and [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets -notcontains $MyInvocation.MyCommand.Name -and [Microsoft.Azure.PowerShell.Cmdlets.BillingBenefits.Runtime.MessageAttributeHelper]::ContainsPreviewAttribute($cmdInfo, $MyInvocation)){
[Microsoft.Azure.PowerShell.Cmdlets.BillingBenefits.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)
[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name)
}
$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet)
$scriptCmd = {& $wrappedCmd @PSBoundParameters}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin)
Expand Down
Loading

0 comments on commit 95c0a36

Please sign in to comment.