Skip to content

Migrate ServiceBus from generation to main #20927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<Configuration>
<ViewDefinitions>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.CorrelationFilterProperties</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.CorrelationFilterProperties</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.CorrelationFilterProperties</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.CorrelationFilterProperties</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand All @@ -24,9 +24,9 @@
</TableControl>
</View>
<View>
<Name>Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ResourceNamespacePatchTags</Name>
<Name>Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.ResourceNamespacePatchTags</Name>
<ViewSelectedBy>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ResourceNamespacePatchTags</TypeName>
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.ResourceNamespacePatchTags</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
Expand Down
2 changes: 1 addition & 1 deletion src/ServiceBus/ServiceBus.Autorest/Az.ServiceBus.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}

if(-not $accountsModule) {
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://learn.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
} elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) {
Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop
}
Expand Down
24 changes: 12 additions & 12 deletions src/ServiceBus/ServiceBus.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ For information on how to develop for `Az.ServiceBus`, see [how-to.md](how-to.md

``` yaml
# Please specify the commit id that includes your features to make sure generated codes stable.
branch: 6f0c7d58c0a923917c2b3467ee756f21dbd2f8e2
branch: 1e790cfc5ee4e7ff98f99dd19a3174c4dd58432b
require:
# readme.azure.noprofile.md is the common configuration file
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
# You need to specify your swagger files here.
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/Queue.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/topics.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/namespace-preview.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/AuthorizationRules.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/CheckNameAvailability.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/DisasterRecoveryConfig.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/migrationconfigs.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/networksets.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/operations.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/Rules.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-01-01-preview/subscriptions.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/Queue.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/topics.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/namespace-preview.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/AuthorizationRules.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/CheckNameAvailability.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/DisasterRecoveryConfig.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/migrationconfigs.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/networksets.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/operations.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/Rules.json
- https://github.com/Azure/azure-rest-api-specs/blob/main/specification/servicebus/resource-manager/Microsoft.ServiceBus/preview/2022-10-01-preview/subscriptions.json
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
# - (this-folder)/relative-path-to-your-swagger

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Approves a ServiceBus PrivateEndpointConnection
#>

function Approve-AzServiceBusPrivateEndpointConnection{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IPrivateEndpointConnection])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.IPrivateEndpointConnection])]
[CmdletBinding(DefaultParameterSetName = 'SetExpanded', PositionalBinding = $false, ConfirmImpact = 'Medium')]
param(
[Parameter(ParameterSetName = 'SetExpanded', HelpMessage = "The name of the Private Endpoint Connection")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Denies a ServiceBus PrivateEndpointConnection
#>

function Deny-AzServiceBusPrivateEndpointConnection{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IPrivateEndpointConnection])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.IPrivateEndpointConnection])]
[CmdletBinding(DefaultParameterSetName = 'SetExpanded', PositionalBinding = $false, ConfirmImpact = 'Medium')]
param(
[Parameter(ParameterSetName = 'SetExpanded', HelpMessage = "The name of the Private Endpoint Connection")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gets the Authorization Rule of a ServiceBus namespace, queue or topic.
#>

function Get-AzServiceBusAuthorizationRule{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbAuthorizationRule])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.ISbAuthorizationRule])]
[CmdletBinding(DefaultParameterSetName = 'GetExpandedNamespace', PositionalBinding = $false, ConfirmImpact = 'Medium')]
param(
[Parameter(ParameterSetName = 'GetExpandedQueue', HelpMessage = "The name of the Authorization Rule")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Gets the SASKey of a ServiceBus namespace, queue or topic.
#>

function Get-AzServiceBusKey{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IAccessKeys])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.IAccessKeys])]
[CmdletBinding(DefaultParameterSetName = 'GetExpandedNamespace', PositionalBinding = $false, ConfirmImpact = 'Medium')]
param(
[Parameter(ParameterSetName = 'GetExpandedQueue', Mandatory, HelpMessage = "The name of the Authorization Rule")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Creates a ServiceBus Namespace, Queue, Topic Authorization Rule
#>

function New-AzServiceBusAuthorizationRule{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbAuthorizationRule])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.ISbAuthorizationRule])]
[CmdletBinding(DefaultParameterSetName = 'NewExpandedNamespace', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
param(
[Parameter(Mandatory, HelpMessage = "The name of the Authorization Rule")]
Expand Down Expand Up @@ -134,7 +134,7 @@ function New-AzServiceBusAuthorizationRule{
$null = $PSBoundParameters.Remove('WhatIf')
$null = $PSBoundParameters.Remove('Confirm')

$authRule = [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbAuthorizationRule]@{
$authRule = [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.ISbAuthorizationRule]@{
Rights = $Rights
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Constructs an INwRuleSetIPRules object that can be fed as input to Set-AzService
Constructs an INwRuleSetIPRules object that can be fed as input to Set-AzServiceBusNetworkRuleSet
#>
function New-AzServiceBusIPRuleConfig{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.INwRuleSetIPRules])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.INwRuleSetIPRules])]
[CmdletBinding(PositionalBinding = $false, ConfirmImpact = 'Medium')]
param(
[Parameter(Mandatory, HelpMessage = "IP Mask")]
Expand All @@ -35,7 +35,7 @@ function New-AzServiceBusIPRuleConfig{

process{
try{
$ipRule = [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.INwRuleSetIPRules]@{
$ipRule = [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.INwRuleSetIPRules]@{
IPMask = $IPMask
Action = $Action
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Regenerates the SASKey of a ServiceBus namespace, queue or topic.
#>

function New-AzServiceBusKey{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IAccessKeys])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.IAccessKeys])]
[CmdletBinding(DefaultParameterSetName = 'NewExpandedNamespace', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
param(
[Parameter(ParameterSetName = 'NewExpandedQueue', Mandatory, HelpMessage = "The name of the Authorization Rule")]
Expand Down Expand Up @@ -149,7 +149,7 @@ function New-AzServiceBusKey{
$null = $PSBoundParameters.Remove('WhatIf')
$null = $PSBoundParameters.Remove('Confirm')

$accessKeys = [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IRegenerateAccessKeyParameters]@{
$accessKeys = [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.IRegenerateAccessKeyParameters]@{
KeyType = $KeyType
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Creates a new ServiceBus namespace.
#>

function New-AzServiceBusNamespaceV2{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbNamespace])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.ISbNamespace])]
[CmdletBinding(PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
param(
[Parameter(Mandatory, HelpMessage = "The name of ServiceBusNamespace")]
Expand Down Expand Up @@ -57,9 +57,14 @@ function New-AzServiceBusNamespaceV2{

[Parameter(HelpMessage = "Properties of KeyVault")]
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IKeyVaultProperties[]]
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.IKeyVaultProperties[]]
${KeyVaultProperty},

[Parameter(HelpMessage = "The number of partitions of a Service Bus namespace. This property is only applicable to Premium SKU namespaces. The default value is 1 and possible values are 1, 2 and 4")]
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
[System.Int32]
${PremiumMessagingPartition},

[Parameter(HelpMessage = "Enable Infrastructure Encryption (Double Encryption)")]
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
[System.Management.Automation.SwitchParameter]
Expand Down Expand Up @@ -179,7 +184,7 @@ function New-AzServiceBusNamespaceV2{
$identityHashTable = @{}

foreach ($resourceID in $UserAssignedIdentityId){
$identityHashTable.Add($resourceID, [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.UserAssignedIdentity]::new())
$identityHashTable.Add($resourceID, [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.UserAssignedIdentity]::new())
}

$PSBoundParameters.Add("UserAssignedIdentity", $identityHashTable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Constructs an INwRuleSetIPRules object that can be fed as input to Set-AzService
Constructs an INwRuleSetIPRules object that can be fed as input to Set-AzServiceBusNetworkRuleSet
#>
function New-AzServiceBusVirtualNetworkRuleConfig{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.INwRuleSetVirtualNetworkRules])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.INwRuleSetVirtualNetworkRules])]
[CmdletBinding(PositionalBinding = $false, ConfirmImpact = 'Medium')]
param(
[Parameter(Mandatory, HelpMessage = "Resource ID of Virtual Network Subnet")]
Expand All @@ -35,7 +35,7 @@ function New-AzServiceBusVirtualNetworkRuleConfig{

process{
try{
$virtualNetworkRule = [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.INwRuleSetVirtualNetworkRules]@{
$virtualNetworkRule = [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.INwRuleSetVirtualNetworkRules]@{
SubnetId = $SubnetId
}

Expand Down
2 changes: 1 addition & 1 deletion src/ServiceBus/ServiceBus.Autorest/custom/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ These provide functionality to our HTTP pipeline and other useful features. In s
### Attributes
For processing the cmdlets, we've created some additional attributes:
- `Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.DescriptionAttribute`
- Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
- Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
- `Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.DoNotExportAttribute`
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.ServiceBus`.
- `Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.InternalExportAttribute`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Removes the Authorization Rule of a ServiceBus Namespace, Queue or Topic
#>

function Remove-AzServiceBusAuthorizationRule{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbAuthorizationRule])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.ISbAuthorizationRule])]
[CmdletBinding(DefaultParameterSetName = 'RemoveExpandedNamespace', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
param(
[Parameter(ParameterSetName = 'RemoveExpandedQueue', Mandatory, HelpMessage = "The name of the Authorization Rule")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Updates the authorization rule of a ServiceBus namespace, queue or topic.
#>

function Set-AzServiceBusAuthorizationRule{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbAuthorizationRule])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.ISbAuthorizationRule])]
[CmdletBinding(DefaultParameterSetName = 'SetExpandedNamespace', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
param(
[Parameter(ParameterSetName = 'SetExpandedTopic', Mandatory, HelpMessage = "The name of the Authorization Rule")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Updates a ServiceBus namespace
#>

function Set-AzServiceBusNamespaceV2{
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.ISbNamespace])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.ISbNamespace])]
[CmdletBinding(DefaultParameterSetName = 'SetExpanded', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')]
param(
[Parameter(ParameterSetName = 'SetExpanded', Mandatory, HelpMessage = "The name of ServiceBusNamespace")]
Expand Down Expand Up @@ -59,7 +59,7 @@ function Set-AzServiceBusNamespaceV2{

[Parameter(HelpMessage = "Properties of KeyVault")]
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.IKeyVaultProperties[]]
[Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.IKeyVaultProperties[]]
${KeyVaultProperty},

[Parameter(HelpMessage = "Enable Infrastructure Encryption (Double Encryption)")]
Expand Down Expand Up @@ -206,7 +206,7 @@ function Set-AzServiceBusNamespaceV2{
$identityHashTable = @{}

foreach ($resourceID in $UserAssignedIdentityId){
$identityHashTable.Add($resourceID, [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api202201Preview.UserAssignedIdentity]::new())
$identityHashTable.Add($resourceID, [Microsoft.Azure.PowerShell.Cmdlets.ServiceBus.Models.Api20221001Preview.UserAssignedIdentity]::new())
}

$serviceBusNamespace.UserAssignedIdentity = $identityHashTable
Expand Down
Loading