Skip to content

Commit 58de42a

Browse files
v-vprasannakazure-powershell-bot
authored andcommitted
cherry-pick d94a07e from generation
1 parent 50624a0 commit 58de42a

File tree

68 files changed

+1581
-664
lines changed

Some content is hidden

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

68 files changed

+1581
-664
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bin
2+
obj
3+
.vs
4+
generated
5+
internal
6+
exports
7+
tools
8+
custom/*.psm1
9+
custom/autogen-model-cmdlets
10+
test/*-TestResults.xml
11+
/*.ps1
12+
/*.ps1xml
13+
/*.psm1
14+
/*.snk
15+
/*.csproj
16+
/*.nuspec
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@{
2+
GUID = '6f5f191e-e52c-4bd9-87d2-8abb2a4601d8'
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 = @{
17+
PSData = @{
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+
}
24+
}

src/Communication/Communication.Autorest/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/Communication/Communication.Autorest/README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ For information on how to develop for `Az.Communication`, see [how-to.md](how-to
2727
> see https://aka.ms/autorest
2828
2929
``` yaml
30-
commit: 23ff943dbe3b5ccdc63a6195daa0f30b17ed9d88
30+
commit: 663ea6835c33bca216b63f777227db6a459a06b3
3131
require:
3232
# readme.azure.noprofile.md is the common configuration file
3333
- $(this-folder)/../../readme.azure.noprofile.md
3434
input-file:
3535
# You need to specify your swagger files here.
36-
- $(repo)/specification/communication/resource-manager/Microsoft.Communication/stable/2020-08-20/CommunicationService.json
36+
- $(repo)/specification/communication/resource-manager/Microsoft.Communication/preview/2023-06-01-preview/CommunicationServices.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
@@ -97,4 +97,25 @@ directive:
9797
variant: ^Check$|^CheckViaIdentity$|^CheckViaIdentityExpanded$
9898
subject: CommunicationServiceNameAvailability
9999
remove: true
100+
# Set a default value for Type parameter of Test-AzCommunicationServiceNameAvailability
101+
- from: types.json
102+
where: $.definitions.CheckNameAvailabilityRequest
103+
transform: >
104+
return {
105+
"description": "The check availability request body.",
106+
"type": "object",
107+
"properties": {
108+
"name": {
109+
"description": "The name of the resource for which availability needs to be checked.",
110+
"type": "string"
111+
},
112+
"type": {
113+
"description": "The resource type.",
114+
"type": "string"
115+
}
116+
},
117+
"required": [
118+
"name"
119+
]
120+
}
100121
```

src/Communication/Communication.Autorest/UX/Microsoft.Communication/communicationServices.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "communicationServices",
3-
"apiVersion": "2020-08-20",
3+
"apiVersion": "2023-06-01-preview",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.communication"
66
},

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ if(-not $Debugger) {
8989
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release')
9090
}
9191

92-
$dll = Join-Path $PSScriptRoot 'bin\Az.Communication.private.dll'
92+
$dll = Join-Path $PSScriptRoot 'bin/Az.Communication.private.dll'
9393
if(-not (Test-Path $dll)) {
9494
Write-Error "Unable to find output assembly in '$binFolder'."
9595
}
@@ -98,7 +98,7 @@ if(-not (Test-Path $dll)) {
9898
$null = Import-Module -Name $dll
9999

100100
$modulePaths = $dll
101-
$customPsm1 = Join-Path $PSScriptRoot 'custom\Az.Communication.custom.psm1'
101+
$customPsm1 = Join-Path $PSScriptRoot 'custom/Az.Communication.custom.psm1'
102102
if(Test-Path $customPsm1) {
103103
$modulePaths = @($dll, $customPsm1)
104104
}
@@ -170,8 +170,8 @@ if (Test-Path (Join-Path $PSScriptRoot 'generate-portal-ux.ps1'))
170170
}
171171

172172
if (-not $DisableAfterBuildTasks){
173-
$afterBuildTasksPath = Join-Path $PSScriptRoot ''
174-
$afterBuildTasksArgs = ConvertFrom-Json 'true' -AsHashtable
173+
$afterBuildTasksPath = Join-Path $PSScriptRoot '../../../tools/BuildScripts/AdaptAutorestModule.ps1'
174+
$afterBuildTasksArgs = ConvertFrom-Json '{"SubModuleName":"Communication","ModuleRootName":"$(root-module-name)"}' -AsHashtable
175175
if(Test-Path -Path $afterBuildTasksPath -PathType leaf){
176176
Write-Host -ForegroundColor Green 'Running after build tasks...'
177177
. $afterBuildTasksPath @afterBuildTasksArgs

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ function CreateModelCmdlet {
2222
return
2323
}
2424

25-
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated\api') 'Models'
26-
$OutputDir = Join-Path $PSScriptRoot 'custom\autogen-model-cmdlets'
25+
$ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated/api') 'Models'
26+
$OutputDir = Join-Path $PSScriptRoot 'custom/autogen-model-cmdlets'
2727
$null = New-Item -ItemType Directory -Force -Path $OutputDir
2828
if (''.length -gt 0) {
2929
$ModuleName = ''

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# region Generated
22
# Load the private module dll
3-
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Communication.private.dll')
3+
$null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.Communication.private.dll')
44

55
# Load the internal module
6-
$internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Communication.internal.psm1'
6+
$internalModulePath = Join-Path $PSScriptRoot '../internal/Az.Communication.internal.psm1'
77
if(Test-Path $internalModulePath) {
88
$null = Import-Module -Name $internalModulePath
99
}

src/Communication/Communication.Autorest/custom/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Custom
2-
This directory contains custom implementation for non-generated cmdlets for the `Az.Communication` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.Communication.custom.psm1`. This file should not be modified.
2+
This directory contains custom implementation for non-generated cmdlets for the `Az.Communication` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.Communication.custom.psm1`. This file should not be modified.
33

44
## Info
55
- Modifiable: yes
@@ -15,10 +15,10 @@ For C# cmdlets, they are compiled with the rest of the generated low-level cmdle
1515
For script cmdlets, these are loaded via the `Az.Communication.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
1616

1717
## Purpose
18-
This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.
18+
This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder.
1919

2020
## Usage
21-
The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
21+
The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
2222
- Break
2323
- DefaultProfile
2424
- HttpPipelineAppend
@@ -36,6 +36,6 @@ For processing the cmdlets, we've created some additional attributes:
3636
- `Microsoft.Azure.PowerShell.Cmdlets.Communication.DoNotExportAttribute`
3737
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Communication`.
3838
- `Microsoft.Azure.PowerShell.Cmdlets.Communication.InternalExportAttribute`
39-
- Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.Communication`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
39+
- Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.Communication`. For more information, see [README.md](../internal/README.md) in the `../internal` folder.
4040
- `Microsoft.Azure.PowerShell.Cmdlets.Communication.ProfileAttribute`
4141
- Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.

src/Communication/Communication.Autorest/help/Az.Communication.md renamed to src/Communication/Communication.Autorest/docs/Az.Communication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
Module Name: Az.Communication
3-
Module Guid: 32c4dede-9b85-43d4-83ab-447e2938c400
3+
Module Guid: 6f5f191e-e52c-4bd9-87d2-8abb2a4601d8
44
Download Help Link: https://learn.microsoft.com/powershell/module/az.communication
55
Help Version: 1.0.0.0
66
Locale: en-US

src/Communication/Communication.Autorest/help/Get-AzCommunicationService.md renamed to src/Communication/Communication.Autorest/docs/Get-AzCommunicationService.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,30 @@ Get the CommunicationService and its properties.
4242

4343
### Example 1: List existing CommunicationServices for a Subscription
4444
```powershell
45-
Get-AzCommunicationService -SubscriptionId 73fc3592-3cef-4300-5e19-8d18b65ce0e8
45+
Get-AzCommunicationService -SubscriptionId 632ec9eb-fad7-4cbd-993a-e72973ba2acc
4646
```
4747

4848
```output
49-
Location Name Type AzureAsyncOperation
50-
-------- ---- ---- -------------------
51-
global ContosoResource1 Microsoft.Communication/communicationServices
52-
global ContosoResource4 Microsoft.Communication/communicationServices
53-
global ContosoResource3 Microsoft.Communication/communicationServices
54-
global ContosoResource5 Microsoft.Communication/communicationServices
49+
Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType
50+
-------- ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ----------------------------
51+
Global ContosoAcsResource1 7/09/2024 4:41:40 AM [email protected] User 7/09/2024 4:41:40 AM [email protected] User
52+
Global ContosoAcsResource2 4/10/2024 2:41:40 AM [email protected] User 4/10/2024 2:41:40 AM [email protected] User
53+
Global ContosoAcsResource3 5/01/2024 1:41:40 AM [email protected] User 5/01/2024 1:41:40 AM [email protected] User
54+
Global ContosoAcsResource4 6/08/2024 5:41:40 AM [email protected] User 6/08/2024 5:41:40 AM [email protected] User
55+
Global ContosoAcsResource5 6/09/2024 4:41:40 AM [email protected] User 6/09/2024 4:41:40 AM [email protected] User
5556
```
5657

5758
Returns a list of all ACS resources under that subscription.
5859

5960
### Example 2: Get infomation on specified Azure Communication resource
6061
```powershell
61-
Get-AzCommunicationService -Name ContosoAcsResource1 -ResourceGroupName ContosoResourceProvider1
62+
Get-AzCommunicationService -Name ContosoAcsResource34 -ResourceGroupName ContosoResourceProvider1
6263
```
6364

6465
```output
65-
Location Name Type AzureAsyncOperation
66-
-------- ---- ---- -------------------
67-
Global ContosoAcsResource1 Microsoft.Communication/communicationServices
66+
Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType
67+
-------- ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ----------------------------
68+
Global ContosoAcsResource1 7/10/2024 4:41:40 AM [email protected] User 7/10/2024 9:02:15 AM [email protected] User
6869
```
6970

7071
Returns the information on an ACS resource, if one matching provided parameters is found.
@@ -136,6 +137,7 @@ Accept wildcard characters: False
136137
137138
### -SubscriptionId
138139
The ID of the target subscription.
140+
The value must be an UUID.
139141
140142
```yaml
141143
Type: System.String[]
@@ -158,7 +160,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
158160
159161
## OUTPUTS
160162
161-
### Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20200820.ICommunicationServiceResource
163+
### Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20230601Preview.ICommunicationServiceResource
162164
163165
## NOTES
164166

src/Communication/Communication.Autorest/help/Get-AzCommunicationServiceKey.md renamed to src/Communication/Communication.Autorest/docs/Get-AzCommunicationServiceKey.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ Accept wildcard characters: False
8686
8787
### -SubscriptionId
8888
The ID of the target subscription.
89+
The value must be an UUID.
8990
9091
```yaml
9192
Type: System.String[]
@@ -137,7 +138,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
137138
138139
## OUTPUTS
139140
140-
### Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20200820.ICommunicationServiceKeys
141+
### Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20230601Preview.ICommunicationServiceKeys
141142
142143
## NOTES
143144

0 commit comments

Comments
 (0)