Skip to content
Draft
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: 2 additions & 3 deletions src/DataBox/DataBox.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
[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)]

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

# Disable managed identity best practice transform for Jobs_Update as it cannot be auto-transformed
disable-transform-identity-type-for-operation:
- Jobs_Update

# 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"

directive:
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
Expand Down Expand Up @@ -82,7 +82,7 @@ directive:

- where:
verb: Update
parameter-name: ^Detail(.*)
parameter-name: ^Detail(.+)
set:
parameter-name: $1

Expand Down Expand Up @@ -151,22 +151,40 @@ directive:
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
- 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
```
``` yaml
# Models that should not be inlined to allow customization
no-inline:
- KeyEncryptionKey
- JobDetails
- ShippingAddress
- ContactDetails
- TransferConfiguration
directive:
no-inline: # the name of the model schema in the swagger file
- KeyEncryptionKey
- JobDetails
- ShippingAddress
- ContactDetails
- TransferConfiguration
# Remove ViaIdentity create variants as they are not needed
- where:
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$
remove: true
# Keep only Expanded, JsonFilePath, and JsonString variants for Create/Update
- where:
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
```
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,10 +114,6 @@ function New-AzDataBoxCustomerDiskJobDetailsObject {
if ($PSBoundParameters.ContainsKey('ShippingAddress')) {
$Object.ShippingAddress = $ShippingAddress
}
if ($PSBoundParameters.ContainsKey('Type')) {
$Object.Type = $Type
}
return $Object
}
}

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
Loading
Loading