Skip to content

Commit

Permalink
Migrate Communication from generation to main (#25617)
Browse files Browse the repository at this point in the history
* Move Communication to main

* Update ChangeLog.md

---------

Co-authored-by: Yabo Hu <[email protected]>
  • Loading branch information
azure-powershell-bot and VeryEarly authored Jul 23, 2024
1 parent 8ae4a70 commit 510d1f7
Show file tree
Hide file tree
Showing 211 changed files with 8,653 additions and 2,898 deletions.
354 changes: 280 additions & 74 deletions src/Communication/Communication.Autorest/Az.Communication.format.ps1xml

Large diffs are not rendered by default.

25 changes: 23 additions & 2 deletions src/Communication/Communication.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ For information on how to develop for `Az.Communication`, see [how-to.md](how-to
> see https://aka.ms/autorest
``` yaml
commit: 23ff943dbe3b5ccdc63a6195daa0f30b17ed9d88
commit: 663ea6835c33bca216b63f777227db6a459a06b3
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.
- $(repo)/specification/communication/resource-manager/Microsoft.Communication/stable/2020-08-20/CommunicationService.json
- $(repo)/specification/communication/resource-manager/Microsoft.Communication/preview/2023-06-01-preview/CommunicationServices.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 Expand Up @@ -97,4 +97,25 @@ directive:
variant: ^Check$|^CheckViaIdentity$|^CheckViaIdentityExpanded$
subject: CommunicationServiceNameAvailability
remove: true
# Set a default value for Type parameter of Test-AzCommunicationServiceNameAvailability
- from: types.json
where: $.definitions.CheckNameAvailabilityRequest
transform: >
return {
"description": "The check availability request body.",
"type": "object",
"properties": {
"name": {
"description": "The name of the resource for which availability needs to be checked.",
"type": "string"
},
"type": {
"description": "The resource type.",
"type": "string"
}
},
"required": [
"name"
]
}
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "communicationServices",
"apiVersion": "2020-08-20",
"apiVersion": "2023-06-01-preview",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.communication"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
### Example 1: List existing CommunicationServices for a Subscription

```powershell
Get-AzCommunicationService -SubscriptionId 73fc3592-3cef-4300-5e19-8d18b65ce0e8
Get-AzCommunicationService -SubscriptionId 632ec9eb-fad7-4cbd-993a-e72973ba2acc
```

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

Returns a list of all ACS resources under that subscription.

### Example 2: Get infomation on specified Azure Communication resource

```powershell
Get-AzCommunicationService -Name ContosoAcsResource1 -ResourceGroupName ContosoResourceProvider1
Get-AzCommunicationService -Name ContosoAcsResource34 -ResourceGroupName ContosoResourceProvider1
```

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

Returns the information on an ACS resource, if one matching provided parameters is found.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,27 @@ New-AzCommunicationService -ResourceGroupName ContosoResourceProvider1 -Name Con
```

```output
Location Name Type AzureAsyncOperation
-------- ---- ---- -------------------
Global ContosoAcsResource1 Microsoft.Communication/communicationServices
Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType
-------- ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ----------------------------
Global ContosoAcsResource1 7/10/2024 4:41:40 AM [email protected] User 7/10/2024 4:41:40 AM [email protected] User
```

Creates a ACS resource using the specified parameters.

### Example 2: Create a ACS resource with Linked domain and managed identity

```powershell
$linkedDomains = @(
"/subscriptions/653983b8-683a-427c-8c27-9e9624ce9176/resourceGroups/tcsacstest/providers/Microsoft.Communication/emailServices/tcsacstestECSps/domains/AzureManagedDomain"
)
New-AzCommunicationService -ResourceGroupName ContosoResourceProvider -Name ContosoAcsResource2 -DataLocation UnitedStates -Location Global -LinkedDomain @linkedDomains
```

```output
Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType
-------- ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ----------------------------
Global ContosoAcsResource2 7/10/2024 5:41:40 AM [email protected] User 7/10/2024 5:41:40 AM [email protected] User
```

Creates a ACS resource using the specified parameters.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Test-AzCommunicationServiceNameAvailability -Name ContosoAcsResource1
```

```output
Message NameAvailable Reason
------- ------------- ------
Requested name is unavailable for the requested type False AlreadyExists
Message NameAvailable Reason
------- ------------- ------
Resource name already exists False AlreadyExists
```

Verified that the CommunicationService name is valid and is not already in use.
Expand All @@ -17,9 +17,9 @@ Test-AzCommunicationServiceNameAvailability -Name ContosoAcsResource2
```

```output
Message NameAvailable Reason
------- ------------- ------
Requested name is available for the requested type True NameAvailable
Message NameAvailable Reason
------- ------------- ------
True
```

Verified that the requested CommunicationService name already in use.
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
### Example 1: Update an existing ACS resource to have tags

```powershell
Update-AzCommunicationService -Name ContosoAcsResource1 -ResourceGroupName ContosoResourceProvider1 -Tag @{ExampleKey1="ExampleValue1"}
Update-AzCommunicationService -Name ContosoAcsResource2 -ResourceGroupName ContosoResourceProvider1 -Tag @{ExampleKey1="ExampleValue1"}
```

```output
Location Name Type AzureAsyncOperation
-------- ---- ---- -------------------
Global ContosoAcsResource1 Microsoft.Communication/communicationServices
Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType
-------- ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ----------------------------
Global ContosoAcsResource2 7/10/2024 5:41:40 AM [email protected] User 7/16/2024 3:40:40 AM [email protected] User
```

Attaches the given tags to the specified ACS resource.

### Example 2: Update an existing ACS resource to have tags and link the domain

```powershell
$linkedDomains = @(
"/subscriptions/653983b8-683a-427c-8c27-9e9624ce9176/resourceGroups/tcsacstest/providers/Microsoft.Communication/emailServices/tcsacstestECSps/domains/AzureManagedDomain"
)
Update-AzCommunicationService -Name ContosoAcsResource1 -ResourceGroupName ContosoResourceProvider1 -Tag @{ExampleKey1="ExampleValue1"} -LinkedDomain @linkedDomains
```

```output
Location Name SystemDataCreatedAt SystemDataCreatedBy SystemDataCreatedByType SystemDataLastModifiedAt SystemDataLastModifiedBy SystemDataLastModifiedByType
-------- ---- ------------------- ------------------- ----------------------- ------------------------ ------------------------ ----------------------------
Global ContosoAcsResource1 7/10/2024 5:41:40 AM [email protected] User 7/16/2024 3:40:40 AM [email protected] User
```

Attaches the given tags and links the doamin to the specified ACS resource.
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ Get the CommunicationService and its properties.
.Description
Get the CommunicationService and its properties.
.Example
Get-AzCommunicationService -SubscriptionId 73fc3592-3cef-4300-5e19-8d18b65ce0e8
Get-AzCommunicationService -SubscriptionId 632ec9eb-fad7-4cbd-993a-e72973ba2acc
.Example
Get-AzCommunicationService -Name ContosoAcsResource1 -ResourceGroupName ContosoResourceProvider1
Get-AzCommunicationService -Name ContosoAcsResource34 -ResourceGroupName ContosoResourceProvider1
.Inputs
Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.ICommunicationIdentity
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20200820.ICommunicationServiceResource
Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20230601Preview.ICommunicationServiceResource
.Notes
COMPLEX PARAMETER PROPERTIES
Expand All @@ -37,12 +37,12 @@ INPUTOBJECT <ICommunicationIdentity>: Identity Parameter
[CommunicationServiceName <String>]: The name of the CommunicationService resource.
[Id <String>]: Resource identity path
[ResourceGroupName <String>]: The name of the resource group. The name is case insensitive.
[SubscriptionId <String>]: The ID of the target subscription.
[SubscriptionId <String>]: The ID of the target subscription. The value must be an UUID.
.Link
https://learn.microsoft.com/powershell/module/az.communication/get-azcommunicationservice
#>
function Get-AzCommunicationService {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20200820.ICommunicationServiceResource])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20230601Preview.ICommunicationServiceResource])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
Expand All @@ -67,6 +67,7 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
[System.String[]]
# The ID of the target subscription.
# The value must be an UUID.
${SubscriptionId},

[Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ Get the access keys of the CommunicationService resource.
Get-AzCommunicationServiceKey -CommunicationServiceName ContosoAcsResource1 -ResourceGroupName ContosoResourceProvider1
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20200820.ICommunicationServiceKeys
Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20230601Preview.ICommunicationServiceKeys
.Link
https://learn.microsoft.com/powershell/module/az.communication/get-azcommunicationservicekey
#>
function Get-AzCommunicationServiceKey {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20200820.ICommunicationServiceKeys])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20230601Preview.ICommunicationServiceKeys])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
Expand All @@ -49,6 +49,7 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
[System.String[]]
# The ID of the target subscription.
# The value must be an UUID.
${SubscriptionId},

[Parameter()]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,20 @@ Create a new CommunicationService or update an existing CommunicationService.
Create a new CommunicationService or update an existing CommunicationService.
.Example
New-AzCommunicationService -ResourceGroupName ContosoResourceProvider1 -Name ContosoAcsResource1 -DataLocation UnitedStates -Location Global
.Example
$linkedDomains = @(
"/subscriptions/653983b8-683a-427c-8c27-9e9624ce9176/resourceGroups/tcsacstest/providers/Microsoft.Communication/emailServices/tcsacstestECSps/domains/AzureManagedDomain"
)
New-AzCommunicationService -ResourceGroupName ContosoResourceProvider -Name ContosoAcsResource2 -DataLocation UnitedStates -Location Global -LinkedDomain @linkedDomains
.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20200820.ICommunicationServiceResource
Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20230601Preview.ICommunicationServiceResource
.Link
https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice
#>
function New-AzCommunicationService {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20200820.ICommunicationServiceResource])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20230601Preview.ICommunicationServiceResource])]
[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
Expand All @@ -50,25 +56,49 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
[System.String]
# The ID of the target subscription.
# The value must be an UUID.
${SubscriptionId},

[Parameter(Mandatory)]
[Microsoft.Azure.PowerShell.Cmdlets.Communication.Category('Body')]
[System.String]
# The geo-location where the resource lives
${Location},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Communication.Category('Body')]
[System.String]
# The location where the communication service stores its data at rest.
${DataLocation},

[Parameter()]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Communication.Support.ManagedServiceIdentityType])]
[Microsoft.Azure.PowerShell.Cmdlets.Communication.Category('Body')]
[System.String]
# The Azure location where the CommunicationService is running.
${Location},
[Microsoft.Azure.PowerShell.Cmdlets.Communication.Support.ManagedServiceIdentityType]
# Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
${IdentityType},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Communication.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api50.IUserAssignedIdentities]))]
[System.Collections.Hashtable]
# The set of user assigned identities associated with the resource.
# The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}.
# The dictionary values can be empty objects ({}) in requests.
${IdentityUserAssignedIdentity},

[Parameter()]
[AllowEmptyCollection()]
[Microsoft.Azure.PowerShell.Cmdlets.Communication.Category('Body')]
[System.String[]]
# List of email Domain resource Ids.
${LinkedDomain},

[Parameter()]
[Microsoft.Azure.PowerShell.Cmdlets.Communication.Category('Body')]
[Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api20200820.ITaggedResourceTags]))]
[Microsoft.Azure.PowerShell.Cmdlets.Communication.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Communication.Models.Api40.ITrackedResourceTags]))]
[System.Collections.Hashtable]
# Tags of the service which is a list of key value pairs that describe the resource.
# Resource tags.
${Tag},

[Parameter()]
Expand Down
Loading

0 comments on commit 510d1f7

Please sign in to comment.