Skip to content

Commit a6344eb

Browse files
Migrate Communication from generation to main (#24273)
* Move Communication to main * Update ChangeLog.md --------- Co-authored-by: Vincent Dai <[email protected]>
1 parent 83c5046 commit a6344eb

File tree

631 files changed

+121961
-1400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

631 files changed

+121961
-1400
lines changed

src/Communication/Communication.Autorest/Az.Communication.format.ps1xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,9 +372,6 @@
372372
<TableColumnHeader>
373373
<Label>Name</Label>
374374
</TableColumnHeader>
375-
<TableColumnHeader>
376-
<Label>AzureAsyncOperation</Label>
377-
</TableColumnHeader>
378375
</TableHeaders>
379376
<TableRowEntries>
380377
<TableRowEntry>
@@ -385,9 +382,6 @@
385382
<TableColumnItem>
386383
<PropertyName>Name</PropertyName>
387384
</TableColumnItem>
388-
<TableColumnItem>
389-
<PropertyName>AzureAsyncOperation</PropertyName>
390-
</TableColumnItem>
391385
</TableColumnItems>
392386
</TableRowEntry>
393387
</TableRowEntries>
Lines changed: 21 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,24 @@
1-
#
2-
# Module manifest for module 'Az.Communication'
3-
#
4-
# Generated by: Microsoft Corporation
5-
#
6-
# Generated on: 2021/12/2
7-
#
8-
91
@{
10-
11-
# Script module or binary module file associated with this manifest.
12-
RootModule = './Az.Communication.psm1'
13-
14-
# Version number of this module.
15-
ModuleVersion = '0.2.0'
16-
17-
# Supported PSEditions
18-
CompatiblePSEditions = 'Core', 'Desktop'
19-
20-
# ID used to uniquely identify this module
21-
GUID = '32c4dede-9b85-43d4-83ab-447e2938c400'
22-
23-
# Author of this module
24-
Author = 'Microsoft Corporation'
25-
26-
# Company or vendor of this module
27-
CompanyName = 'Microsoft Corporation'
28-
29-
# Copyright statement for this module
30-
Copyright = 'Microsoft Corporation. All rights reserved.'
31-
32-
# Description of the functionality provided by this module
33-
Description = 'Microsoft Azure PowerShell: Communication cmdlets'
34-
35-
# Minimum version of the PowerShell engine required by this module
36-
PowerShellVersion = '5.1'
37-
38-
# Name of the PowerShell host required by this module
39-
# PowerShellHostName = ''
40-
41-
# Minimum version of the PowerShell host required by this module
42-
# PowerShellHostVersion = ''
43-
44-
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
45-
DotNetFrameworkVersion = '4.7.2'
46-
47-
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
48-
# ClrVersion = ''
49-
50-
# Processor architecture (None, X86, Amd64) required by this module
51-
# ProcessorArchitecture = ''
52-
53-
# Modules that must be imported into the global environment prior to importing this module
54-
RequiredModules = @(@{ModuleName = 'Az.Accounts'; ModuleVersion = '2.7.4'; })
55-
56-
# Assemblies that must be loaded prior to importing this module
57-
RequiredAssemblies = './bin/Az.Communication.private.dll'
58-
59-
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
60-
# ScriptsToProcess = @()
61-
62-
# Type files (.ps1xml) to be loaded when importing this module
63-
# TypesToProcess = @()
64-
65-
# Format files (.ps1xml) to be loaded when importing this module
66-
FormatsToProcess = './Az.Communication.format.ps1xml'
67-
68-
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
69-
# NestedModules = @()
70-
71-
# 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.
72-
FunctionsToExport = 'Get-AzCommunicationService', 'Get-AzCommunicationServiceKey',
73-
'New-AzCommunicationService', 'New-AzCommunicationServiceKey',
74-
'Remove-AzCommunicationService',
75-
'Set-AzCommunicationServiceNotificationHub',
76-
'Test-AzCommunicationServiceNameAvailability',
77-
'Update-AzCommunicationService'
78-
79-
# 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.
80-
CmdletsToExport = @()
81-
82-
# Variables to export from this module
83-
# VariablesToExport = @()
84-
85-
# 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.
86-
AliasesToExport = '*'
87-
88-
# DSC resources to export from this module
89-
# DscResourcesToExport = @()
90-
91-
# List of all modules packaged with this module
92-
# ModuleList = @()
93-
94-
# List of all files packaged with this module
95-
# FileList = @()
96-
97-
# 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.
98-
PrivateData = @{
99-
2+
GUID = '32c4dede-9b85-43d4-83ab-447e2938c400'
3+
RootModule = './Az.Communication.psm1'
4+
ModuleVersion = '0.1.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: Communication cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.Communication.private.dll'
13+
FormatsToProcess = './Az.Communication.format.ps1xml'
14+
FunctionsToExport = 'Get-AzCommunicationService', 'Get-AzCommunicationServiceKey', 'New-AzCommunicationService', 'New-AzCommunicationServiceKey', 'Remove-AzCommunicationService', 'Set-AzCommunicationServiceNotificationHub', 'Test-AzCommunicationServiceNameAvailability', 'Update-AzCommunicationService', '*'
15+
AliasesToExport = '*'
16+
PrivateData = @{
10017
PSData = @{
101-
102-
# Tags applied to this module. These help with module discovery in online galleries.
103-
Tags = 'Azure','ResourceManager','ARM','PSModule','Communication'
104-
105-
# A URL to the license for this module.
106-
LicenseUri = 'https://aka.ms/azps-license'
107-
108-
# A URL to the main website for this project.
109-
ProjectUri = 'https://github.com/Azure/azure-powershell'
110-
111-
# A URL to an icon representing this module.
112-
# IconUri = ''
113-
114-
# ReleaseNotes of this module
115-
ReleaseNotes = '* Added a new cmdlet ''Test-AzCommunicationServiceNameAvailability''
116-
* Updated API version to 2020-08-20'
117-
118-
# Prerelease string of this module
119-
# Prerelease = ''
120-
121-
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
122-
# RequireLicenseAcceptance = $false
123-
124-
# External dependent modules of this module
125-
# ExternalModuleDependencies = @()
126-
127-
} # End of PSData hashtable
128-
129-
} # End of PrivateData hashtable
130-
131-
# HelpInfo URI of this module
132-
# HelpInfoURI = ''
133-
134-
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
135-
# DefaultCommandPrefix = ''
136-
18+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Communication'
19+
LicenseUri = 'https://aka.ms/azps-license'
20+
ProjectUri = 'https://github.com/Azure/azure-powershell'
21+
ReleaseNotes = ''
22+
}
23+
}
13724
}
138-

src/Communication/Communication.Autorest/Az.Communication.psm1

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@
2525
}
2626
}
2727
if(-not $accountsModule) {
28-
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.2.3' } | Measure-Object).Count -gt 0
28+
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0
2929
if($hasAdequateVersion) {
30-
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.2.3 -Scope Global -PassThru
30+
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru
3131
}
3232
}
3333
}
3434

3535
if(-not $accountsModule) {
36-
Write-Error "`nThis module requires $accountsName version 2.2.3 or greater. For installation instructions, please see: https://learn.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop
37-
} elseif (($accountsModule.Version -lt [System.Version]'2.2.3') -and (-not $localAccounts)) {
38-
Write-Error "`nThis module requires $accountsName version 2.2.3 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
36+
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
37+
} elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) {
38+
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
3939
}
4040
Write-Information "Loaded Module '$($accountsModule.Name)'"
4141

@@ -50,6 +50,10 @@
5050

5151
# Tweaks the pipeline on module load
5252
$instance.OnModuleLoad = $VTable.OnModuleLoad
53+
54+
# Following two delegates are added for telemetry
55+
$instance.GetTelemetryId = $VTable.GetTelemetryId
56+
$instance.Telemetry = $VTable.Telemetry
5357

5458

5559
# Tweaks the pipeline per call

src/Communication/Communication.Autorest/README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
This directory contains the PowerShell module for the Communication service.
44

55
---
6-
76
## Info
87
- Modifiable: yes
98
- Generated: all
@@ -15,7 +14,7 @@ This directory contains the PowerShell module for the Communication service.
1514
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
1615

1716
## Module Requirements
18-
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.2.3 or greater
17+
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
1918

2019
## Authentication
2120
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
@@ -28,12 +27,13 @@ For information on how to develop for `Az.Communication`, see [how-to.md](how-to
2827
> see https://aka.ms/autorest
2928
3029
``` yaml
30+
commit: 23ff943dbe3b5ccdc63a6195daa0f30b17ed9d88
3131
require:
3232
# readme.azure.noprofile.md is the common configuration file
33-
- $(this-folder)/../readme.azure.noprofile.md
33+
- $(this-folder)/../../readme.azure.noprofile.md
3434
input-file:
3535
# You need to specify your swagger files here.
36-
- https://github.com/Azure/azure-rest-api-specs/blob/23ff943dbe3b5ccdc63a6195daa0f30b17ed9d88/specification/communication/resource-manager/Microsoft.Communication/stable/2020-08-20/CommunicationService.json
36+
- $(repo)/specification/communication/resource-manager/Microsoft.Communication/stable/2020-08-20/CommunicationService.json
3737

3838
# If the swagger has not been put in the repo, you may uncomment the following line and refer to it locally
3939
# - (this-folder)/relative-path-to-your-swagger
@@ -48,6 +48,10 @@ subject-prefix: $(service-name)
4848
# uncomment following line to support viaIdentity for these post APIs
4949
# identity-correction-for-post: true
5050

51+
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
52+
use-extension:
53+
"@autorest/powershell": "3.x"
54+
5155
directive:
5256
# Following is two common directive which are normally required in all the RPs
5357
# 1. Remove the unexpanded parameter set

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ $null = New-Item -ItemType Directory -Force -Path $examplesFolder
123123

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

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

166+
if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
167+
{
168+
Write-Host -ForegroundColor Green 'Creating ux metadata...'
169+
. (Join-Path $PSScriptRoot 'generate-portal-ux.ps1')
170+
}
171+
161172
Write-Host -ForegroundColor Green '-------------Done-------------'

src/Communication/Communication.Autorest/check-dependencies.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ if(-not $Isolated) {
2525
function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) {
2626
if($predicate) {
2727
$module = Get-Module -ListAvailable -Name $moduleName
28-
if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0)) {
28+
if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) {
2929
$null = New-Item -ItemType Directory -Force -Path $path
3030
Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..."
3131
if ($requiredVersion) {
@@ -47,7 +47,7 @@ if(Test-Path -Path $localModulesPath) {
4747
$env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath"
4848
}
4949

50-
DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.2.3'
50+
DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5'
5151
DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1'
5252

5353
$tools = Join-Path $PSScriptRoot 'tools'

src/Communication/Communication.Autorest/create-model-cmdlets.ps1

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,13 @@ function CreateModelCmdlet {
2323
}
2424

2525
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
26-
$ModuleName = 'Az.Communication'.Split(".")[1]
2726
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
2827
$null = New-Item -ItemType Directory -Force -Path $OutputDir
28+
if (''.length -gt 0) {
29+
$ModuleName = ''
30+
} else {
31+
$ModuleName = 'Az.Communication'
32+
}
2933

3034
$CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs
3135
$Content = ''
@@ -64,10 +68,10 @@ function CreateModelCmdlet {
6468
$ObjectType = $Model
6569
$ObjectTypeWithNamespace = "${Namespace}.${ObjectType}"
6670
# remove duplicated module name
67-
if ($ObjectType.StartsWith($ModuleName)) {
71+
if ($ObjectType.StartsWith('Communication')) {
6872
$ModulePrefix = ''
6973
} else {
70-
$ModulePrefix = $ModuleName
74+
$ModulePrefix = 'Communication'
7175
}
7276
$OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir
7377

@@ -115,7 +119,9 @@ function CreateModelCmdlet {
115119
# check whether completer is needed
116120
$completer = '';
117121
if($Type.Split('.').Split('.')[-2] -eq 'Support') {
118-
$completer += "`n [ArgumentCompleter([${Type}])]"
122+
# If Type is an array, need to strip []
123+
$strippedType = $Type.Replace('[]', '')
124+
$completer += "`n [ArgumentCompleter([${strippedType}])]"
119125
}
120126
$ParameterDefineScript = "
121127
[Parameter($ParameterDefineProperty)]${completer}
@@ -156,7 +162,7 @@ Create an in-memory object for ${ObjectType}.
156162
.Outputs
157163
${ObjectTypeWithNamespace}
158164
.Link
159-
https://learn.microsoft.com/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
165+
https://learn.microsoft.com/powershell/module/${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object
160166
#>
161167
function New-Az${ModulePrefix}${ObjectType}Object {
162168
[OutputType('${ObjectTypeWithNamespace}')]

src/Communication/Communication.Autorest/examples/Get-AzCommunicationService.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
```powershell
44
Get-AzCommunicationService -SubscriptionId 73fc3592-3cef-4300-5e19-8d18b65ce0e8
5+
```
56

7+
```output
68
Location Name Type AzureAsyncOperation
79
-------- ---- ---- -------------------
810
global ContosoResource1 Microsoft.Communication/communicationServices
@@ -17,7 +19,9 @@ Returns a list of all ACS resources under that subscription.
1719

1820
```powershell
1921
Get-AzCommunicationService -Name ContosoAcsResource1 -ResourceGroupName ContosoResourceProvider1
22+
```
2023

24+
```output
2125
Location Name Type AzureAsyncOperation
2226
-------- ---- ---- -------------------
2327
Global ContosoAcsResource1 Microsoft.Communication/communicationServices

src/Communication/Communication.Autorest/examples/Get-AzCommunicationServiceKey.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
```powershell
44
Get-AzCommunicationServiceKey -CommunicationServiceName ContosoAcsResource1 -ResourceGroupName ContosoResourceProvider1
5+
```
56

7+
```output
68
PrimaryConnectionString PrimaryKey SecondaryConnectionString SecondaryKey
79
----------------------- ---------- ----------------------- ----------
810
endpoint=<example-primary-endpoint> <example-primarykey> endpoint=<example-secondary-endpoint> <example-secondarykey>

src/Communication/Communication.Autorest/examples/New-AzCommunicationService.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
```powershell
44
New-AzCommunicationService -ResourceGroupName ContosoResourceProvider1 -Name ContosoAcsResource1 -DataLocation UnitedStates -Location Global
5+
```
56

7+
```output
68
Location Name Type AzureAsyncOperation
79
-------- ---- ---- -------------------
810
Global ContosoAcsResource1 Microsoft.Communication/communicationServices

0 commit comments

Comments
 (0)