Skip to content

Commit 94acc5d

Browse files
azure-powershell-botdamodaravadhaniwyunchi-ms
authored
[EventHub] Migrate from generation branch (#19643)
* Removing manual cmdlets that would be migrated * Fixes and test runs * fixes * Migrate EventHub from generation to wyunchi/event-hub (#19570) * Move EventHub to wyunchi/event-hub * Update static analysis exceptions and test cases Co-authored-by: wyunchi-ms <[email protected]> Co-authored-by: davadhani <[email protected]> Co-authored-by: wyunchi-ms <[email protected]>
1 parent 8f1b268 commit 94acc5d

File tree

1,070 files changed

+202548
-58134
lines changed

Some content is hidden

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

1,070 files changed

+202548
-58134
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<PsModuleName>EventHub</PsModuleName>
4+
<PsRootModuleName>EventHub</PsRootModuleName>
5+
<PsModuleFolder>EventHub.Autorest</PsModuleFolder>
6+
</PropertyGroup>
7+
8+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.autorest.hybrid.props" />
9+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., build.proj))\src\Az.Post.props" />
10+
</Project>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="utf-16"?>
2+
<Configuration>
3+
<ViewDefinitions>
4+
<View>
5+
<Name>Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.SchemaGroupProperties</Name>
6+
<ViewSelectedBy>
7+
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api202201Preview.SchemaGroupProperties</TypeName>
8+
</ViewSelectedBy>
9+
<TableControl>
10+
<TableHeaders>
11+
<TableColumnHeader>
12+
<Label>Item</Label>
13+
</TableColumnHeader>
14+
</TableHeaders>
15+
<TableRowEntries>
16+
<TableRowEntry>
17+
<TableColumnItems>
18+
<TableColumnItem>
19+
<PropertyName>Item</PropertyName>
20+
</TableColumnItem>
21+
</TableColumnItems>
22+
</TableRowEntry>
23+
</TableRowEntries>
24+
</TableControl>
25+
</View>
26+
<View>
27+
<Name>Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api10.TrackedResourceTags</Name>
28+
<ViewSelectedBy>
29+
<TypeName>Microsoft.Azure.PowerShell.Cmdlets.EventHub.Models.Api10.TrackedResourceTags</TypeName>
30+
</ViewSelectedBy>
31+
<TableControl>
32+
<TableHeaders>
33+
<TableColumnHeader>
34+
<Label>Item</Label>
35+
</TableColumnHeader>
36+
</TableHeaders>
37+
<TableRowEntries>
38+
<TableRowEntry>
39+
<TableColumnItems>
40+
<TableColumnItem>
41+
<PropertyName>Item</PropertyName>
42+
</TableColumnItem>
43+
</TableColumnItems>
44+
</TableRowEntry>
45+
</TableRowEntries>
46+
</TableControl>
47+
</View>
48+
</ViewDefinitions>
49+
</Configuration>
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# region Generated
2+
# ----------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
# Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
14+
# is regenerated.
15+
# ----------------------------------------------------------------------------------
16+
# Load required Az.Accounts module
17+
$accountsName = 'Az.Accounts'
18+
$accountsModule = Get-Module -Name $accountsName
19+
if(-not $accountsModule) {
20+
$localAccountsPath = Join-Path $PSScriptRoot 'generated\modules'
21+
if(Test-Path -Path $localAccountsPath) {
22+
$localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1
23+
if($localAccounts) {
24+
$accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru
25+
}
26+
}
27+
if(-not $accountsModule) {
28+
$hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0
29+
if($hasAdequateVersion) {
30+
$accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru
31+
}
32+
}
33+
}
34+
35+
if(-not $accountsModule) {
36+
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
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
39+
}
40+
Write-Information "Loaded Module '$($accountsModule.Name)'"
41+
42+
# Load the private module dll
43+
$null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.EventHub.private.dll')
44+
45+
# Get the private module's instance
46+
$instance = [Microsoft.Azure.PowerShell.Cmdlets.EventHub.Module]::Instance
47+
48+
# Ask for the shared functionality table
49+
$VTable = Register-AzModule
50+
51+
# Tweaks the pipeline on module load
52+
$instance.OnModuleLoad = $VTable.OnModuleLoad
53+
54+
# Following two delegates are added for telemetry
55+
$instance.GetTelemetryId = $VTable.GetTelemetryId
56+
$instance.Telemetry = $VTable.Telemetry
57+
58+
59+
# Tweaks the pipeline per call
60+
$instance.OnNewRequest = $VTable.OnNewRequest
61+
62+
# Gets shared parameter values
63+
$instance.GetParameterValue = $VTable.GetParameterValue
64+
65+
# Allows shared module to listen to events from this module
66+
$instance.EventListener = $VTable.EventListener
67+
68+
# Gets shared argument completers
69+
$instance.ArgumentCompleter = $VTable.ArgumentCompleter
70+
71+
# The name of the currently selected Azure profile
72+
$instance.ProfileName = $VTable.ProfileName
73+
74+
75+
# Load the custom module
76+
$customModulePath = Join-Path $PSScriptRoot './custom/Az.EventHub.custom.psm1'
77+
if(Test-Path $customModulePath) {
78+
$null = Import-Module -Name $customModulePath
79+
}
80+
81+
# Export nothing to clear implicit exports
82+
Export-ModuleMember
83+
84+
# Export proxy cmdlet scripts
85+
$exportsPath = Join-Path $PSScriptRoot './exports'
86+
$directories = Get-ChildItem -Directory -Path $exportsPath
87+
$profileDirectory = $null
88+
if($instance.ProfileName) {
89+
if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) {
90+
$profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName }
91+
} else {
92+
# Don't export anything if the profile doesn't exist for the module
93+
$exportsPath = $null
94+
Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded."
95+
}
96+
} elseif(($directories | Measure-Object).Count -gt 0) {
97+
# Load the last folder if no profile is selected
98+
$profileDirectory = $directories | Select-Object -Last 1
99+
}
100+
101+
if($profileDirectory) {
102+
Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'"
103+
$exportsPath = $profileDirectory.FullName
104+
}
105+
106+
if($exportsPath) {
107+
Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName }
108+
$cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath
109+
Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias)
110+
}
111+
112+
# Finalize initialization of this module
113+
$instance.Init();
114+
Write-Information "Loaded Module '$($instance.Name)'"
115+
# endregion
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using System.Reflection;
17+
using System.Runtime.InteropServices;
18+
19+
[assembly: AssemblyTitle("Microsoft Azure Powershell - EventHub")]
20+
[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)]
21+
[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)]
22+
[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)]
23+
24+
[assembly: ComVisible(false)]
25+
[assembly: CLSCompliant(false)]
26+
[assembly: Guid("9f16f2e1-2fab-4429-b111-32ef49c81215")]
27+
[assembly: AssemblyVersion("0.1.0")]
28+
[assembly: AssemblyFileVersion("0.1.0")]

0 commit comments

Comments
 (0)