Skip to content
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

[PS] Migrate Orbital module to autorest v4 #27434

Merged
merged 8 commits into from
Apr 7, 2025
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions src/Orbital/Orbital.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the ""License"");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an ""AS IS"" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code
// is regenerated.

using System;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: System.Reflection.AssemblyCompanyAttribute("Microsoft")]
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Orbital")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.3")]
[assembly: System.Reflection.AssemblyVersionAttribute("0.1.3")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
33 changes: 19 additions & 14 deletions src/Orbital/Orbital.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,6 @@ module-version: 0.1.0
title: Orbital
subject-prefix: $(service-name)

resourcegroup-append: true
identity-correction-for-post: true
nested-object-to-string: true

# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
- from: swagger-document
where: $.definitions.SpacecraftsProperties.properties.provisioningState
Expand Down Expand Up @@ -85,9 +77,17 @@ directive:
],
"description": "The current state of the resource's creation, deletion, or modification."
}
# Following are common directives which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
# 2. For New-* cmdlets, ViaIdentity is not required
# Following two directives are v4 specific
- where:
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
remove: true
# Remove the set-* cmdlet
- where:
verb: Set
remove: true
Expand Down Expand Up @@ -134,11 +134,16 @@ directive:
set:
parameter-name: Name
alias: GroundStationName
# The following are commented out and their generated cmdlets may be renamed and custom logic
# - model-cmdlet:
# - ContactProfileLinkChannel
# - SpacecraftLink
# - ContactProfileLink
# Remove contact update cmdlet, if need please add back
# - where:
# subject: SpacecraftContact
# verb: Update
# remove: true
# SpacecraftLink required properties customized to Mandatory.
- model-cmdlet:
- model-name: ContactProfileLinkChannel
- model-name: ContactProfileLink
# - model-name: SpacecraftLink
- where:
model-name: Spacecraft
set:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ Create an in-memory object for SpacecraftLink.
Create an in-memory object for SpacecraftLink.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.SpacecraftLink
Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.SpacecraftLink
.Link
https://learn.microsoft.com/powershell/module/az.Orbital/new-AzOrbitalSpacecraftLinkObject
https://learn.microsoft.com/powershell/module/Az.Orbital/new-azorbitalspacecraftlinkobject
#>
function New-AzOrbitalSpacecraftLinkObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.SpacecraftLink')]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.SpacecraftLink')]
[CmdletBinding(PositionalBinding=$false)]
Param(

Expand All @@ -36,21 +37,21 @@ function New-AzOrbitalSpacecraftLinkObject {
[Parameter(Mandatory, HelpMessage="Center Frequency in MHz.")]
[float]
$CenterFrequencyMHz,
[Parameter(Mandatory, HelpMessage="Direction (uplink or downlink).")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Direction])]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Direction]
[Parameter(Mandatory, HelpMessage="Direction (Uplink or Downlink).")]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.PSArgumentCompleterAttribute("Uplink", "Downlink")]
[string]
$Direction,
[Parameter(Mandatory, HelpMessage="Link name.")]
[string]
$Name,
[Parameter(Mandatory, HelpMessage="polarization. eg (RHCP, LHCP).")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Polarization])]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Polarization]
[Parameter(Mandatory, HelpMessage="Polarization. e.g. (RHCP, LHCP).")]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.PSArgumentCompleterAttribute("RHCP", "LHCP", "linearVertical", "linearHorizontal")]
[string]
$Polarization
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.SpacecraftLink]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.SpacecraftLink]::New()

if ($PSBoundParameters.ContainsKey('BandwidthMHz')) {
$Object.BandwidthMHz = $BandwidthMHz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ Create an in-memory object for ContactProfileLinkChannel.
Create an in-memory object for ContactProfileLinkChannel.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.ContactProfileLinkChannel
Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.ContactProfileLinkChannel
.Link
https://learn.microsoft.com/powershell/module/az.Orbital/new-AzOrbitalContactProfileLinkChannelObject
https://learn.microsoft.com/powershell/module/Az.Orbital/new-azorbitalcontactprofilelinkchannelobject
#>
function New-AzOrbitalContactProfileLinkChannelObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.ContactProfileLinkChannel')]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.ContactProfileLinkChannel')]
[CmdletBinding(PositionalBinding=$false)]
Param(

Expand All @@ -36,16 +37,16 @@ function New-AzOrbitalContactProfileLinkChannelObject {
[Parameter(Mandatory, HelpMessage="Center Frequency in MHz.")]
[float]
$CenterFrequencyMHz,
[Parameter(HelpMessage="Configuration for decoding.")]
[Parameter(HelpMessage="Currently unused.")]
[string]
$DecodingConfiguration,
[Parameter(HelpMessage="Configuration for demodulation.")]
[Parameter(HelpMessage="Copy of the modem configuration file such as Kratos QRadio or Kratos QuantumRx. Only valid for downlink directions. If provided, the modem connects to the customer endpoint and sends demodulated data instead of a VITA.49 stream.")]
[string]
$DemodulationConfiguration,
[Parameter(HelpMessage="Configuration for encoding.")]
[Parameter(HelpMessage="Currently unused.")]
[string]
$EncodingConfiguration,
[Parameter(Mandatory, HelpMessage="IP Address.")]
[Parameter(Mandatory, HelpMessage="IP Address (IPv4).")]
[string]
$EndPointIPAddress,
[Parameter(Mandatory, HelpMessage="Name of an end point.")]
Expand All @@ -55,10 +56,10 @@ function New-AzOrbitalContactProfileLinkChannelObject {
[string]
$EndPointPort,
[Parameter(Mandatory, HelpMessage="Protocol either UDP or TCP.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Protocol])]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Protocol]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.PSArgumentCompleterAttribute("TCP", "UDP")]
[string]
$EndPointProtocol,
[Parameter(HelpMessage="Configuration for modulation.")]
[Parameter(HelpMessage="Copy of the modem configuration file such as Kratos QRadio. Only valid for uplink directions. If provided, the modem connects to the customer endpoint and accepts commands from the customer instead of a VITA.49 stream.")]
[string]
$ModulationConfiguration,
[Parameter(Mandatory, HelpMessage="Channel name.")]
Expand All @@ -67,7 +68,7 @@ function New-AzOrbitalContactProfileLinkChannelObject {
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.ContactProfileLinkChannel]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.ContactProfileLinkChannel]::New()

if ($PSBoundParameters.ContainsKey('BandwidthMHz')) {
$Object.BandwidthMHz = $BandwidthMHz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,39 +21,40 @@ Create an in-memory object for ContactProfileLink.
Create an in-memory object for ContactProfileLink.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.ContactProfileLink
Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.ContactProfileLink
.Link
https://learn.microsoft.com/powershell/module/az.Orbital/new-AzOrbitalContactProfileLinkObject
https://learn.microsoft.com/powershell/module/Az.Orbital/new-azorbitalcontactprofilelinkobject
#>
function New-AzOrbitalContactProfileLinkObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.ContactProfileLink')]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.ContactProfileLink')]
[CmdletBinding(PositionalBinding=$false)]
Param(

[Parameter(Mandatory, HelpMessage="Contact Profile Link Channel.")]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.IContactProfileLinkChannel[]]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.IContactProfileLinkChannel[]]
$Channel,
[Parameter(Mandatory, HelpMessage="Direction (uplink or downlink).")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Direction])]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Direction]
[Parameter(Mandatory, HelpMessage="Direction (Uplink or Downlink).")]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.PSArgumentCompleterAttribute("Uplink", "Downlink")]
[string]
$Direction,
[Parameter(HelpMessage="Effective Isotropic Radiated Power (EIRP) in dBW.")]
[Parameter(HelpMessage="Effective Isotropic Radiated Power (EIRP) in dBW. It is the required EIRP by the customer. Not used yet.")]
[float]
$EirpdBw,
[Parameter(HelpMessage="Gain To Noise Temperature in db/K.")]
[Parameter(HelpMessage="Gain to noise temperature in db/K. It is the required G/T by the customer. Not used yet.")]
[float]
$GainOverTemperature,
[Parameter(Mandatory, HelpMessage="Link name.")]
[string]
$Name,
[Parameter(Mandatory, HelpMessage="polarization. eg (RHCP, LHCP).")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Polarization])]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.Polarization]
[Parameter(Mandatory, HelpMessage="Polarization. e.g. (RHCP, LHCP).")]
[Microsoft.Azure.PowerShell.Cmdlets.Orbital.PSArgumentCompleterAttribute("RHCP", "LHCP", "linearVertical", "linearHorizontal")]
[string]
$Polarization
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.ContactProfileLink]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.ContactProfileLink]::New()

if ($PSBoundParameters.ContainsKey('Channel')) {
$Object.Channel = $Channel
Expand Down
15 changes: 9 additions & 6 deletions src/Orbital/Orbital.Autorest/docs/Az.Orbital.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Module Name: Az.Orbital
Module Guid: 4fb1d4af-9f8d-4a19-9f17-d8186bf02cfb
Module Guid: da3f3c81-b8f0-4648-9b05-4afd458a4b16
Download Help Link: https://learn.microsoft.com/powershell/module/az.orbital
Help Version: 1.0.0.0
Locale: en-US
Expand Down Expand Up @@ -28,7 +28,7 @@ Gets the specified spacecraft in a specified resource group.
Gets the specified contact in a specified resource group.

### [New-AzOrbitalContactProfile](New-AzOrbitalContactProfile.md)
Creates or updates a contact profile.
create a contact profile.

### [New-AzOrbitalContactProfileLinkChannelObject](New-AzOrbitalContactProfileLinkChannelObject.md)
Create an in-memory object for ContactProfileLinkChannel.
Expand All @@ -37,10 +37,10 @@ Create an in-memory object for ContactProfileLinkChannel.
Create an in-memory object for ContactProfileLink.

### [New-AzOrbitalSpacecraft](New-AzOrbitalSpacecraft.md)
Creates or updates a spacecraft resource.
create a spacecraft resource.

### [New-AzOrbitalSpacecraftContact](New-AzOrbitalSpacecraftContact.md)
Creates a contact.
create a contact.

### [New-AzOrbitalSpacecraftLinkObject](New-AzOrbitalSpacecraftLinkObject.md)
Create an in-memory object for SpacecraftLink.
Expand All @@ -55,8 +55,11 @@ Deletes a specified spacecraft resource.
Deletes a specified contact.

### [Update-AzOrbitalContactProfile](Update-AzOrbitalContactProfile.md)
Updates the specified contact profile tags.
update the specified contact profile tags.

### [Update-AzOrbitalSpacecraft](Update-AzOrbitalSpacecraft.md)
Updates the specified spacecraft tags.
update the specified spacecraft tags.

### [Update-AzOrbitalSpacecraftContact](Update-AzOrbitalSpacecraftContact.md)
update a contact.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Returns list of available ground stations.
## SYNTAX

```
Get-AzOrbitalAvailableGroundStation -Capability <CapabilityParameter> [-SubscriptionId <String[]>]
Get-AzOrbitalAvailableGroundStation -Capability <String> [-SubscriptionId <String[]>]
[-DefaultProfile <PSObject>] [<CommonParameters>]
```

Expand Down Expand Up @@ -48,7 +48,7 @@ Gets the specified available ground station.
Ground Station Capability.

```yaml
Type: Microsoft.Azure.PowerShell.Cmdlets.Orbital.Support.CapabilityParameter
Type: System.String
Parameter Sets: (All)
Aliases:

Expand Down Expand Up @@ -97,7 +97,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## OUTPUTS

### Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.Api20221101.IAvailableGroundStation
### Microsoft.Azure.PowerShell.Cmdlets.Orbital.Models.IAvailableGroundStation

## NOTES

Expand Down
Loading