Skip to content

[Az.DataBox] Update generation tool version: autorest.powershell v3->v4 #27927

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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
5 changes: 3 additions & 2 deletions src/DataBox/DataBox.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - DataBox")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.3.3")]
[assembly: System.Reflection.AssemblyVersionAttribute("0.3.3")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("0.5.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("0.5.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]


71 changes: 33 additions & 38 deletions src/DataBox/DataBox.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,18 @@ title: DataBox
subject-prefix: $(service-name)
inlining-threshold: 50

# If there are post APIs for some kinds of actions in the RP, you may need to
# uncomment following line to support viaIdentity for these post APIs
# identity-correction-for-post: 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"
disable-transform-identity-type-for-operation:
- Jobs_Update

directive:
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
- where:
variant: ^Create$|^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Update$|^UpdateViaIdentity$|^UpdateViaIdentityExpanded$|^GetViaIdentity$|^Validate.*$ |^Cancel$|^CancelViaIdentity.*$|^DeleteViaIdentity$
variant: ^(Create)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
- where:
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$|^GetViaIdentity$|^Validate.*$ |^Cancel$|^CancelViaIdentity.*$|^DeleteViaIdentity$
remove: true
# Remove the set-* cmdlet
- where:
Expand Down Expand Up @@ -99,18 +97,6 @@ directive:
set:
subject: JobCredential

- where:
verb: New
parameter-name: IdentityUserAssignedIdentity
set:
parameter-name: UserAssignedIdentity

- where:
verb: Update
parameter-name: IdentityUserAssignedIdentity
set:
parameter-name: UserAssignedIdentity

- where:
parameter-name: PreferenceStorageAccountAccessTierPreference
set:
Expand Down Expand Up @@ -145,28 +131,37 @@ directive:
- IdentityType
- DeliveryType
- Detail

- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IJobSecrets', 'public Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IJobSecrets');


- model-cmdlet:
- DataBoxDiskJobDetails
- DataBoxHeavyJobDetails
- DataBoxJobDetails
- StorageAccountDetails
- ManagedDiskDetails
- KeyEncryptionKey
- ShippingAddress
- ContactDetails
- TransferConfiguration
```
``` yaml
directive:
no-inline: # the name of the model schema in the swagger file
- model-name: DataBoxDiskJobDetails
cmdlet-name: New-AzDataBoxDiskJobDetailsObject
- model-name: DataBoxHeavyJobDetails
cmdlet-name: New-AzDataBoxHeavyJobDetailsObject
- model-name: DataBoxJobDetails
cmdlet-name: New-AzDataBoxJobDetailsObject
- model-name: StorageAccountDetails
cmdlet-name: New-AzDataBoxStorageAccountDetailsObject
- model-name: ManagedDiskDetails
cmdlet-name: New-AzDataBoxManagedDiskDetailsObject
- model-name: KeyEncryptionKey
cmdlet-name: New-AzDataBoxKeyEncryptionKeyObject
- model-name: ShippingAddress
cmdlet-name: New-AzDataBoxShippingAddressObject
- model-name: ContactDetails
cmdlet-name: New-AzDataBoxContactDetailsObject
- model-name: TransferConfiguration
cmdlet-name: New-AzDataBoxTransferConfigurationObject
- model-name: DataBoxCustomerDiskJobDetails
cmdlet-name: New-AzDataBoxCustomerDiskJobDetailsObject

- no-inline: # the name of the model schema in the swagger file
- KeyEncryptionKey
- JobDetails
- ShippingAddress
- ContactDetails
- TransferConfiguration

- where:
verb: Update
hide: true
```
468 changes: 468 additions & 0 deletions src/DataBox/DataBox.Autorest/custom/Update-AzDataBoxJob.ps1

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ Create an in-memory object for ContactDetails.
Create an in-memory object for ContactDetails.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.ContactDetails
Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.ContactDetails
.Link
https://learn.microsoft.com/powershell/module/Az.DataBox/new-AzDataBoxContactDetailsObject
https://learn.microsoft.com/powershell/module/Az.DataBox/new-azdataboxcontactdetailsobject
#>
function New-AzDataBoxContactDetailsObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.ContactDetails')]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.ContactDetails')]
[CmdletBinding(PositionalBinding=$false)]
Param(

Expand All @@ -40,7 +41,7 @@ function New-AzDataBoxContactDetailsObject {
[string]
$Mobile,
[Parameter(HelpMessage="Notification preference for a job stage.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.INotificationPreference[]]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.INotificationPreference[]]
$NotificationPreference,
[Parameter(Mandatory, HelpMessage="Phone number of the contact person.")]
[string]
Expand All @@ -51,7 +52,7 @@ function New-AzDataBoxContactDetailsObject {
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.ContactDetails]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.ContactDetails]::New()

if ($PSBoundParameters.ContainsKey('ContactName')) {
$Object.ContactName = $ContactName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,66 +21,75 @@ Create an in-memory object for DataBoxCustomerDiskJobDetails.
Create an in-memory object for DataBoxCustomerDiskJobDetails.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.DataBoxCustomerDiskJobDetails
Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.DataBoxCustomerDiskJobDetails
.Link
https://learn.microsoft.com/powershell/module/Az.DataBox/new-AzDataBoxCustomerDiskJobDetailsObject
https://learn.microsoft.com/powershell/module/Az.DataBox/new-azdataboxcustomerdiskjobdetailsobject
#>
function New-AzDataBoxCustomerDiskJobDetailsObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.DataBoxCustomerDiskJobDetails')]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.DataBoxCustomerDiskJobDetails')]
[CmdletBinding(PositionalBinding=$false)]
Param(

[Parameter(HelpMessage="Flag to indicate if disk manifest should be backed-up in the Storage Account.")]
[bool]
$EnableManifestBackup,
[Parameter(HelpMessage="Contains the map of disk serial number to the disk details for import jobs.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IDataBoxCustomerDiskJobDetailsImportDiskDetailsCollection]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IDataBoxCustomerDiskJobDetailsImportDiskDetailsCollection]
$ImportDiskDetailsCollection,
[Parameter(HelpMessage="Contains the map of disk serial number to the disk details for export jobs.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IDataBoxCustomerDiskJobDetailsExportDiskDetailsCollection]
$ExportDiskDetailsCollection,
[Parameter(HelpMessage="Carrier Account Number of customer for customer disk.")]
[string]
$ReturnToCustomerPackageDetailCarrierAccountNumber,
[Parameter(HelpMessage="Name of the carrier.")]
[string]
$ReturnToCustomerPackageDetailCarrierName,
[Parameter(HelpMessage="Tracking Id of shipment.")]
[string]
$ReturnToCustomerPackageDetailTrackingId,
[Parameter(Mandatory, HelpMessage="Contact details for notification and shipping.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IContactDetails]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IContactDetails]
$ContactDetail,
[Parameter(HelpMessage="Details of the data to be exported from azure.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IDataExportDetails[]]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IDataExportDetails[]]
$DataExportDetail,
[Parameter(HelpMessage="Details of the data to be imported into azure.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IDataImportDetails[]]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IDataImportDetails[]]
$DataImportDetail,
[Parameter(HelpMessage="The expected size of the data, which needs to be transferred in this job, in terabytes.")]
[int]
$ExpectedDataSizeInTeraByte,
[Parameter(HelpMessage="Details about which key encryption type is being used.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IKeyEncryptionKey]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IKeyEncryptionKey]
$KeyEncryptionKey,
[Parameter(HelpMessage="Preferences for the order.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IPreferences]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IPreferences]
$Preference,
[Parameter(HelpMessage="Optional Reverse Shipping details for order.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IReverseShippingDetails]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IReverseShippingDetails]
$ReverseShippingDetail,
[Parameter(HelpMessage="Shipping address of the customer.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IShippingAddress]
$ShippingAddress,
[Parameter(Mandatory, HelpMessage="Indicates the type of job details.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBox.Support.ClassDiscriminator])]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Support.ClassDiscriminator]
$Type
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IShippingAddress]
$ShippingAddress
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.DataBoxCustomerDiskJobDetails]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.DataBoxCustomerDiskJobDetails]::New()

if ($PSBoundParameters.ContainsKey('EnableManifestBackup')) {
$Object.EnableManifestBackup = $EnableManifestBackup
}
if ($PSBoundParameters.ContainsKey('ImportDiskDetailsCollection')) {
$Object.ImportDiskDetailsCollection = $ImportDiskDetailsCollection
}
if ($PSBoundParameters.ContainsKey('ExportDiskDetailsCollection')) {
$Object.ExportDiskDetailsCollection = $ExportDiskDetailsCollection
}
if ($PSBoundParameters.ContainsKey('ReturnToCustomerPackageDetailCarrierAccountNumber')) {
$Object.ReturnToCustomerPackageDetailCarrierAccountNumber = $ReturnToCustomerPackageDetailCarrierAccountNumber
}
if ($PSBoundParameters.ContainsKey('ReturnToCustomerPackageDetailCarrierName')) {
$Object.ReturnToCustomerPackageDetailCarrierName = $ReturnToCustomerPackageDetailCarrierName
}
if ($PSBoundParameters.ContainsKey('ReturnToCustomerPackageDetailTrackingId')) {
$Object.ReturnToCustomerPackageDetailTrackingId = $ReturnToCustomerPackageDetailTrackingId
}
if ($PSBoundParameters.ContainsKey('ContactDetail')) {
$Object.ContactDetail = $ContactDetail
}
Expand All @@ -105,9 +114,6 @@ function New-AzDataBoxCustomerDiskJobDetailsObject {
if ($PSBoundParameters.ContainsKey('ShippingAddress')) {
$Object.ShippingAddress = $ShippingAddress
}
if ($PSBoundParameters.ContainsKey('Type')) {
$Object.Type = $Type
}
return $Object
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,53 +21,50 @@ Create an in-memory object for DataBoxDiskJobDetails.
Create an in-memory object for DataBoxDiskJobDetails.

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.DataBoxDiskJobDetails
Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.DataBoxDiskJobDetails
.Link
https://learn.microsoft.com/powershell/module/Az.DataBox/new-AzDataBoxDiskJobDetailsObject
https://learn.microsoft.com/powershell/module/Az.DataBox/new-azdataboxdiskjobdetailsobject
#>
function New-AzDataBoxDiskJobDetailsObject {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.DataBoxDiskJobDetails')]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.ModelCmdletAttribute()]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.DataBoxDiskJobDetails')]
[CmdletBinding(PositionalBinding=$false)]
Param(

[Parameter(HelpMessage="User entered passkey for DataBox Disk job.")]
[string]
$Passkey,
[Parameter(HelpMessage="User preference on what size disks are needed for the job. The map is from the disk size in TB to the count. Eg. {2,5} means 5 disks of 2 TB size. Key is string but will be checked against an int.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IDataBoxDiskJobDetailsPreferredDisks]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IDataBoxDiskJobDetailsPreferredDisks]
$PreferredDisk,
[Parameter(Mandatory, HelpMessage="Contact details for notification and shipping.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IContactDetails]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IContactDetails]
$ContactDetail,
[Parameter(HelpMessage="Details of the data to be exported from azure.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IDataExportDetails[]]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IDataExportDetails[]]
$DataExportDetail,
[Parameter(HelpMessage="Details of the data to be imported into azure.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IDataImportDetails[]]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IDataImportDetails[]]
$DataImportDetail,
[Parameter(HelpMessage="The expected size of the data, which needs to be transferred in this job, in terabytes.")]
[int]
$ExpectedDataSizeInTeraByte,
[Parameter(HelpMessage="Details about which key encryption type is being used.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IKeyEncryptionKey]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IKeyEncryptionKey]
$KeyEncryptionKey,
[Parameter(HelpMessage="Preferences for the order.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IPreferences]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IPreferences]
$Preference,
[Parameter(HelpMessage="Optional Reverse Shipping details for order.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IReverseShippingDetails]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IReverseShippingDetails]
$ReverseShippingDetail,
[Parameter(HelpMessage="Shipping address of the customer.")]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.IShippingAddress]
$ShippingAddress,
[Parameter(Mandatory, HelpMessage="Indicates the type of job details.")]
[ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.DataBox.Support.ClassDiscriminator])]
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Support.ClassDiscriminator]
$Type
[Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.IShippingAddress]
$ShippingAddress
)

process {
$Object = [Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.Api20250201.DataBoxDiskJobDetails]::New()
$Object = [Microsoft.Azure.PowerShell.Cmdlets.DataBox.Models.DataBoxDiskJobDetails]::New()

if ($PSBoundParameters.ContainsKey('Passkey')) {
$Object.Passkey = $Passkey
Expand Down Expand Up @@ -99,9 +96,6 @@ function New-AzDataBoxDiskJobDetailsObject {
if ($PSBoundParameters.ContainsKey('ShippingAddress')) {
$Object.ShippingAddress = $ShippingAddress
}
if ($PSBoundParameters.ContainsKey('Type')) {
$Object.Type = $Type
}
return $Object
}
}
Expand Down
Loading
Loading