From a78f30b69c60bdbe4ec06cd055e664fbf28d169a Mon Sep 17 00:00:00 2001 From: azure-powershell-bot <65331932+azure-powershell-bot@users.noreply.github.com> Date: Fri, 18 Apr 2025 04:00:21 +0000 Subject: [PATCH] [skip ci] Archive 2939b9722f804407f6eb50832d3481093aa55630 --- .../Az.ImportExport.csproj | 2 +- .../Az.ImportExport.format.ps1xml | 284 +- .../Az.ImportExport.psd1 | 3 +- .../Properties/AssemblyInfo.cs | 29 +- .../check-dependencies.ps1 | 6 +- .../exports/Get-AzImportExport.ps1 | 21 +- .../Get-AzImportExportBitLockerKey.ps1 | 20 +- .../exports/Get-AzImportExportLocation.ps1 | 17 +- .../exports/New-AzImportExport.ps1 | 141 +- .../New-AzImportExportDriveListObject.ps1 | 13 +- .../exports/ProxyCmdletDefinitions.ps1 | 344 ++- .../exports/Remove-AzImportExport.ps1 | 17 +- .../exports/Update-AzImportExport.ps1 | 115 +- .../ImportExport.Autorest/generate-info.json | 2 +- .../ImportExport.Autorest/generated/Module.cs | 27 +- .../generated/api/ImportExport.cs | 2511 ++++++++++++++--- .../generated/api/Models/Any.PowerShell.cs | 24 +- .../generated/api/Models/Any.cs | 6 +- .../generated/api/Models/Any.json.cs | 2 +- .../Models/Api202101/JobDetails.PowerShell.cs | 560 ---- .../Api202101/JobResponse.PowerShell.cs | 696 ----- .../LocationProperties.PowerShell.cs | 224 -- .../Api202101/PutJobParameters.PowerShell.cs | 584 ---- ...pdateJobParametersProperties.PowerShell.cs | 322 --- .../DeliveryPackageInformation.PowerShell.cs | 58 +- ...eliveryPackageInformation.TypeConverter.cs | 6 +- .../DeliveryPackageInformation.cs | 18 +- .../DeliveryPackageInformation.json.cs | 16 +- .../DriveBitLockerKey.PowerShell.cs | 48 +- .../DriveBitLockerKey.TypeConverter.cs | 6 +- .../{Api202101 => }/DriveBitLockerKey.cs | 12 +- .../{Api202101 => }/DriveBitLockerKey.json.cs | 12 +- .../{Api202101 => }/DriveStatus.PowerShell.cs | 88 +- .../DriveStatus.TypeConverter.cs | 6 +- .../api/Models/{Api202101 => }/DriveStatus.cs | 54 +- .../{Api202101 => }/DriveStatus.json.cs | 32 +- .../EncryptionKeyDetails.PowerShell.cs | 52 +- .../EncryptionKeyDetails.TypeConverter.cs | 6 +- .../{Api202101 => }/EncryptionKeyDetails.cs | 27 +- .../EncryptionKeyDetails.json.cs | 14 +- .../ErrorResponse.PowerShell.cs | 64 +- .../ErrorResponse.TypeConverter.cs | 6 +- .../Models/{Api202101 => }/ErrorResponse.cs | 45 +- .../{Api202101 => }/ErrorResponse.json.cs | 10 +- .../ErrorResponseError.PowerShell.cs | 60 +- .../ErrorResponseError.TypeConverter.cs | 6 +- .../{Api202101 => }/ErrorResponseError.cs | 31 +- .../ErrorResponseError.json.cs | 18 +- ...rrorResponseErrorDetailsItem.PowerShell.cs | 54 +- ...rResponseErrorDetailsItem.TypeConverter.cs | 6 +- .../ErrorResponseErrorDetailsItem.cs | 15 +- .../ErrorResponseErrorDetailsItem.json.cs | 14 +- .../{Api202101 => }/Export.PowerShell.cs | 56 +- .../{Api202101 => }/Export.TypeConverter.cs | 6 +- .../api/Models/{Api202101 => }/Export.cs | 35 +- .../api/Models/{Api202101 => }/Export.json.cs | 14 +- .../ExportBlobList.PowerShell.cs | 48 +- .../ExportBlobList.TypeConverter.cs | 6 +- .../Models/{Api202101 => }/ExportBlobList.cs | 28 +- .../{Api202101 => }/ExportBlobList.json.cs | 12 +- .../GetBitLockerKeysResponse.PowerShell.cs | 46 +- .../GetBitLockerKeysResponse.TypeConverter.cs | 6 +- .../GetBitLockerKeysResponse.cs | 19 +- .../GetBitLockerKeysResponse.json.cs | 10 +- .../IdentityDetails.PowerShell.cs | 52 +- .../IdentityDetails.TypeConverter.cs | 6 +- .../Models/{Api202101 => }/IdentityDetails.cs | 31 +- .../{Api202101 => }/IdentityDetails.json.cs | 18 +- .../Models/ImportExportIdentity.PowerShell.cs | 20 + .../api/Models/ImportExportIdentity.cs | 15 + .../api/Models/ImportExportIdentity.json.cs | 10 +- .../api/Models/JobDetails.PowerShell.cs | 580 ++++ .../JobDetails.TypeConverter.cs | 6 +- .../api/Models/{Api202101 => }/JobDetails.cs | 297 +- .../Models/{Api202101 => }/JobDetails.json.cs | 44 +- .../api/Models/JobResponse.PowerShell.cs | 716 +++++ .../JobResponse.TypeConverter.cs | 6 +- .../api/Models/{Api202101 => }/JobResponse.cs | 447 ++- .../{Api202101 => }/JobResponse.json.cs | 32 +- .../ListJobsResponse.PowerShell.cs | 48 +- .../ListJobsResponse.TypeConverter.cs | 6 +- .../{Api202101 => }/ListJobsResponse.cs | 22 +- .../{Api202101 => }/ListJobsResponse.json.cs | 12 +- .../ListOperationsResponse.PowerShell.cs | 44 +- .../ListOperationsResponse.TypeConverter.cs | 6 +- .../{Api202101 => }/ListOperationsResponse.cs | 19 +- .../ListOperationsResponse.json.cs | 10 +- .../api/Models/Location.PowerShell.cs | 276 ++ .../{Api202101 => }/Location.TypeConverter.cs | 6 +- .../api/Models/{Api202101 => }/Location.cs | 90 +- .../Models/{Api202101 => }/Location.json.cs | 16 +- ...ll.cs => LocationProperties.PowerShell.cs} | 140 +- .../LocationProperties.TypeConverter.cs | 6 +- .../{Api202101 => }/LocationProperties.cs | 55 +- .../LocationProperties.json.cs | 30 +- .../LocationsResponse.PowerShell.cs | 44 +- .../LocationsResponse.TypeConverter.cs | 6 +- .../{Api202101 => }/LocationsResponse.cs | 19 +- .../{Api202101 => }/LocationsResponse.json.cs | 10 +- .../{Api202101 => }/Operation.PowerShell.cs | 64 +- .../Operation.TypeConverter.cs | 6 +- .../api/Models/{Api202101 => }/Operation.cs | 37 +- .../Models/{Api202101 => }/Operation.json.cs | 12 +- .../OperationDisplay.PowerShell.cs | 56 +- .../OperationDisplay.TypeConverter.cs | 6 +- .../{Api202101 => }/OperationDisplay.cs | 18 +- .../{Api202101 => }/OperationDisplay.json.cs | 16 +- .../PackageInformation.PowerShell.cs | 56 +- .../PackageInformation.TypeConverter.cs | 6 +- .../{Api202101 => }/PackageInformation.cs | 18 +- .../PackageInformation.json.cs | 16 +- .../api/Models/PutJobParameters.PowerShell.cs | 604 ++++ .../PutJobParameters.TypeConverter.cs | 6 +- .../{Api202101 => }/PutJobParameters.cs | 311 +- .../{Api202101 => }/PutJobParameters.json.cs | 14 +- .../PutJobParametersTags.PowerShell.cs | 40 +- .../PutJobParametersTags.TypeConverter.cs | 6 +- .../{Api202101 => }/PutJobParametersTags.cs | 6 +- .../PutJobParametersTags.dictionary.cs | 4 +- .../PutJobParametersTags.json.cs | 8 +- .../ReturnAddress.PowerShell.cs | 76 +- .../ReturnAddress.TypeConverter.cs | 6 +- .../Models/{Api202101 => }/ReturnAddress.cs | 33 +- .../{Api202101 => }/ReturnAddress.json.cs | 26 +- .../ReturnShipping.PowerShell.cs | 48 +- .../ReturnShipping.TypeConverter.cs | 6 +- .../Models/{Api202101 => }/ReturnShipping.cs | 12 +- .../{Api202101 => }/ReturnShipping.json.cs | 12 +- .../ShippingInformation.PowerShell.cs | 76 +- .../ShippingInformation.TypeConverter.cs | 6 +- .../{Api202101 => }/ShippingInformation.cs | 35 +- .../ShippingInformation.json.cs | 28 +- .../{Api20 => }/SystemData.PowerShell.cs | 64 +- .../{Api20 => }/SystemData.TypeConverter.cs | 6 +- .../api/Models/{Api20 => }/SystemData.cs | 48 +- .../api/Models/{Api20 => }/SystemData.json.cs | 20 +- .../Models/UpdateJobParameters.PowerShell.cs | 356 +++ .../UpdateJobParameters.TypeConverter.cs | 6 +- .../{Api202101 => }/UpdateJobParameters.cs | 145 +- .../UpdateJobParameters.json.cs | 12 +- ...dateJobParametersProperties.PowerShell.cs} | 172 +- ...teJobParametersProperties.TypeConverter.cs | 6 +- .../UpdateJobParametersProperties.cs | 130 +- .../UpdateJobParametersProperties.json.cs | 24 +- .../UpdateJobParametersTags.PowerShell.cs | 40 +- .../UpdateJobParametersTags.TypeConverter.cs | 6 +- .../UpdateJobParametersTags.cs | 6 +- .../UpdateJobParametersTags.dictionary.cs | 4 +- .../UpdateJobParametersTags.json.cs | 8 +- .../api/Support/CreatedByType.Completer.cs | 47 - .../Support/CreatedByType.TypeConverter.cs | 59 - .../generated/api/Support/CreatedByType.cs | 102 - .../api/Support/DriveState.Completer.cs | 59 - .../api/Support/DriveState.TypeConverter.cs | 59 - .../generated/api/Support/DriveState.cs | 108 - .../Support/EncryptionKekType.Completer.cs | 39 - .../EncryptionKekType.TypeConverter.cs | 59 - .../api/Support/EncryptionKekType.cs | 98 - .../api/Support/IdentityType.Completer.cs | 43 - .../api/Support/IdentityType.TypeConverter.cs | 59 - .../generated/api/Support/IdentityType.cs | 100 - .../GetAzImportExportBitLockerKey_List.cs | 118 +- .../cmdlets/GetAzImportExportLocation_Get.cs | 109 +- ...etAzImportExportLocation_GetViaIdentity.cs | 109 +- .../cmdlets/GetAzImportExportLocation_List.cs | 113 +- .../cmdlets/GetAzImportExport_Get.cs | 114 +- .../GetAzImportExport_GetViaIdentity.cs | 119 +- .../cmdlets/GetAzImportExport_List.cs | 121 +- .../cmdlets/GetAzImportExport_List1.cs | 121 +- .../generated/cmdlets/GetAzOperation_List.cs | 113 +- .../NewAzImportExport_CreateExpanded.cs | 168 +- ...NewAzImportExport_CreateViaJsonFilePath.cs | 608 ++++ .../NewAzImportExport_CreateViaJsonString.cs | 606 ++++ .../cmdlets/RemoveAzImportExport_Delete.cs | 82 +- .../RemoveAzImportExport_DeleteViaIdentity.cs | 87 +- .../UpdateAzImportExport_UpdateExpanded.cs | 128 +- ...zImportExport_UpdateViaIdentityExpanded.cs | 135 +- ...ateAzImportExport_UpdateViaJsonFilePath.cs | 544 ++++ ...pdateAzImportExport_UpdateViaJsonString.cs | 542 ++++ .../Attributes/ExternalDocsAttribute.cs | 30 + .../PSArgumentCompleterAttribute.cs | 52 + .../BuildTime/Cmdlets/ExportFormatPs1xml.cs | 6 +- .../BuildTime/Cmdlets/ExportModelSurface.cs | 2 +- .../BuildTime/Cmdlets/ExportProxyCmdlet.cs | 4 +- .../runtime/BuildTime/Cmdlets/ExportPsd1.cs | 8 +- .../BuildTime/Cmdlets/ExportTestStub.cs | 211 +- .../runtime/BuildTime/MarkdownRenderer.cs | 2 +- .../BuildTime/Models/PsMarkdownTypes.cs | 43 +- .../BuildTime/Models/PsProxyOutputs.cs | 60 +- .../runtime/BuildTime/Models/PsProxyTypes.cs | 56 +- .../runtime/BuildTime/PsAttributes.cs | 15 + .../runtime/BuildTime/PsExtensions.cs | 7 + .../generated/runtime/BuildTime/PsHelpers.cs | 4 +- .../generated/runtime/Context.cs | 33 + .../generated/runtime/Events.cs | 4 +- .../generated/runtime/ISendAsync.cs | 113 + .../generated/runtime/InfoAttribute.cs | 4 + .../generated/runtime/InputHandler.cs | 22 + .../runtime/Nodes/Collections/XNodeArray.cs | 5 + .../generated/runtime/SerializationMode.cs | 8 +- .../runtime/TypeConverterExtensions.cs | 50 + .../Get-AzImportExportBitLockerKey.ps1 | 14 +- .../internal/Get-AzOperation.ps1 | 10 +- .../internal/ProxyCmdletDefinitions.ps1 | 24 +- .../ImportExport.Autorest/resources/README.md | 11 + .../ImportExport.Autorest/test-module.ps1 | 10 +- 206 files changed, 12534 insertions(+), 5955 deletions(-) delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobDetails.PowerShell.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobResponse.PowerShell.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationProperties.PowerShell.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParameters.PowerShell.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersProperties.PowerShell.cs rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/DeliveryPackageInformation.PowerShell.cs (68%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/DeliveryPackageInformation.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/DeliveryPackageInformation.cs (91%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/DeliveryPackageInformation.json.cs (94%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/DriveBitLockerKey.PowerShell.cs (74%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/DriveBitLockerKey.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/DriveBitLockerKey.cs (90%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/DriveBitLockerKey.json.cs (95%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/DriveStatus.PowerShell.cs (58%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/DriveStatus.TypeConverter.cs (98%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/DriveStatus.cs (89%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/DriveStatus.json.cs (94%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/EncryptionKeyDetails.PowerShell.cs (71%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/EncryptionKeyDetails.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/EncryptionKeyDetails.cs (80%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/EncryptionKeyDetails.json.cs (94%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ErrorResponse.PowerShell.cs (61%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ErrorResponse.TypeConverter.cs (98%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ErrorResponse.cs (66%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ErrorResponse.json.cs (95%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ErrorResponseError.PowerShell.cs (63%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ErrorResponseError.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ErrorResponseError.cs (82%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ErrorResponseError.json.cs (89%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ErrorResponseErrorDetailsItem.PowerShell.cs (70%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ErrorResponseErrorDetailsItem.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ErrorResponseErrorDetailsItem.cs (90%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ErrorResponseErrorDetailsItem.json.cs (93%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/Export.PowerShell.cs (67%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/Export.TypeConverter.cs (98%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/Export.cs (71%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/Export.json.cs (93%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ExportBlobList.PowerShell.cs (71%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ExportBlobList.TypeConverter.cs (98%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ExportBlobList.cs (70%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ExportBlobList.json.cs (89%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/GetBitLockerKeysResponse.PowerShell.cs (72%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/GetBitLockerKeysResponse.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/GetBitLockerKeysResponse.cs (64%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/GetBitLockerKeysResponse.json.cs (90%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/IdentityDetails.PowerShell.cs (72%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/IdentityDetails.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/IdentityDetails.cs (77%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/IdentityDetails.json.cs (93%) create mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobDetails.PowerShell.cs rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/JobDetails.TypeConverter.cs (98%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/JobDetails.cs (72%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/JobDetails.json.cs (87%) create mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobResponse.PowerShell.cs rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/JobResponse.TypeConverter.cs (98%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/JobResponse.cs (66%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/JobResponse.json.cs (90%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ListJobsResponse.PowerShell.cs (70%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ListJobsResponse.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ListJobsResponse.cs (72%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ListJobsResponse.json.cs (90%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ListOperationsResponse.PowerShell.cs (73%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ListOperationsResponse.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ListOperationsResponse.cs (65%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ListOperationsResponse.json.cs (91%) create mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Models/Location.PowerShell.cs rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/Location.TypeConverter.cs (98%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/Location.cs (73%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/Location.json.cs (94%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101/Location.PowerShell.cs => LocationProperties.PowerShell.cs} (58%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/LocationProperties.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/LocationProperties.cs (89%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/LocationProperties.json.cs (90%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/LocationsResponse.PowerShell.cs (73%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/LocationsResponse.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/LocationsResponse.cs (65%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/LocationsResponse.json.cs (91%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/Operation.PowerShell.cs (65%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/Operation.TypeConverter.cs (98%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/Operation.cs (74%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/Operation.json.cs (94%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/OperationDisplay.PowerShell.cs (69%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/OperationDisplay.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/OperationDisplay.cs (91%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/OperationDisplay.json.cs (94%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/PackageInformation.PowerShell.cs (69%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/PackageInformation.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/PackageInformation.cs (91%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/PackageInformation.json.cs (94%) create mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParameters.PowerShell.cs rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/PutJobParameters.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/PutJobParameters.cs (69%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/PutJobParameters.json.cs (93%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/PutJobParametersTags.PowerShell.cs (81%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/PutJobParametersTags.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/PutJobParametersTags.cs (85%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/PutJobParametersTags.dictionary.cs (96%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/PutJobParametersTags.json.cs (96%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ReturnAddress.PowerShell.cs (61%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ReturnAddress.TypeConverter.cs (98%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ReturnAddress.cs (93%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ReturnAddress.json.cs (94%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ReturnShipping.PowerShell.cs (74%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ReturnShipping.TypeConverter.cs (98%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ReturnShipping.cs (90%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ReturnShipping.json.cs (95%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ShippingInformation.PowerShell.cs (60%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ShippingInformation.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ShippingInformation.cs (92%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/ShippingInformation.json.cs (93%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api20 => }/SystemData.PowerShell.cs (63%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api20 => }/SystemData.TypeConverter.cs (98%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api20 => }/SystemData.cs (80%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api20 => }/SystemData.json.cs (95%) create mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParameters.PowerShell.cs rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/UpdateJobParameters.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/UpdateJobParameters.cs (67%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/UpdateJobParameters.json.cs (93%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101/UpdateJobParameters.PowerShell.cs => UpdateJobParametersProperties.PowerShell.cs} (60%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/UpdateJobParametersProperties.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/UpdateJobParametersProperties.cs (73%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/UpdateJobParametersProperties.json.cs (88%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/UpdateJobParametersTags.PowerShell.cs (81%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/UpdateJobParametersTags.TypeConverter.cs (97%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/UpdateJobParametersTags.cs (84%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/UpdateJobParametersTags.dictionary.cs (96%) rename generated/ImportExport/ImportExport.Autorest/generated/api/Models/{Api202101 => }/UpdateJobParametersTags.json.cs (96%) delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Support/CreatedByType.Completer.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Support/CreatedByType.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Support/DriveState.Completer.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Support/DriveState.TypeConverter.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Support/DriveState.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Support/EncryptionKekType.Completer.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Support/EncryptionKekType.TypeConverter.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Support/EncryptionKekType.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Support/IdentityType.Completer.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Support/IdentityType.TypeConverter.cs delete mode 100644 generated/ImportExport/ImportExport.Autorest/generated/api/Support/IdentityType.cs create mode 100644 generated/ImportExport/ImportExport.Autorest/generated/cmdlets/NewAzImportExport_CreateViaJsonFilePath.cs create mode 100644 generated/ImportExport/ImportExport.Autorest/generated/cmdlets/NewAzImportExport_CreateViaJsonString.cs create mode 100644 generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateViaJsonFilePath.cs create mode 100644 generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateViaJsonString.cs create mode 100644 generated/ImportExport/ImportExport.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs create mode 100644 generated/ImportExport/ImportExport.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs create mode 100644 generated/ImportExport/ImportExport.Autorest/generated/runtime/Context.cs create mode 100644 generated/ImportExport/ImportExport.Autorest/generated/runtime/InputHandler.cs create mode 100644 generated/ImportExport/ImportExport.Autorest/resources/README.md diff --git a/generated/ImportExport/ImportExport.Autorest/Az.ImportExport.csproj b/generated/ImportExport/ImportExport.Autorest/Az.ImportExport.csproj index c88d1948a923..eb787e233fe4 100644 --- a/generated/ImportExport/ImportExport.Autorest/Az.ImportExport.csproj +++ b/generated/ImportExport/ImportExport.Autorest/Az.ImportExport.csproj @@ -2,9 +2,9 @@ ImportExport ImportExport + ImportExport.Autorest - diff --git a/generated/ImportExport/ImportExport.Autorest/Az.ImportExport.format.ps1xml b/generated/ImportExport/ImportExport.Autorest/Az.ImportExport.format.ps1xml index f9c7d897a689..7fccb4eae2a7 100644 --- a/generated/ImportExport/ImportExport.Autorest/Az.ImportExport.format.ps1xml +++ b/generated/ImportExport/ImportExport.Autorest/Az.ImportExport.format.ps1xml @@ -2,101 +2,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ImportExportIdentity - - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ImportExportIdentity - - - - - - - - - - - - - - - - - - - - - JobName - - - LocationName - - - ResourceGroupName - - - SubscriptionId - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.SystemData - - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.SystemData - - - - - - - - - - - - - - - - - - - - - - - - - - - CreatedAt - - - CreatedBy - - - CreatedByType - - - LastModifiedAt - - - LastModifiedBy - - - LastModifiedByType - - - - - - - - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformation + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformation - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformation + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformation#Multiple @@ -134,9 +42,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveBitLockerKey + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveBitLockerKey - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveBitLockerKey + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveBitLockerKey#Multiple @@ -162,9 +70,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatus + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatus - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatus + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatus#Multiple @@ -250,9 +158,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.EncryptionKeyDetails + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.EncryptionKeyDetails - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.EncryptionKeyDetails + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.EncryptionKeyDetails#Multiple @@ -284,9 +192,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseError + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseError - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseError + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseError#Multiple @@ -318,9 +226,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseErrorDetailsItem + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseErrorDetailsItem - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseErrorDetailsItem + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseErrorDetailsItem#Multiple @@ -352,9 +260,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.Export + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Export - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.Export + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Export#Multiple @@ -374,27 +282,27 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportBlobList + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IdentityDetails - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportBlobList + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IdentityDetails#Multiple - + - + - BlobPath + PrincipalId - BlobPathPrefix + TenantId @@ -402,27 +310,39 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IdentityDetails + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ImportExportIdentity - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IdentityDetails + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ImportExportIdentity#Multiple - + - + + + + + + + - PrincipalId + JobName - TenantId + LocationName + + + ResourceGroupName + + + SubscriptionId @@ -430,9 +350,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobDetails + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobDetails - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobDetails + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobDetails#Multiple @@ -506,9 +426,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobResponse + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobResponse - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobResponse + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobResponse#Multiple @@ -518,6 +438,9 @@ + + + @@ -528,15 +451,18 @@ Name + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ListJobsResponse + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ListJobsResponse - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ListJobsResponse + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ListJobsResponse#Multiple @@ -556,15 +482,18 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.Location + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Location - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.Location + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Location#Multiple + + + @@ -572,24 +501,24 @@ Name + + ResourceGroupName + - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.LocationProperties + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.LocationProperties - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.LocationProperties + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.LocationProperties#Multiple - - - @@ -614,9 +543,6 @@ - - - @@ -624,9 +550,6 @@ AdditionalShippingInformation - - AlternateLocation - City @@ -651,18 +574,15 @@ StreetAddress2 - - SupportedCarrier - - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.Operation + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Operation - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.Operation + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Operation#Multiple @@ -682,9 +602,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.OperationDisplay - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.OperationDisplay + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.OperationDisplay#Multiple @@ -722,9 +642,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PackageInformation + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PackageInformation - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PackageInformation + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PackageInformation#Multiple @@ -762,9 +682,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PutJobParameters + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PutJobParameters - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PutJobParameters + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PutJobParameters#Multiple @@ -784,9 +704,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddress + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddress - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddress + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddress#Multiple @@ -854,9 +774,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShipping + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShipping - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShipping + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShipping#Multiple @@ -882,9 +802,9 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ShippingInformation + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ShippingInformation - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ShippingInformation + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ShippingInformation#Multiple @@ -952,9 +872,61 @@ - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParametersProperties + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.SystemData + + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.SystemData#Multiple + + + + + + + + + + + + + + + + + + + + + + + + + + + CreatedAt + + + CreatedBy + + + CreatedByType + + + LastModifiedAt + + + LastModifiedBy + + + LastModifiedByType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParametersProperties - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParametersProperties + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParametersProperties#Multiple diff --git a/generated/ImportExport/ImportExport.Autorest/Az.ImportExport.psd1 b/generated/ImportExport/ImportExport.Autorest/Az.ImportExport.psd1 index cfd94bd604ad..2a8351692081 100644 --- a/generated/ImportExport/ImportExport.Autorest/Az.ImportExport.psd1 +++ b/generated/ImportExport/ImportExport.Autorest/Az.ImportExport.psd1 @@ -11,8 +11,7 @@ DotNetFrameworkVersion = '4.7.2' RequiredAssemblies = './bin/Az.ImportExport.private.dll' FormatsToProcess = './Az.ImportExport.format.ps1xml' - FunctionsToExport = 'Get-AzImportExport', 'Get-AzImportExportBitLockerKey', 'Get-AzImportExportLocation', 'New-AzImportExport', 'New-AzImportExportDriveListObject', 'Remove-AzImportExport', 'Update-AzImportExport', '*' - AliasesToExport = '*' + FunctionsToExport = 'Get-AzImportExport', 'Get-AzImportExportBitLockerKey', 'Get-AzImportExportLocation', 'New-AzImportExport', 'New-AzImportExportDriveListObject', 'Remove-AzImportExport', 'Update-AzImportExport' PrivateData = @{ PSData = @{ Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'ImportExport' diff --git a/generated/ImportExport/ImportExport.Autorest/Properties/AssemblyInfo.cs b/generated/ImportExport/ImportExport.Autorest/Properties/AssemblyInfo.cs index 548128ede7c5..c9369269aaf6 100644 --- a/generated/ImportExport/ImportExport.Autorest/Properties/AssemblyInfo.cs +++ b/generated/ImportExport/ImportExport.Autorest/Properties/AssemblyInfo.cs @@ -1,28 +1,27 @@ -// ---------------------------------------------------------------------------------- -// -// Copyright Microsoft Corporation -// Licensed under the Apache License, Version 2.0 (the "License"); +// 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, +// 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: AssemblyTitle("Microsoft Azure Powershell - ImportExport")] -[assembly: AssemblyCompany(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCompany)] -[assembly: AssemblyProduct(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyProduct)] -[assembly: AssemblyCopyright(Microsoft.WindowsAzure.Commands.Common.AzurePowerShell.AssemblyCopyright)] +[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 - ImportExport")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("0.2.2")] +[assembly: System.Reflection.AssemblyVersionAttribute("0.2.2")] +[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)] +[assembly: System.CLSCompliantAttribute(false)] -[assembly: ComVisible(false)] -[assembly: CLSCompliant(false)] -[assembly: Guid("6e390e89-8428-4c00-b097-26582759130b")] -[assembly: AssemblyVersion("0.2.2")] -[assembly: AssemblyFileVersion("0.2.2")] diff --git a/generated/ImportExport/ImportExport.Autorest/check-dependencies.ps1 b/generated/ImportExport/ImportExport.Autorest/check-dependencies.ps1 index c29591c7bfe1..90ca9867ae40 100644 --- a/generated/ImportExport/ImportExport.Autorest/check-dependencies.ps1 +++ b/generated/ImportExport/ImportExport.Autorest/check-dependencies.ps1 @@ -12,13 +12,13 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +param([switch]$NotIsolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) $ErrorActionPreference = 'Stop' -if(-not $Isolated) { +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } diff --git a/generated/ImportExport/ImportExport.Autorest/exports/Get-AzImportExport.ps1 b/generated/ImportExport/ImportExport.Autorest/exports/Get-AzImportExport.ps1 index 46beb1ec7c35..6193d88e6b60 100644 --- a/generated/ImportExport/ImportExport.Autorest/exports/Get-AzImportExport.ps1 +++ b/generated/ImportExport/ImportExport.Autorest/exports/Get-AzImportExport.ps1 @@ -32,7 +32,7 @@ Get-AzImportExport -InputObject $Id .Inputs Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -48,7 +48,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.importexport/get-azimportexport #> function Get-AzImportExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -78,7 +78,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -158,6 +157,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -182,9 +190,7 @@ begin { List = 'Az.ImportExport.private\Get-AzImportExport_List'; List1 = 'Az.ImportExport.private\Get-AzImportExport_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -198,6 +204,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ImportExport/ImportExport.Autorest/exports/Get-AzImportExportBitLockerKey.ps1 b/generated/ImportExport/ImportExport.Autorest/exports/Get-AzImportExportBitLockerKey.ps1 index 1e9f9a7097a4..7a8a4b40f8a3 100644 --- a/generated/ImportExport/ImportExport.Autorest/exports/Get-AzImportExportBitLockerKey.ps1 +++ b/generated/ImportExport/ImportExport.Autorest/exports/Get-AzImportExportBitLockerKey.ps1 @@ -23,12 +23,12 @@ Returns the BitLocker Keys for all drives in the specified job. Get-AzImportExportBitLockerKey -JobName test-job -ResourceGroupName ImportTestRG .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey .Link https://learn.microsoft.com/powershell/module/az.importexport/get-azimportexportbitlockerkey #> function Get-AzImportExportBitLockerKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -111,6 +111,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -132,9 +141,7 @@ begin { $mapping = @{ List = 'Az.ImportExport.custom\Get-AzImportExportBitLockerKey'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -148,6 +155,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ImportExport/ImportExport.Autorest/exports/Get-AzImportExportLocation.ps1 b/generated/ImportExport/ImportExport.Autorest/exports/Get-AzImportExportLocation.ps1 index e71175c6900d..b095da23683b 100644 --- a/generated/ImportExport/ImportExport.Autorest/exports/Get-AzImportExportLocation.ps1 +++ b/generated/ImportExport/ImportExport.Autorest/exports/Get-AzImportExportLocation.ps1 @@ -32,7 +32,7 @@ Get-AzImportExportLocation -InputObject $Id .Inputs Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation .Notes COMPLEX PARAMETER PROPERTIES @@ -48,7 +48,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.importexport/get-azimportexportlocation #> function Get-AzImportExportLocation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -63,7 +63,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -128,6 +127,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -158,6 +166,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ImportExport/ImportExport.Autorest/exports/New-AzImportExport.ps1 b/generated/ImportExport/ImportExport.Autorest/exports/New-AzImportExport.ps1 index 2a3fb700ea81..f08b3c9e649c 100644 --- a/generated/ImportExport/ImportExport.Autorest/exports/New-AzImportExport.ps1 +++ b/generated/ImportExport/ImportExport.Autorest/exports/New-AzImportExport.ps1 @@ -16,15 +16,15 @@ <# .Synopsis -Creates a new job or updates an existing job in the specified subscription. +create a new job or create an existing job in the specified subscription. .Description -Creates a new job or updates an existing job in the specified subscription. +create a new job or create an existing job in the specified subscription. .Example $driveList = @( @{ DriveId = "9CA995BA"; BitLockerKey = "238810-662376-448998-450120-652806-203390-606320-483076"; ManifestFile = "\\DriveManifest.xml"; ManifestHash = "109B21108597EF36D5785F08303F3638"; DriveHeaderHash = "" }) New-AzImportExport -Name test-job -ResourceGroupName ImportTestRG -Location eastus -StorageAccountId "/subscriptions//resourcegroups/ImportTestRG/providers/Microsoft.Storage/storageAccounts/teststorageforimport" -JobType Import -ReturnAddressRecipientName "Some name" -ReturnAddressStreetAddress1 "Street1" -ReturnAddressCity "Redmond" -ReturnAddressStateOrProvince "WA" -ReturnAddressPostalCode "98008" -ReturnAddressCountryOrRegion "USA" -ReturnAddressPhone "4250000000" -ReturnAddressEmail test@contoso.com -DiagnosticsPath "waimportexport" -BackupDriveManifest -DriveList $driveList .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -41,13 +41,13 @@ DRIVELIST : List of up to ten drives that comprise the job. The [ManifestHash ]: The Base16-encoded MD5 hash of the manifest file on the drive. [ManifestUri ]: A URI that points to the blob containing the drive manifest file. [PercentComplete ]: Percentage completed for the drive. - [State ]: The drive's current state. + [State ]: The drive's current state. [VerboseLogUri ]: A URI that points to the blob containing the verbose log for the data transfer operation. .Link https://learn.microsoft.com/powershell/module/az.importexport/new-azimportexport #> function New-AzImportExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -82,293 +82,304 @@ param( # The tenant ID of the client making the request. ${ClientTenantId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Management.Automation.SwitchParameter] # Default value is false. # Indicates whether the manifest files on the drives should be copied to block blobs. ${BackupDriveManifest}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String[]] # A collection of blob-path strings. ${BlobListBlobPath}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String[]] # A collection of blob-prefix strings. ${BlobListBlobPathPrefix}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether a request has been submitted to cancel the job. ${CancelRequested}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The name of the carrier that is used to ship the import or export drives. ${DeliveryPackageCarrierName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Int64] # The number of drives included in the package. ${DeliveryPackageDriveCount}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The date when the package is shipped. ${DeliveryPackageShipDate}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The tracking number of the package. ${DeliveryPackageTrackingNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The virtual blob directory to which the copy logs and backups of drive manifest files (if enabled) will be stored. ${DiagnosticsPath}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus[]] # List of up to ten drives that comprise the job. # The drive list is a required element for an import job; it is not specified for export jobs. - # To construct, see NOTES section for DRIVELIST properties and create a hash table. ${DriveList}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("MicrosoftManaged", "CustomerManaged")] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType] + [System.String] # The type of kek encryption key ${EncryptionKeyKekType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Specifies the url for kek encryption key. ${EncryptionKeyKekUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Specifies the keyvault resource id for kek encryption key. ${EncryptionKeyKekVaultId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning with the container name. # If the blob is in root container, the URI must begin with $root. ${ExportBlobListBlobPath}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # A blob path that points to a block blob containing a list of blob names that were not exported due to insufficient drive space. # If all blobs were exported successfully, then this element is not included in the response. ${IncompleteBlobListUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The type of job ${JobType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Specifies the supported Azure location where the job should be created ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Default value is Error. # Indicates whether error logging or verbose logging will be enabled. ${LogLevel}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Int64] # Overall percentage completed for the job. ${PercentComplete}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Specifies the provisioning state of the job. ${ProvisioningState}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The city name to use when returning the drives. ${ReturnAddressCity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The country or region to use when returning the drives. ${ReturnAddressCountryOrRegion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Email address of the recipient of the returned drives. ${ReturnAddressEmail}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Phone number of the recipient of the returned drives. ${ReturnAddressPhone}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The postal code to use when returning the drives. ${ReturnAddressPostalCode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The name of the recipient who will receive the hard drives when they are returned. ${ReturnAddressRecipientName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The state or province to use when returning the drives. ${ReturnAddressStateOrProvince}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The first line of the street address to use when returning the drives. ${ReturnAddressStreetAddress1}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The second line of the street address to use when returning the drives. ${ReturnAddressStreetAddress2}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The name of the carrier that is used to ship the import or export drives. ${ReturnPackageCarrierName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Int64] # The number of drives included in the package. ${ReturnPackageDriveCount}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The date when the package is shipped. ${ReturnPackageShipDate}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The tracking number of the package. ${ReturnPackageTrackingNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The customer's account number with the carrier. ${ReturnShippingCarrierAccountNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The carrier's name. ${ReturnShippingCarrierName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The city name to use when returning the drives. ${ShippingInformationCity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The country or region to use when returning the drives. ${ShippingInformationCountryOrRegion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Phone number of the recipient of the returned drives. ${ShippingInformationPhone}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The postal code to use when returning the drives. ${ShippingInformationPostalCode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The name of the recipient who will receive the hard drives when they are returned. ${ShippingInformationRecipientName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The state or province to use when returning the drives. ${ShippingInformationStateOrProvince}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The first line of the street address to use when returning the drives. ${ShippingInformationStreetAddress1}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The second line of the street address to use when returning the drives. ${ShippingInformationStreetAddress2}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Current state of the job. ${State}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The resource identifier of the storage account where data will be imported to or exported from. ${StorageAccountId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags]))] [System.Collections.Hashtable] # Specifies the tags that will be assigned to the job. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -425,6 +436,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -445,10 +465,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.ImportExport.private\New-AzImportExport_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ImportExport.private\New-AzImportExport_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ImportExport.private\New-AzImportExport_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -462,6 +482,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ImportExport/ImportExport.Autorest/exports/New-AzImportExportDriveListObject.ps1 b/generated/ImportExport/ImportExport.Autorest/exports/New-AzImportExportDriveListObject.ps1 index c396f7c8894b..2fb7f5897fc5 100644 --- a/generated/ImportExport/ImportExport.Autorest/exports/New-AzImportExportDriveListObject.ps1 +++ b/generated/ImportExport/ImportExport.Autorest/exports/New-AzImportExportDriveListObject.ps1 @@ -24,12 +24,12 @@ $driveList = New-AzImportExportDriveListObject -DriveId "9CA995BA" -BitLockerKey New-AzImportExport -Name test-job -ResourceGroupName ImportTestRG -Location eastus -StorageAccountId "/subscriptions//resourcegroups/ImportTestRG/providers/Microsoft.Storage/storageAccounts/teststorageforimport" -JobType Import -ReturnAddressRecipientName "Some name" -ReturnAddressStreetAddress1 "Street1" -ReturnAddressCity "Redmond" -ReturnAddressStateOrProvince "WA" -ReturnAddressPostalCode "98008" -ReturnAddressCountryOrRegion "USA" -ReturnAddressPhone "4250000000" -ReturnAddressEmail test@contoso.com -DiagnosticsPath "waimportexport" -BackupDriveManifest -DriveList $driveList .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus .Link https://learn.microsoft.com/powershell/module/az.importexport/new-AzImportExportDriveListObject #> function New-AzImportExportDriveListObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -94,8 +94,9 @@ param( ${PercentComplete}, [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("Specified", "Received", "NeverReceived", "Transferring", "Completed", "CompletedMoreInfo", "ShippedBack")] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState] + [System.String] # The drive's current state. ${State}, @@ -113,6 +114,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -141,6 +145,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ImportExport/ImportExport.Autorest/exports/ProxyCmdletDefinitions.ps1 b/generated/ImportExport/ImportExport.Autorest/exports/ProxyCmdletDefinitions.ps1 index b67dda3ab99b..7d4704c463d3 100644 --- a/generated/ImportExport/ImportExport.Autorest/exports/ProxyCmdletDefinitions.ps1 +++ b/generated/ImportExport/ImportExport.Autorest/exports/ProxyCmdletDefinitions.ps1 @@ -32,7 +32,7 @@ Get-AzImportExportLocation -InputObject $Id .Inputs Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation .Notes COMPLEX PARAMETER PROPERTIES @@ -48,7 +48,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.importexport/get-azimportexportlocation #> function Get-AzImportExportLocation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -63,7 +63,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -128,6 +127,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -158,6 +166,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -219,7 +230,7 @@ Get-AzImportExport -InputObject $Id .Inputs Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -235,7 +246,7 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.importexport/get-azimportexport #> function Get-AzImportExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(ParameterSetName='Get', Mandatory)] @@ -265,7 +276,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='List')] @@ -345,6 +355,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -369,9 +388,7 @@ begin { List = 'Az.ImportExport.private\Get-AzImportExport_List'; List1 = 'Az.ImportExport.private\Get-AzImportExport_List1'; } - if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Get', 'List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -385,6 +402,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -430,15 +450,15 @@ end { <# .Synopsis -Creates a new job or updates an existing job in the specified subscription. +create a new job or create an existing job in the specified subscription. .Description -Creates a new job or updates an existing job in the specified subscription. +create a new job or create an existing job in the specified subscription. .Example $driveList = @( @{ DriveId = "9CA995BA"; BitLockerKey = "238810-662376-448998-450120-652806-203390-606320-483076"; ManifestFile = "\\DriveManifest.xml"; ManifestHash = "109B21108597EF36D5785F08303F3638"; DriveHeaderHash = "" }) New-AzImportExport -Name test-job -ResourceGroupName ImportTestRG -Location eastus -StorageAccountId "/subscriptions//resourcegroups/ImportTestRG/providers/Microsoft.Storage/storageAccounts/teststorageforimport" -JobType Import -ReturnAddressRecipientName "Some name" -ReturnAddressStreetAddress1 "Street1" -ReturnAddressCity "Redmond" -ReturnAddressStateOrProvince "WA" -ReturnAddressPostalCode "98008" -ReturnAddressCountryOrRegion "USA" -ReturnAddressPhone "4250000000" -ReturnAddressEmail test@contoso.com -DiagnosticsPath "waimportexport" -BackupDriveManifest -DriveList $driveList .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -455,13 +475,13 @@ DRIVELIST : List of up to ten drives that comprise the job. The [ManifestHash ]: The Base16-encoded MD5 hash of the manifest file on the drive. [ManifestUri ]: A URI that points to the blob containing the drive manifest file. [PercentComplete ]: Percentage completed for the drive. - [State ]: The drive's current state. + [State ]: The drive's current state. [VerboseLogUri ]: A URI that points to the blob containing the verbose log for the data transfer operation. .Link https://learn.microsoft.com/powershell/module/az.importexport/new-azimportexport #> function New-AzImportExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse])] [CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -496,293 +516,304 @@ param( # The tenant ID of the client making the request. ${ClientTenantId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Management.Automation.SwitchParameter] # Default value is false. # Indicates whether the manifest files on the drives should be copied to block blobs. ${BackupDriveManifest}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String[]] # A collection of blob-path strings. ${BlobListBlobPath}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String[]] # A collection of blob-prefix strings. ${BlobListBlobPathPrefix}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether a request has been submitted to cancel the job. ${CancelRequested}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The name of the carrier that is used to ship the import or export drives. ${DeliveryPackageCarrierName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Int64] # The number of drives included in the package. ${DeliveryPackageDriveCount}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The date when the package is shipped. ${DeliveryPackageShipDate}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The tracking number of the package. ${DeliveryPackageTrackingNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The virtual blob directory to which the copy logs and backups of drive manifest files (if enabled) will be stored. ${DiagnosticsPath}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus[]] # List of up to ten drives that comprise the job. # The drive list is a required element for an import job; it is not specified for export jobs. - # To construct, see NOTES section for DRIVELIST properties and create a hash table. ${DriveList}, - [Parameter()] - [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType])] + [Parameter(ParameterSetName='CreateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("MicrosoftManaged", "CustomerManaged")] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType] + [System.String] # The type of kek encryption key ${EncryptionKeyKekType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Specifies the url for kek encryption key. ${EncryptionKeyKekUrl}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Specifies the keyvault resource id for kek encryption key. ${EncryptionKeyKekVaultId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning with the container name. # If the blob is in root container, the URI must begin with $root. ${ExportBlobListBlobPath}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # A blob path that points to a block blob containing a list of blob names that were not exported due to insufficient drive space. # If all blobs were exported successfully, then this element is not included in the response. ${IncompleteBlobListUri}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The type of job ${JobType}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Specifies the supported Azure location where the job should be created ${Location}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Default value is Error. # Indicates whether error logging or verbose logging will be enabled. ${LogLevel}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Int64] # Overall percentage completed for the job. ${PercentComplete}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Specifies the provisioning state of the job. ${ProvisioningState}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The city name to use when returning the drives. ${ReturnAddressCity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The country or region to use when returning the drives. ${ReturnAddressCountryOrRegion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Email address of the recipient of the returned drives. ${ReturnAddressEmail}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Phone number of the recipient of the returned drives. ${ReturnAddressPhone}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The postal code to use when returning the drives. ${ReturnAddressPostalCode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The name of the recipient who will receive the hard drives when they are returned. ${ReturnAddressRecipientName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The state or province to use when returning the drives. ${ReturnAddressStateOrProvince}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The first line of the street address to use when returning the drives. ${ReturnAddressStreetAddress1}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The second line of the street address to use when returning the drives. ${ReturnAddressStreetAddress2}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The name of the carrier that is used to ship the import or export drives. ${ReturnPackageCarrierName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Int64] # The number of drives included in the package. ${ReturnPackageDriveCount}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The date when the package is shipped. ${ReturnPackageShipDate}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The tracking number of the package. ${ReturnPackageTrackingNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The customer's account number with the carrier. ${ReturnShippingCarrierAccountNumber}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The carrier's name. ${ReturnShippingCarrierName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The city name to use when returning the drives. ${ShippingInformationCity}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The country or region to use when returning the drives. ${ShippingInformationCountryOrRegion}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Phone number of the recipient of the returned drives. ${ShippingInformationPhone}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The postal code to use when returning the drives. ${ShippingInformationPostalCode}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The name of the recipient who will receive the hard drives when they are returned. ${ShippingInformationRecipientName}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The state or province to use when returning the drives. ${ShippingInformationStateOrProvince}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The first line of the street address to use when returning the drives. ${ShippingInformationStreetAddress1}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The second line of the street address to use when returning the drives. ${ShippingInformationStreetAddress2}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Current state of the job. ${State}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The resource identifier of the storage account where data will be imported to or exported from. ${StorageAccountId}, - [Parameter()] + [Parameter(ParameterSetName='CreateExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags]))] [System.Collections.Hashtable] # Specifies the tags that will be assigned to the job. ${Tag}, + [Parameter(ParameterSetName='CreateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] + [System.String] + # Path of Json file supplied to the Create operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='CreateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] + [System.String] + # Json string supplied to the Create operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -839,6 +870,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -859,10 +899,10 @@ begin { $mapping = @{ CreateExpanded = 'Az.ImportExport.private\New-AzImportExport_CreateExpanded'; + CreateViaJsonFilePath = 'Az.ImportExport.private\New-AzImportExport_CreateViaJsonFilePath'; + CreateViaJsonString = 'Az.ImportExport.private\New-AzImportExport_CreateViaJsonString'; } - if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('CreateExpanded', 'CreateViaJsonFilePath', 'CreateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -876,6 +916,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -977,7 +1020,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1048,6 +1090,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1070,9 +1121,7 @@ begin { Delete = 'Az.ImportExport.private\Remove-AzImportExport_Delete'; DeleteViaIdentity = 'Az.ImportExport.private\Remove-AzImportExport_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1086,6 +1135,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1131,11 +1183,11 @@ end { <# .Synopsis -Updates specific properties of a job. +update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job. .Description -Updates specific properties of a job. +update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job. .Example @@ -1146,7 +1198,7 @@ Get-AzImportExport -Name test-job -ResourceGroupName ImportTestRG | Update-AzImp .Inputs Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -1163,7 +1215,7 @@ DRIVELIST : List of drives that comprise the job. [ManifestHash ]: The Base16-encoded MD5 hash of the manifest file on the drive. [ManifestUri ]: A URI that points to the blob containing the drive manifest file. [PercentComplete ]: Percentage completed for the drive. - [State ]: The drive's current state. + [State ]: The drive's current state. [VerboseLogUri ]: A URI that points to the blob containing the verbose log for the data transfer operation. INPUTOBJECT : Identity Parameter @@ -1176,10 +1228,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.importexport/update-azimportexport #> function Update-AzImportExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('JobName')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [System.String] @@ -1187,12 +1241,16 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [System.String] # The resource group name uniquely identifies the resource group within the user subscription. ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -1203,7 +1261,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -1212,137 +1269,169 @@ param( # Specifies the preferred language for the response. ${AcceptLanguage}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether the manifest files on the drives should be copied to block blobs. ${BackupDriveManifest}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Management.Automation.SwitchParameter] # If specified, the value must be true. # The service will attempt to cancel the job. ${CancelRequested}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The name of the carrier that is used to ship the import or export drives. ${DeliveryPackageCarrierName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Int64] # The number of drives included in the package. ${DeliveryPackageDriveCount}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The date when the package is shipped. ${DeliveryPackageShipDate}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The tracking number of the package. ${DeliveryPackageTrackingNumber}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus[]] # List of drives that comprise the job. - # To construct, see NOTES section for DRIVELIST properties and create a hash table. ${DriveList}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Indicates whether error logging or verbose logging is enabled. ${LogLevel}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The city name to use when returning the drives. ${ReturnAddressCity}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The country or region to use when returning the drives. ${ReturnAddressCountryOrRegion}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Email address of the recipient of the returned drives. ${ReturnAddressEmail}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Phone number of the recipient of the returned drives. ${ReturnAddressPhone}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The postal code to use when returning the drives. ${ReturnAddressPostalCode}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The name of the recipient who will receive the hard drives when they are returned. ${ReturnAddressRecipientName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The state or province to use when returning the drives. ${ReturnAddressStateOrProvince}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The first line of the street address to use when returning the drives. ${ReturnAddressStreetAddress1}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The second line of the street address to use when returning the drives. ${ReturnAddressStreetAddress2}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The customer's account number with the carrier. ${ReturnShippingCarrierAccountNumber}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The carrier's name. ${ReturnShippingCarrierName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # If specified, the value must be Shipping, which tells the Import/Export service that the package for the job has been shipped. # The ReturnAddress and DeliveryPackage properties must have been set either in this request or in a previous request, otherwise the request will fail. ${State}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags]))] [System.Collections.Hashtable] # Specifies the tags that will be assigned to the job. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -1399,6 +1488,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1420,10 +1518,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ImportExport.private\Update-AzImportExport_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ImportExport.private\Update-AzImportExport_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ImportExport.private\Update-AzImportExport_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ImportExport.private\Update-AzImportExport_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1437,6 +1535,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1489,12 +1590,12 @@ Returns the BitLocker Keys for all drives in the specified job. Get-AzImportExportBitLockerKey -JobName test-job -ResourceGroupName ImportTestRG .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey .Link https://learn.microsoft.com/powershell/module/az.importexport/get-azimportexportbitlockerkey #> function Get-AzImportExportBitLockerKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter(Mandatory)] @@ -1577,6 +1678,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1598,9 +1708,7 @@ begin { $mapping = @{ List = 'Az.ImportExport.custom\Get-AzImportExportBitLockerKey'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -1614,6 +1722,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -1667,12 +1778,12 @@ $driveList = New-AzImportExportDriveListObject -DriveId "9CA995BA" -BitLockerKey New-AzImportExport -Name test-job -ResourceGroupName ImportTestRG -Location eastus -StorageAccountId "/subscriptions//resourcegroups/ImportTestRG/providers/Microsoft.Storage/storageAccounts/teststorageforimport" -JobType Import -ReturnAddressRecipientName "Some name" -ReturnAddressStreetAddress1 "Street1" -ReturnAddressCity "Redmond" -ReturnAddressStateOrProvince "WA" -ReturnAddressPostalCode "98008" -ReturnAddressCountryOrRegion "USA" -ReturnAddressPhone "4250000000" -ReturnAddressEmail test@contoso.com -DiagnosticsPath "waimportexport" -BackupDriveManifest -DriveList $driveList .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus .Link https://learn.microsoft.com/powershell/module/az.importexport/new-AzImportExportDriveListObject #> function New-AzImportExportDriveListObject { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus])] [CmdletBinding(PositionalBinding=$false)] param( [Parameter()] @@ -1737,8 +1848,9 @@ param( ${PercentComplete}, [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("Specified", "Received", "NeverReceived", "Transferring", "Completed", "CompletedMoreInfo", "ShippedBack")] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState] + [System.String] # The drive's current state. ${State}, @@ -1756,6 +1868,9 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -1784,6 +1899,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ImportExport/ImportExport.Autorest/exports/Remove-AzImportExport.ps1 b/generated/ImportExport/ImportExport.Autorest/exports/Remove-AzImportExport.ps1 index 3e2a7cd2ee58..d29e05b76919 100644 --- a/generated/ImportExport/ImportExport.Autorest/exports/Remove-AzImportExport.ps1 +++ b/generated/ImportExport/ImportExport.Autorest/exports/Remove-AzImportExport.ps1 @@ -72,7 +72,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -143,6 +142,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -165,9 +173,7 @@ begin { Delete = 'Az.ImportExport.private\Remove-AzImportExport_Delete'; DeleteViaIdentity = 'Az.ImportExport.private\Remove-AzImportExport_DeleteViaIdentity'; } - if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -181,6 +187,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ImportExport/ImportExport.Autorest/exports/Update-AzImportExport.ps1 b/generated/ImportExport/ImportExport.Autorest/exports/Update-AzImportExport.ps1 index 7cd1a157763d..2cb801dadddc 100644 --- a/generated/ImportExport/ImportExport.Autorest/exports/Update-AzImportExport.ps1 +++ b/generated/ImportExport/ImportExport.Autorest/exports/Update-AzImportExport.ps1 @@ -16,11 +16,11 @@ <# .Synopsis -Updates specific properties of a job. +update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job. .Description -Updates specific properties of a job. +update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job. .Example @@ -31,7 +31,7 @@ Get-AzImportExport -Name test-job -ResourceGroupName ImportTestRG | Update-AzImp .Inputs Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse .Notes COMPLEX PARAMETER PROPERTIES @@ -48,7 +48,7 @@ DRIVELIST : List of drives that comprise the job. [ManifestHash ]: The Base16-encoded MD5 hash of the manifest file on the drive. [ManifestUri ]: A URI that points to the blob containing the drive manifest file. [PercentComplete ]: Percentage completed for the drive. - [State ]: The drive's current state. + [State ]: The drive's current state. [VerboseLogUri ]: A URI that points to the blob containing the verbose log for the data transfer operation. INPUTOBJECT : Identity Parameter @@ -61,10 +61,12 @@ INPUTOBJECT : Identity Parameter https://learn.microsoft.com/powershell/module/az.importexport/update-azimportexport #> function Update-AzImportExport { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse])] [CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Alias('JobName')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [System.String] @@ -72,12 +74,16 @@ param( ${Name}, [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [System.String] # The resource group name uniquely identifies the resource group within the user subscription. ${ResourceGroupName}, [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaJsonFilePath')] + [Parameter(ParameterSetName='UpdateViaJsonString')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] [System.String] @@ -88,7 +94,6 @@ param( [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Path')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IImportExportIdentity] # Identity Parameter - # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter()] @@ -97,137 +102,169 @@ param( # Specifies the preferred language for the response. ${AcceptLanguage}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Management.Automation.SwitchParameter] # Indicates whether the manifest files on the drives should be copied to block blobs. ${BackupDriveManifest}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Management.Automation.SwitchParameter] # If specified, the value must be true. # The service will attempt to cancel the job. ${CancelRequested}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The name of the carrier that is used to ship the import or export drives. ${DeliveryPackageCarrierName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.Int64] # The number of drives included in the package. ${DeliveryPackageDriveCount}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The date when the package is shipped. ${DeliveryPackageShipDate}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The tracking number of the package. ${DeliveryPackageTrackingNumber}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [AllowEmptyCollection()] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus[]] # List of drives that comprise the job. - # To construct, see NOTES section for DRIVELIST properties and create a hash table. ${DriveList}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Indicates whether error logging or verbose logging is enabled. ${LogLevel}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The city name to use when returning the drives. ${ReturnAddressCity}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The country or region to use when returning the drives. ${ReturnAddressCountryOrRegion}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Email address of the recipient of the returned drives. ${ReturnAddressEmail}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # Phone number of the recipient of the returned drives. ${ReturnAddressPhone}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The postal code to use when returning the drives. ${ReturnAddressPostalCode}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The name of the recipient who will receive the hard drives when they are returned. ${ReturnAddressRecipientName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The state or province to use when returning the drives. ${ReturnAddressStateOrProvince}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The first line of the street address to use when returning the drives. ${ReturnAddressStreetAddress1}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The second line of the street address to use when returning the drives. ${ReturnAddressStreetAddress2}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The customer's account number with the carrier. ${ReturnShippingCarrierAccountNumber}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # The carrier's name. ${ReturnShippingCarrierName}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] [System.String] # If specified, the value must be Shipping, which tells the Import/Export service that the package for the job has been shipped. # The ReturnAddress and DeliveryPackage properties must have been set either in this request or in a previous request, otherwise the request will fail. ${State}, - [Parameter()] + [Parameter(ParameterSetName='UpdateExpanded')] + [Parameter(ParameterSetName='UpdateViaIdentityExpanded')] [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] - [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags]))] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags]))] [System.Collections.Hashtable] # Specifies the tags that will be assigned to the job. ${Tag}, + [Parameter(ParameterSetName='UpdateViaJsonFilePath', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] + [System.String] + # Path of Json file supplied to the Update operation + ${JsonFilePath}, + + [Parameter(ParameterSetName='UpdateViaJsonString', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category('Body')] + [System.String] + # Json string supplied to the Update operation + ${JsonString}, + [Parameter()] [Alias('AzureRMContext', 'AzureCredential')] [ValidateNotNull()] @@ -284,6 +321,15 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + + $context = Get-AzContext + if (-not $context -and -not $testPlayback) { + Write-Error "No Azure login detected. Please run 'Connect-AzAccount' to log in." + exit + } if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $PSVersionTable.PSVersion.ToString() @@ -305,10 +351,10 @@ begin { $mapping = @{ UpdateExpanded = 'Az.ImportExport.private\Update-AzImportExport_UpdateExpanded'; UpdateViaIdentityExpanded = 'Az.ImportExport.private\Update-AzImportExport_UpdateViaIdentityExpanded'; + UpdateViaJsonFilePath = 'Az.ImportExport.private\Update-AzImportExport_UpdateViaJsonFilePath'; + UpdateViaJsonString = 'Az.ImportExport.private\Update-AzImportExport_UpdateViaJsonString'; } - if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('UpdateExpanded', 'UpdateViaJsonFilePath', 'UpdateViaJsonString') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -322,6 +368,9 @@ begin { [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PromptedPreviewMessageCmdlets.Enqueue($MyInvocation.MyCommand.Name) } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ImportExport/ImportExport.Autorest/generate-info.json b/generated/ImportExport/ImportExport.Autorest/generate-info.json index 567a41ef612f..ab1339ec7dde 100644 --- a/generated/ImportExport/ImportExport.Autorest/generate-info.json +++ b/generated/ImportExport/ImportExport.Autorest/generate-info.json @@ -1,3 +1,3 @@ { - "generate_Id": "06d7154f-2591-42eb-bdc3-621a56048b36" + "generate_Id": "615b1d44-2fd3-4aa6-a4ef-b0b79b4f5f5a" } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/Module.cs b/generated/ImportExport/ImportExport.Autorest/generated/Module.cs index 0c398f55ecfc..85c9af185c7d 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/Module.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/Module.cs @@ -28,12 +28,20 @@ public partial class Module public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + private static bool _init = false; + + private static readonly global::System.Object _initLock = new global::System.Object(); + + private static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module _instance; + /// the ISendAsync pipeline instance private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline _pipeline; /// the ISendAsync pipeline instance (when proxy is enabled) private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline _pipelineWithProxy; + private static readonly global::System.Object _singletonLock = new global::System.Object(); + public bool _useProxy = false; public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); @@ -56,11 +64,8 @@ public partial class Module /// The delegate to get the telemetry info. public GetTelemetryInfoDelegate GetTelemetryInfo { get; set; } - /// Backing field for property. - private static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module _instance; - /// the singleton of this module class - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module()); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module Instance { get { if (_instance == null) { lock (_singletonLock) { if (_instance == null) { _instance = new Module(); }}} return _instance; } } /// The Name of this module public string Name => @"Az.ImportExport"; @@ -125,9 +130,17 @@ public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Crea /// Initialization steps performed after the module is loaded. public void Init() { - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); - OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); - CustomInit(); + if (_init == false) + { + lock (_initLock) { + if (_init == false) { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + _init = true; + } + } + } } /// Creates the module instance. diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/ImportExport.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/ImportExport.cs index 0f69315ad7ac..070eab3012db 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/ImportExport.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/ImportExport.cs @@ -15,9 +15,9 @@ public partial class ImportExport { /// Returns the BitLocker Keys for all drives in the specified job. - /// The name of the import/export job. /// The subscription ID for the Azure user. /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. /// Specifies the preferred language for the response. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -27,7 +27,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BitLockerKeysList(string jobName, string subscriptionId, string resourceGroupName, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BitLockerKeysList(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -61,7 +61,7 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BitLockerKeysList_Call(request,onOk,onDefault,eventListener,sender); + await this.BitLockerKeysList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -76,7 +76,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task BitLockerKeysListViaIdentity(global::System.String viaIdentity, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task BitLockerKeysListViaIdentity(global::System.String viaIdentity, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -84,16 +84,16 @@ public partial class ImportExport { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ImportExport/jobs/(?[^/]+)/listBitLockerKeys$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ImportExport/jobs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}/listBitLockerKeys'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'"); } // replace URI parameters with values from identity - var jobName = _match.Groups["jobName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var jobName = _match.Groups["jobName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -122,11 +122,179 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.BitLockerKeysList_Call(request,onOk,onDefault,eventListener,sender); + await this.BitLockerKeysList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Returns the BitLocker Keys for all drives in the specified job. + /// + /// Specifies the preferred language for the response. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BitLockerKeysListViaIdentityWithResult(global::System.String viaIdentity, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ImportExport/jobs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var jobName = _match.Groups["jobName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ImportExport/jobs/" + + jobName + + "/listBitLockerKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BitLockerKeysListWithResult_Call (request, eventListener,sender); + } + } + + /// Returns the BitLocker Keys for all drives in the specified job. + /// The subscription ID for the Azure user. + /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. + /// Specifies the preferred language for the response. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BitLockerKeysListWithResult(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ImportExport/jobs/" + + global::System.Uri.EscapeDataString(jobName) + + "/listBitLockerKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.BitLockerKeysListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BitLockerKeysListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.GetBitLockerKeysResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -136,7 +304,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BitLockerKeysList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task BitLockerKeysList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -147,6 +315,7 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -154,13 +323,13 @@ public partial class ImportExport case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.GetBitLockerKeysResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.GetBitLockerKeysResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -179,29 +348,29 @@ public partial class ImportExport /// Validation method for method. Call this like the actual call, but you will get validation /// events back. /// - /// The name of the import/export job. /// The subscription ID for the Azure user. /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. /// Specifies the preferred language for the response. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task BitLockerKeysList_Validate(string jobName, string subscriptionId, string resourceGroupName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task BitLockerKeysList_Validate(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(jobName),jobName); await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(jobName),jobName); await eventListener.AssertNotNull(nameof(acceptLanguage),acceptLanguage); } } - /// Creates a new job or updates an existing job in the specified subscription. - /// The name of the import/export job. + /// create a new job or create an existing job in the specified subscription. /// The subscription ID for the Azure user. /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. /// Specifies the preferred language for the response. /// The tenant ID of the client making the request. /// The parameters used for creating the job @@ -211,10 +380,11 @@ public partial class ImportExport /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task JobsCreate(string jobName, string subscriptionId, string resourceGroupName, string acceptLanguage, string xMSClientTenantId, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsCreate(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, string xMSClientTenantId, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -251,15 +421,15 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.JobsCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.JobsCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Creates a new job or updates an existing job in the specified subscription. + /// create a new job or create an existing job in the specified subscription. /// /// Specifies the preferred language for the response. /// The tenant ID of the client making the request. @@ -270,10 +440,11 @@ public partial class ImportExport /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task JobsCreateViaIdentity(global::System.String viaIdentity, string acceptLanguage, string xMSClientTenantId, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsCreateViaIdentity(global::System.String viaIdentity, string acceptLanguage, string xMSClientTenantId, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -288,9 +459,9 @@ public partial class ImportExport } // replace URI parameters with values from identity - var jobName = _match.Groups["jobName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var jobName = _match.Groups["jobName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -322,106 +493,92 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.JobsCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + await this.JobsCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns 201 (Created). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// create a new job or create an existing job in the specified subscription. + /// + /// Specifies the preferred language for the response. + /// The tenant ID of the client making the request. + /// The parameters used for creating the job /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task JobsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsCreateViaIdentityWithResult(global::System.String viaIdentity, string acceptLanguage, string xMSClientTenantId, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters body, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeUpdate) { + var apiVersion = @"2021-01-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ImportExport/jobs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'"); + } - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - case global::System.Net.HttpStatusCode.Created: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var jobName = _match.Groups["jobName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ImportExport/jobs/" + + jobName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); } - finally + if (null != xMSClientTenantId) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("x-ms-client-tenant-id",xMSClientTenantId); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get validation events - /// back. - /// - /// The name of the import/export job. - /// The subscription ID for the Azure user. - /// The resource group name uniquely identifies the resource group within the user subscription. - /// Specifies the preferred language for the response. - /// The tenant ID of the client making the request. - /// The parameters used for creating the job - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task JobsCreate_Validate(string jobName, string subscriptionId, string resourceGroupName, string acceptLanguage, string xMSClientTenantId, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParameters body, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(jobName),jobName); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); - await eventListener.AssertNotNull(nameof(acceptLanguage),acceptLanguage); - await eventListener.AssertNotNull(nameof(xMSClientTenantId),xMSClientTenantId); - await eventListener.AssertNotNull(nameof(body), body); - await eventListener.AssertObjectIsValid(nameof(body), body); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.JobsCreateWithResult_Call (request, eventListener,sender); } } - /// - /// Deletes an existing job. Only jobs in the Creating or Completed states can be deleted. - /// - /// The name of the import/export job. + /// create a new job or create an existing job in the specified subscription. /// The subscription ID for the Azure user. /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. /// Specifies the preferred language for the response. + /// The tenant ID of the client making the request. + /// Json string supplied to the JobsCreate operation /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -429,7 +586,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task JobsDelete(string jobName, string subscriptionId, string resourceGroupName, string acceptLanguage, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsCreateViaJsonString(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, string xMSClientTenantId, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -451,7 +608,7 @@ public partial class ImportExport // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Delete, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Put, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -459,78 +616,208 @@ public partial class ImportExport { request.Headers.Add("Accept-Language",acceptLanguage); } + if (null != xMSClientTenantId) + { + request.Headers.Add("x-ms-client-tenant-id",xMSClientTenantId); + } await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.JobsDelete_Call(request,onOk,onDefault,eventListener,sender); + await this.JobsCreate_Call (request, onOk,onCreated,onDefault,eventListener,sender); } } - /// - /// Deletes an existing job. Only jobs in the Creating or Completed states can be deleted. - /// - /// + /// create a new job or create an existing job in the specified subscription. + /// The subscription ID for the Azure user. + /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. /// Specifies the preferred language for the response. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// The tenant ID of the client making the request. + /// Json string supplied to the JobsCreate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task JobsDeleteViaIdentity(global::System.String viaIdentity, string acceptLanguage, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsCreateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, string xMSClientTenantId, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ImportExport/jobs/" + + global::System.Uri.EscapeDataString(jobName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ImportExport/jobs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'"); + request.Headers.Add("Accept-Language",acceptLanguage); + } + if (null != xMSClientTenantId) + { + request.Headers.Add("x-ms-client-tenant-id",xMSClientTenantId); } - // replace URI parameters with values from identity - var jobName = _match.Groups["jobName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.JobsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// create a new job or create an existing job in the specified subscription. + /// The subscription ID for the Azure user. + /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. + /// Specifies the preferred language for the response. + /// The tenant ID of the client making the request. + /// The parameters used for creating the job + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsCreateWithResult(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, string xMSClientTenantId, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters body, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.ImportExport/jobs/" - + jobName + + global::System.Uri.EscapeDataString(jobName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Delete, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != acceptLanguage) { request.Headers.Add("Accept-Language",acceptLanguage); } + if (null != xMSClientTenantId) + { + request.Headers.Add("x-ms-client-tenant-id",xMSClientTenantId); + } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.JobsDelete_Call(request,onOk,onDefault,eventListener,sender); + return await this.JobsCreateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsCreateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). /// an instance that will receive events. @@ -538,7 +825,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task JobsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task JobsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -549,6 +836,7 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -556,13 +844,19 @@ public partial class ImportExport case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -578,32 +872,39 @@ public partial class ImportExport } /// - /// Validation method for method. Call this like the actual call, but you will get validation events + /// Validation method for method. Call this like the actual call, but you will get validation events /// back. /// - /// The name of the import/export job. /// The subscription ID for the Azure user. /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. /// Specifies the preferred language for the response. + /// The tenant ID of the client making the request. + /// The parameters used for creating the job /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task JobsDelete_Validate(string jobName, string subscriptionId, string resourceGroupName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task JobsCreate_Validate(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, string xMSClientTenantId, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters body, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(jobName),jobName); await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(jobName),jobName); await eventListener.AssertNotNull(nameof(acceptLanguage),acceptLanguage); + await eventListener.AssertNotNull(nameof(xMSClientTenantId),xMSClientTenantId); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); } } - /// Gets information about an existing job. - /// The name of the import/export job. + /// + /// Deletes an existing job. Only jobs in the Creating or Completed states can be deleted. + /// /// The subscription ID for the Azure user. /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. /// Specifies the preferred language for the response. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -613,7 +914,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task JobsGet(string jobName, string subscriptionId, string resourceGroupName, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsDelete(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -635,7 +936,7 @@ public partial class ImportExport // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -646,11 +947,13 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.JobsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.JobsDelete_Call (request, onOk,onDefault,eventListener,sender); } } - /// Gets information about an existing job. + /// + /// Deletes an existing job. Only jobs in the Creating or Completed states can be deleted. + /// /// /// Specifies the preferred language for the response. /// a delegate that is called when the remote service returns 200 (OK). @@ -661,7 +964,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task JobsGetViaIdentity(global::System.String viaIdentity, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsDeleteViaIdentity(global::System.String viaIdentity, string acceptLanguage, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -676,9 +979,9 @@ public partial class ImportExport } // replace URI parameters with values from identity - var jobName = _match.Groups["jobName"].Value; var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var jobName = _match.Groups["jobName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" @@ -695,7 +998,7 @@ public partial class ImportExport // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); - var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Delete, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } // add headers parameters @@ -706,11 +1009,11 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.JobsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.JobsDelete_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -720,7 +1023,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task JobsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task JobsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -731,6 +1034,7 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -738,13 +1042,13 @@ public partial class ImportExport case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -760,33 +1064,32 @@ public partial class ImportExport } /// - /// Validation method for method. Call this like the actual call, but you will get validation events + /// Validation method for method. Call this like the actual call, but you will get validation events /// back. /// - /// The name of the import/export job. /// The subscription ID for the Azure user. /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. /// Specifies the preferred language for the response. /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task JobsGet_Validate(string jobName, string subscriptionId, string resourceGroupName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task JobsDelete_Validate(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(jobName),jobName); await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(jobName),jobName); await eventListener.AssertNotNull(nameof(acceptLanguage),acceptLanguage); } } - /// Returns all active and completed jobs in a resource group. - /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. - /// Can be used to restrict the results to certain conditions. + /// Gets information about an existing job. /// The subscription ID for the Azure user. /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. /// Specifies the preferred language for the response. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -796,7 +1099,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task JobsListByResourceGroup(long? Top, string Filter, string subscriptionId, string resourceGroupName, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsGet(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -808,12 +1111,9 @@ public partial class ImportExport + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" + global::System.Uri.EscapeDataString(resourceGroupName) - + "/providers/Microsoft.ImportExport/jobs" + + "/providers/Microsoft.ImportExport/jobs/" + + global::System.Uri.EscapeDataString(jobName) + "?" - + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -832,14 +1132,12 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.JobsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.JobsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns all active and completed jobs in a resource group. + /// Gets information about an existing job. /// - /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. - /// Can be used to restrict the results to certain conditions. /// Specifies the preferred language for the response. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -849,7 +1147,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task JobsListByResourceGroupViaIdentity(global::System.String viaIdentity, long? Top, string Filter, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsGetViaIdentity(global::System.String viaIdentity, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -857,27 +1155,25 @@ public partial class ImportExport { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ImportExport/jobs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ImportExport/jobs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var jobName = _match.Groups["jobName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName - + "/providers/Microsoft.ImportExport/jobs" + + "/providers/Microsoft.ImportExport/jobs/" + + jobName + "?" - + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) - + "&" - + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) - + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -896,88 +1192,255 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.JobsListByResourceGroup_Call(request,onOk,onDefault,eventListener,sender); + await this.JobsGet_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Gets information about an existing job. + /// + /// Specifies the preferred language for the response. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task JobsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsGetViaIdentityWithResult(global::System.String viaIdentity, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { + var apiVersion = @"2021-01-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ListJobsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } - } - finally + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ImportExport/jobs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'"); } - } - } - /// - /// Validation method for method. Call this like the actual call, but you will get - /// validation events back. - /// - /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. - /// Can be used to restrict the results to certain conditions. - /// The subscription ID for the Azure user. - /// The resource group name uniquely identifies the resource group within the user subscription. - /// Specifies the preferred language for the response. - /// an instance that will receive events. - /// - /// A that will be complete when handling of the response is completed. - /// - internal async global::System.Threading.Tasks.Task JobsListByResourceGroup_Validate(long? Top, string Filter, string subscriptionId, string resourceGroupName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) - { - using( NoSynchronizationContext ) - { - await eventListener.AssertNotNull(nameof(Filter),Filter); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var jobName = _match.Groups["jobName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ImportExport/jobs/" + + jobName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.JobsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Gets information about an existing job. + /// The subscription ID for the Azure user. + /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. + /// Specifies the preferred language for the response. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsGetWithResult(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ImportExport/jobs/" + + global::System.Uri.EscapeDataString(jobName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.JobsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The subscription ID for the Azure user. + /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. + /// Specifies the preferred language for the response. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsGet_Validate(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(jobName),jobName); await eventListener.AssertNotNull(nameof(acceptLanguage),acceptLanguage); } } - /// Returns all active and completed jobs in a subscription. - /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. - /// Can be used to restrict the results to certain conditions. + /// Returns all active and completed jobs in a resource group. /// The subscription ID for the Azure user. + /// The resource group name uniquely identifies the resource group within the user subscription. /// Specifies the preferred language for the response. + /// Can be used to restrict the results to certain conditions. + /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -986,7 +1449,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task JobsListBySubscription(long? Top, string Filter, string subscriptionId, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsListByResourceGroup(string subscriptionId, string resourceGroupName, string acceptLanguage, string Filter, long? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -996,12 +1459,14 @@ public partial class ImportExport var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.ImportExport/jobs" + "?" - + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) - + "&" + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1020,15 +1485,15 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.JobsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.JobsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Returns all active and completed jobs in a subscription. + /// Returns all active and completed jobs in a resource group. /// - /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. - /// Can be used to restrict the results to certain conditions. /// Specifies the preferred language for the response. + /// Can be used to restrict the results to certain conditions. + /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled /// elsewhere). @@ -1037,7 +1502,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task JobsListBySubscriptionViaIdentity(global::System.String viaIdentity, long? Top, string Filter, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsListByResourceGroupViaIdentity(global::System.String viaIdentity, string acceptLanguage, string Filter, long? Top, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -1045,24 +1510,27 @@ public partial class ImportExport { // verify that Identity format is an exact match for uri - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.ImportExport/jobs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ImportExport/jobs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); if (!_match.Success) { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ImportExport/jobs'"); + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs'"); } // replace URI parameters with values from identity var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" + subscriptionId + + "/resourceGroups/" + + resourceGroupName + "/providers/Microsoft.ImportExport/jobs" + "?" - + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) - + "&" + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); @@ -1081,100 +1549,884 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.JobsListBySubscription_Call(request,onOk,onDefault,eventListener,sender); + await this.JobsListByResourceGroup_Call (request, onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. - /// the prepared HttpRequestMessage to send. - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Returns all active and completed jobs in a resource group. + /// + /// Specifies the preferred language for the response. + /// Can be used to restrict the results to certain conditions. + /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task JobsListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsListByResourceGroupViaIdentityWithResult(global::System.String viaIdentity, string acceptLanguage, string Filter, long? Top, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { + var apiVersion = @"2021-01-01"; + // Constant Parameters using( NoSynchronizationContext ) { - global::System.Net.Http.HttpResponseMessage _response = null; - try - { - var sendTask = sender.SendAsync(request, eventListener); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } - _response = await sendTask; - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - var _contentType = _response.Content.Headers.ContentType?.MediaType; + // verify that Identity format is an exact match for uri - switch ( _response.StatusCode ) - { - case global::System.Net.HttpStatusCode.OK: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ListJobsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - default: - { - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); - break; - } - } + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ImportExport/jobs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs'"); } - finally + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ImportExport/jobs" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.JobsListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Returns all active and completed jobs in a resource group. + /// The subscription ID for the Azure user. + /// The resource group name uniquely identifies the resource group within the user subscription. + /// Specifies the preferred language for the response. + /// Can be used to restrict the results to certain conditions. + /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsListByResourceGroupWithResult(string subscriptionId, string resourceGroupName, string acceptLanguage, string Filter, long? Top, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ImportExport/jobs" + + "?" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.JobsListByResourceGroupWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsListByResourceGroupWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ListJobsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ListJobsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The subscription ID for the Azure user. + /// The resource group name uniquely identifies the resource group within the user subscription. + /// Can be used to restrict the results to certain conditions. + /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. + /// Specifies the preferred language for the response. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsListByResourceGroup_Validate(string subscriptionId, string resourceGroupName, string Filter, long? Top, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(acceptLanguage),acceptLanguage); + } + } + + /// Returns all active and completed jobs in a subscription. + /// The subscription ID for the Azure user. + /// Specifies the preferred language for the response. + /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. + /// Can be used to restrict the results to certain conditions. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsListBySubscription(string subscriptionId, string acceptLanguage, long? Top, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ImportExport/jobs" + + "?" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Returns all active and completed jobs in a subscription. + /// + /// Specifies the preferred language for the response. + /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. + /// Can be used to restrict the results to certain conditions. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsListBySubscriptionViaIdentity(global::System.String viaIdentity, string acceptLanguage, long? Top, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.ImportExport/jobs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ImportExport/jobs'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ImportExport/jobs" + + "?" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsListBySubscription_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// Returns all active and completed jobs in a subscription. + /// + /// Specifies the preferred language for the response. + /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. + /// Can be used to restrict the results to certain conditions. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsListBySubscriptionViaIdentityWithResult(global::System.String viaIdentity, string acceptLanguage, long? Top, string Filter, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.ImportExport/jobs$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.ImportExport/jobs'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.ImportExport/jobs" + + "?" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.JobsListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Returns all active and completed jobs in a subscription. + /// The subscription ID for the Azure user. + /// Specifies the preferred language for the response. + /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. + /// Can be used to restrict the results to certain conditions. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsListBySubscriptionWithResult(string subscriptionId, string acceptLanguage, long? Top, string Filter, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.ImportExport/jobs" + + "?" + + (null == Top ? global::System.String.Empty : "$top=" + global::System.Uri.EscapeDataString(Top.ToString())) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.JobsListBySubscriptionWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsListBySubscriptionWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ListJobsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsListBySubscription_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ListJobsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The subscription ID for the Azure user. + /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. + /// Can be used to restrict the results to certain conditions. + /// Specifies the preferred language for the response. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsListBySubscription_Validate(string subscriptionId, long? Top, string Filter, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(acceptLanguage),acceptLanguage); + } + } + + /// + /// update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives + /// comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing + /// job. + /// + /// The subscription ID for the Azure user. + /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. + /// Specifies the preferred language for the response. + /// The parameters to update in the job + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsUpdate(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ImportExport/jobs/" + + global::System.Uri.EscapeDataString(jobName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives + /// comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing + /// job. + /// + /// + /// Specifies the preferred language for the response. + /// The parameters to update in the job + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsUpdateViaIdentity(global::System.String viaIdentity, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ImportExport/jobs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var jobName = _match.Groups["jobName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ImportExport/jobs/" + + jobName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsUpdate_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives + /// comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing + /// job. + /// + /// + /// Specifies the preferred language for the response. + /// The parameters to update in the job + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task JobsUpdateViaIdentityWithResult(global::System.String viaIdentity, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters body, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeUpdate) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ImportExport/jobs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var jobName = _match.Groups["jobName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.ImportExport/jobs/" + + jobName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) { - // finally statements - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); - _response?.Dispose(); - request?.Dispose(); + request.Headers.Add("Accept-Language",acceptLanguage); } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.JobsUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Validation method for method. Call this like the actual call, but you will get validation - /// events back. + /// update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives + /// comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing + /// job. /// - /// An integer value that specifies how many jobs at most should be returned. The value cannot exceed 100. - /// Can be used to restrict the results to certain conditions. /// The subscription ID for the Azure user. + /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. /// Specifies the preferred language for the response. + /// Json string supplied to the JobsUpdate operation + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task JobsListBySubscription_Validate(long? Top, string Filter, string subscriptionId, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) + public async global::System.Threading.Tasks.Task JobsUpdateViaJsonString(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, global::System.String jsonString, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { + var apiVersion = @"2021-01-01"; + // Constant Parameters using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(Filter),Filter); - await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); - await eventListener.AssertNotNull(nameof(acceptLanguage),acceptLanguage); + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.ImportExport/jobs/" + + global::System.Uri.EscapeDataString(jobName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.JobsUpdate_Call (request, onOk,onDefault,eventListener,sender); } } /// - /// Updates specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives + /// update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives /// comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing /// job. /// - /// The name of the import/export job. /// The subscription ID for the Azure user. /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. /// Specifies the preferred language for the response. - /// The parameters to update in the job - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). + /// Json string supplied to the JobsUpdate operation /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task JobsUpdate(string jobName, string subscriptionId, string resourceGroupName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsUpdateViaJsonStringWithResult(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, global::System.String jsonString, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -1192,12 +2444,12 @@ public partial class ImportExport + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != acceptLanguage) @@ -1205,68 +2457,57 @@ public partial class ImportExport request.Headers.Add("Accept-Language",acceptLanguage); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(jsonString, global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.JobsUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.JobsUpdateWithResult_Call (request, eventListener,sender); } } /// - /// Updates specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives + /// update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives /// comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing /// job. /// - /// + /// The subscription ID for the Azure user. + /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. /// Specifies the preferred language for the response. /// The parameters to update in the job - /// a delegate that is called when the remote service returns 200 (OK). - /// a delegate that is called when the remote service returns default (any response code not handled - /// elsewhere). /// an instance that will receive events. /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// Allows the caller to choose the depth of the serialization. See . /// - /// A that will be complete when handling of the response is completed. + /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task JobsUpdateViaIdentity(global::System.String viaIdentity, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task JobsUpdateWithResult(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters body, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode serializationMode = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeCreate|Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeUpdate) { var apiVersion = @"2021-01-01"; // Constant Parameters using( NoSynchronizationContext ) { - // verify that Identity format is an exact match for uri - - var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.ImportExport/jobs/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); - if (!_match.Success) - { - throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}'"); - } - - // replace URI parameters with values from identity - var jobName = _match.Groups["jobName"].Value; - var subscriptionId = _match.Groups["subscriptionId"].Value; - var resourceGroupName = _match.Groups["resourceGroupName"].Value; // construct URL var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( "/subscriptions/" - + subscriptionId + + global::System.Uri.EscapeDataString(subscriptionId) + "/resourceGroups/" - + resourceGroupName + + global::System.Uri.EscapeDataString(resourceGroupName) + "/providers/Microsoft.ImportExport/jobs/" - + jobName + + global::System.Uri.EscapeDataString(jobName) + "?" + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // generate request object var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Patch, _url); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } // add headers parameters if (null != acceptLanguage) @@ -1274,17 +2515,77 @@ public partial class ImportExport request.Headers.Add("Accept-Language",acceptLanguage); } - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } // set body content - request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null, serializationMode).ToString() : @"{}", global::System.Text.Encoding.UTF8); request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return null; } // make the call - await this.JobsUpdate_Call(request,onOk,onDefault,eventListener,sender); + return await this.JobsUpdateWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task JobsUpdateWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1294,7 +2595,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task JobsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task JobsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1305,6 +2606,7 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1312,13 +2614,13 @@ public partial class ImportExport case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1337,22 +2639,22 @@ public partial class ImportExport /// Validation method for method. Call this like the actual call, but you will get validation events /// back. /// - /// The name of the import/export job. /// The subscription ID for the Azure user. /// The resource group name uniquely identifies the resource group within the user subscription. + /// The name of the import/export job. /// Specifies the preferred language for the response. /// The parameters to update in the job /// an instance that will receive events. /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task JobsUpdate_Validate(string jobName, string subscriptionId, string resourceGroupName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters body, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) + internal async global::System.Threading.Tasks.Task JobsUpdate_Validate(string subscriptionId, string resourceGroupName, string jobName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters body, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener) { using( NoSynchronizationContext ) { - await eventListener.AssertNotNull(nameof(jobName),jobName); await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertNotNull(nameof(jobName),jobName); await eventListener.AssertNotNull(nameof(acceptLanguage),acceptLanguage); await eventListener.AssertNotNull(nameof(body), body); await eventListener.AssertObjectIsValid(nameof(body), body); @@ -1373,7 +2675,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LocationsGet(string locationName, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LocationsGet(string locationName, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -1402,7 +2704,7 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LocationsGet_Call(request,onOk,onDefault,eventListener,sender); + await this.LocationsGet_Call (request, onOk,onDefault,eventListener,sender); } } @@ -1420,7 +2722,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LocationsGetViaIdentity(global::System.String viaIdentity, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LocationsGetViaIdentity(global::System.String viaIdentity, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -1451,19 +2753,179 @@ public partial class ImportExport var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } - // add headers parameters - if (null != acceptLanguage) + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LocationsGet_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Returns the details about a location to which you can ship the disks associated with an import or export job. A location + /// is an Azure region. + /// + /// + /// Specifies the preferred language for the response. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocationsGetViaIdentityWithResult(global::System.String viaIdentity, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.ImportExport/locations/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.ImportExport/locations/{locationName}'"); + } + + // replace URI parameters with values from identity + var locationName = _match.Groups["locationName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ImportExport/locations/" + + locationName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LocationsGetWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Returns the details about a location to which you can ship the disks associated with an import or export job. A location + /// is an Azure region. + /// + /// The name of the location. For example, West US or westus. + /// Specifies the preferred language for the response. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocationsGetWithResult(string locationName, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ImportExport/locations/" + + global::System.Uri.EscapeDataString(locationName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LocationsGetWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A + /// that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocationsGetWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Location.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally { - request.Headers.Add("Accept-Language",acceptLanguage); + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); } - - await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } - // make the call - await this.LocationsGet_Call(request,onOk,onDefault,eventListener,sender); } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1473,7 +2935,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LocationsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LocationsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1484,6 +2946,7 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1491,13 +2954,13 @@ public partial class ImportExport case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.Location.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Location.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1544,7 +3007,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LocationsList(string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LocationsList(string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -1572,7 +3035,7 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LocationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.LocationsList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -1590,7 +3053,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task LocationsListViaIdentity(global::System.String viaIdentity, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task LocationsListViaIdentity(global::System.String viaIdentity, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -1627,11 +3090,167 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.LocationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.LocationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Returns a list of locations to which you can ship the disks associated with an import or export job. A location is a Microsoft + /// data center region. + /// + /// + /// Specifies the preferred language for the response. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocationsListViaIdentityWithResult(global::System.String viaIdentity, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.ImportExport/locations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.ImportExport/locations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ImportExport/locations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LocationsListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Returns a list of locations to which you can ship the disks associated with an import or export job. A location is a Microsoft + /// data center region. + /// + /// Specifies the preferred language for the response. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocationsListWithResult(string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ImportExport/locations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.LocationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.LocationsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1641,7 +3260,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task LocationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task LocationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1652,6 +3271,7 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1659,13 +3279,13 @@ public partial class ImportExport case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.LocationsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.LocationsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } @@ -1709,7 +3329,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsList(string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsList(string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -1737,7 +3357,7 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); } } @@ -1754,7 +3374,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, string acceptLanguage, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { var apiVersion = @"2021-01-01"; // Constant Parameters @@ -1791,11 +3411,165 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } // make the call - await this.OperationsList_Call(request,onOk,onDefault,eventListener,sender); + await this.OperationsList_Call (request, onOk,onDefault,eventListener,sender); + } + } + + /// + /// Returns the list of operations supported by the import/export resource provider. + /// + /// + /// Specifies the preferred language for the response. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentityWithResult(global::System.String viaIdentity, string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.ImportExport/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.ImportExport/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ImportExport/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// + /// Returns the list of operations supported by the import/export resource provider. + /// + /// Specifies the preferred language for the response. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListWithResult(string acceptLanguage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + var apiVersion = @"2021-01-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.ImportExport/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return null; } + + // add headers parameters + if (null != acceptLanguage) + { + request.Headers.Add("Accept-Language",acceptLanguage); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return null; } + // make the call + return await this.OperationsListWithResult_Call (request, eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsListWithResult_Call(global::System.Net.Http.HttpRequestMessage request, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return null; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ListOperationsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + return await _result; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return null; } + var _result = _response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) ); + // Error Response : default + var code = (await _result)?.Code; + var message = (await _result)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(_response, await _result); + throw ex; + } + else + { + throw new global::System.Exception($"[{code}] : {message}"); + } + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } } } - /// Actual wire call for method. + /// Actual wire call for method. /// the prepared HttpRequestMessage to send. /// a delegate that is called when the remote service returns 200 (OK). /// a delegate that is called when the remote service returns default (any response code not handled @@ -1805,7 +3579,7 @@ public partial class ImportExport /// /// A that will be complete when handling of the response is completed. /// - internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) + internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.ISendAsync sender) { using( NoSynchronizationContext ) { @@ -1816,6 +3590,7 @@ public partial class ImportExport await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } _response = await sendTask; await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress, "intentional placeholder", 100); if( eventListener.Token.IsCancellationRequested ) { return; } var _contentType = _response.Content.Headers.ContentType?.MediaType; switch ( _response.StatusCode ) @@ -1823,13 +3598,13 @@ public partial class ImportExport case global::System.Net.HttpStatusCode.OK: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ListOperationsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ListOperationsResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } default: { await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } - await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(body.Result)) )); break; } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Any.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Any.PowerShell.cs index 6fad6e924012..43ccdcfec73d 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Any.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Any.PowerShell.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial class Any { @@ -54,6 +54,14 @@ public partial class Any partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + /// /// Deserializes a into a new instance of . @@ -125,8 +133,20 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny Deseri /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } - /// Any object + /// Anything [System.ComponentModel.TypeConverter(typeof(AnyTypeConverter))] public partial interface IAny diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Any.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Any.cs index 3e1b81ea75e5..14a65e1aba6a 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Any.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Any.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; - /// Any object + /// Anything public partial class Any : Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAnyInternal @@ -19,13 +19,13 @@ public Any() } } - /// Any object + /// Anything public partial interface IAny : Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IJsonSerializable { } - /// Any object + /// Anything internal partial interface IAnyInternal { diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Any.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Any.json.cs index 16a2970ec0c1..e30edeb198e1 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Any.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Any.json.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; - /// Any object + /// Anything public partial class Any { diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobDetails.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobDetails.PowerShell.cs deleted file mode 100644 index 678f70bfed83..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobDetails.PowerShell.cs +++ /dev/null @@ -1,560 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; - - /// Specifies the job properties - [System.ComponentModel.TypeConverter(typeof(JobDetailsTypeConverter))] - public partial class JobDetails - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new JobDetails(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new JobDetails(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal JobDetails(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ReturnAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddressTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnShipping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShippingTypeConverter.ConvertFrom); - } - if (content.Contains("ShippingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformation = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation) content.GetValueForProperty("ShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformation, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ShippingInformationTypeConverter.ConvertFrom); - } - if (content.Contains("DeliveryPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation) content.GetValueForProperty("ReturnPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("Export")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).Export = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport) content.GetValueForProperty("Export",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).Export, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.EncryptionKeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("StorageAccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).StorageAccountId, global::System.Convert.ToString); - } - if (content.Contains("JobType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).JobType, global::System.Convert.ToString); - } - if (content.Contains("DiagnosticsPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DiagnosticsPath = (string) content.GetValueForProperty("DiagnosticsPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DiagnosticsPath, global::System.Convert.ToString); - } - if (content.Contains("LogLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).LogLevel, global::System.Convert.ToString); - } - if (content.Contains("BackupDriveManifest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("State")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).State, global::System.Convert.ToString); - } - if (content.Contains("CancelRequested")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("PercentComplete")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("IncompleteBlobListUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).IncompleteBlobListUri = (string) content.GetValueForProperty("IncompleteBlobListUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).IncompleteBlobListUri, global::System.Convert.ToString); - } - if (content.Contains("DriveList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DriveList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DriveList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressCity, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressPhone, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressEmail, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationRecipientName = (string) content.GetValueForProperty("ShippingInformationRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationStreetAddress1 = (string) content.GetValueForProperty("ShippingInformationStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationStreetAddress2 = (string) content.GetValueForProperty("ShippingInformationStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationCity = (string) content.GetValueForProperty("ShippingInformationCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationCity, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationPostalCode = (string) content.GetValueForProperty("ShippingInformationPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationPhone = (string) content.GetValueForProperty("ShippingInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationPhone, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationAdditionalInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationAdditionalInformation = (string) content.GetValueForProperty("ShippingInformationAdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationAdditionalInformation, global::System.Convert.ToString); - } - if (content.Contains("ExportBlobList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ExportBlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList) content.GetValueForProperty("ExportBlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ExportBlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportBlobListTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnAddressStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierAccountNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationStateOrProvince = (string) content.GetValueForProperty("ShippingInformationStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationCountryOrRegion = (string) content.GetValueForProperty("ShippingInformationCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DeliveryPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageCarrierName = (string) content.GetValueForProperty("ReturnPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageTrackingNumber = (string) content.GetValueForProperty("ReturnPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageDriveCount = (long) content.GetValueForProperty("ReturnPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ReturnPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageShipDate = (string) content.GetValueForProperty("ReturnPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageShipDate, global::System.Convert.ToString); - } - if (content.Contains("ExportBlobListBlobPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ExportBlobListBlobPath = (string) content.GetValueForProperty("ExportBlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ExportBlobListBlobPath, global::System.Convert.ToString); - } - if (content.Contains("BlobPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).BlobPath = (string[]) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EncryptionKeyKekType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKeyKekType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType?) content.GetValueForProperty("EncryptionKeyKekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKeyKekType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType.CreateFrom); - } - if (content.Contains("EncryptionKeyKekUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKeyKekUrl = (string) content.GetValueForProperty("EncryptionKeyKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKeyKekUrl, global::System.Convert.ToString); - } - if (content.Contains("EncryptionKeyKekVaultResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKeyKekVaultResourceId = (string) content.GetValueForProperty("EncryptionKeyKekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKeyKekVaultResourceId, global::System.Convert.ToString); - } - if (content.Contains("BlobListBlobPathPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).BlobListBlobPathPrefix = (string[]) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal JobDetails(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ReturnAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddressTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnShipping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShippingTypeConverter.ConvertFrom); - } - if (content.Contains("ShippingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformation = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation) content.GetValueForProperty("ShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformation, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ShippingInformationTypeConverter.ConvertFrom); - } - if (content.Contains("DeliveryPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation) content.GetValueForProperty("ReturnPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("Export")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).Export = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport) content.GetValueForProperty("Export",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).Export, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.EncryptionKeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("StorageAccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).StorageAccountId, global::System.Convert.ToString); - } - if (content.Contains("JobType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).JobType, global::System.Convert.ToString); - } - if (content.Contains("DiagnosticsPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DiagnosticsPath = (string) content.GetValueForProperty("DiagnosticsPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DiagnosticsPath, global::System.Convert.ToString); - } - if (content.Contains("LogLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).LogLevel, global::System.Convert.ToString); - } - if (content.Contains("BackupDriveManifest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("State")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).State, global::System.Convert.ToString); - } - if (content.Contains("CancelRequested")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("PercentComplete")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("IncompleteBlobListUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).IncompleteBlobListUri = (string) content.GetValueForProperty("IncompleteBlobListUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).IncompleteBlobListUri, global::System.Convert.ToString); - } - if (content.Contains("DriveList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DriveList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DriveList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressCity, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressPhone, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressEmail, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationRecipientName = (string) content.GetValueForProperty("ShippingInformationRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationStreetAddress1 = (string) content.GetValueForProperty("ShippingInformationStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationStreetAddress2 = (string) content.GetValueForProperty("ShippingInformationStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationCity = (string) content.GetValueForProperty("ShippingInformationCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationCity, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationPostalCode = (string) content.GetValueForProperty("ShippingInformationPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationPhone = (string) content.GetValueForProperty("ShippingInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationPhone, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationAdditionalInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationAdditionalInformation = (string) content.GetValueForProperty("ShippingInformationAdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationAdditionalInformation, global::System.Convert.ToString); - } - if (content.Contains("ExportBlobList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ExportBlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList) content.GetValueForProperty("ExportBlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ExportBlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportBlobListTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnAddressStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierAccountNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationStateOrProvince = (string) content.GetValueForProperty("ShippingInformationStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationCountryOrRegion = (string) content.GetValueForProperty("ShippingInformationCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ShippingInformationCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DeliveryPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageCarrierName = (string) content.GetValueForProperty("ReturnPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageTrackingNumber = (string) content.GetValueForProperty("ReturnPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageDriveCount = (long) content.GetValueForProperty("ReturnPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ReturnPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageShipDate = (string) content.GetValueForProperty("ReturnPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ReturnPackageShipDate, global::System.Convert.ToString); - } - if (content.Contains("ExportBlobListBlobPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ExportBlobListBlobPath = (string) content.GetValueForProperty("ExportBlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).ExportBlobListBlobPath, global::System.Convert.ToString); - } - if (content.Contains("BlobPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).BlobPath = (string[]) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EncryptionKeyKekType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKeyKekType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType?) content.GetValueForProperty("EncryptionKeyKekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKeyKekType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType.CreateFrom); - } - if (content.Contains("EncryptionKeyKekUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKeyKekUrl = (string) content.GetValueForProperty("EncryptionKeyKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKeyKekUrl, global::System.Convert.ToString); - } - if (content.Contains("EncryptionKeyKekVaultResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKeyKekVaultResourceId = (string) content.GetValueForProperty("EncryptionKeyKekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).EncryptionKeyKekVaultResourceId, global::System.Convert.ToString); - } - if (content.Contains("BlobListBlobPathPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).BlobListBlobPathPrefix = (string[]) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Specifies the job properties - [System.ComponentModel.TypeConverter(typeof(JobDetailsTypeConverter))] - public partial interface IJobDetails - - { - - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobResponse.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobResponse.PowerShell.cs deleted file mode 100644 index eed8cb3fb78d..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobResponse.PowerShell.cs +++ /dev/null @@ -1,696 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; - - /// Contains the job information. - [System.ComponentModel.TypeConverter(typeof(JobResponseTypeConverter))] - public partial class JobResponse - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new JobResponse(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new JobResponse(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal JobResponse(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IdentityDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ReturnAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddressTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnShipping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShippingTypeConverter.ConvertFrom); - } - if (content.Contains("ShippingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformation = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation) content.GetValueForProperty("ShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformation, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ShippingInformationTypeConverter.ConvertFrom); - } - if (content.Contains("Export")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Export = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport) content.GetValueForProperty("Export",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Export, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportTypeConverter.ConvertFrom); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType.CreateFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DeliveryPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation) content.GetValueForProperty("ReturnPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.EncryptionKeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("StorageAccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).StorageAccountId, global::System.Convert.ToString); - } - if (content.Contains("JobType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).JobType, global::System.Convert.ToString); - } - if (content.Contains("DiagnosticsPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DiagnosticsPath = (string) content.GetValueForProperty("DiagnosticsPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DiagnosticsPath, global::System.Convert.ToString); - } - if (content.Contains("LogLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).LogLevel, global::System.Convert.ToString); - } - if (content.Contains("BackupDriveManifest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("State")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).State, global::System.Convert.ToString); - } - if (content.Contains("CancelRequested")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("PercentComplete")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("IncompleteBlobListUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IncompleteBlobListUri = (string) content.GetValueForProperty("IncompleteBlobListUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IncompleteBlobListUri, global::System.Convert.ToString); - } - if (content.Contains("DriveList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DriveList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DriveList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressCity, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressPhone, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressEmail, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationRecipientName = (string) content.GetValueForProperty("ShippingInformationRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationStreetAddress1 = (string) content.GetValueForProperty("ShippingInformationStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationStreetAddress2 = (string) content.GetValueForProperty("ShippingInformationStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationCity = (string) content.GetValueForProperty("ShippingInformationCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationCity, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationPostalCode = (string) content.GetValueForProperty("ShippingInformationPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationPhone = (string) content.GetValueForProperty("ShippingInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationPhone, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationAdditionalInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationAdditionalInformation = (string) content.GetValueForProperty("ShippingInformationAdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationAdditionalInformation, global::System.Convert.ToString); - } - if (content.Contains("ExportBlobList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ExportBlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList) content.GetValueForProperty("ExportBlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ExportBlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportBlobListTypeConverter.ConvertFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierAccountNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationStateOrProvince = (string) content.GetValueForProperty("ShippingInformationStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationCountryOrRegion = (string) content.GetValueForProperty("ShippingInformationCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DeliveryPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageCarrierName = (string) content.GetValueForProperty("ReturnPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageTrackingNumber = (string) content.GetValueForProperty("ReturnPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageDriveCount = (long) content.GetValueForProperty("ReturnPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ReturnPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageShipDate = (string) content.GetValueForProperty("ReturnPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageShipDate, global::System.Convert.ToString); - } - if (content.Contains("ExportBlobListBlobPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ExportBlobListBlobPath = (string) content.GetValueForProperty("ExportBlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ExportBlobListBlobPath, global::System.Convert.ToString); - } - if (content.Contains("BlobPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).BlobPath = (string[]) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EncryptionKeyKekType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKeyKekType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType?) content.GetValueForProperty("EncryptionKeyKekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKeyKekType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType.CreateFrom); - } - if (content.Contains("EncryptionKeyKekUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKeyKekUrl = (string) content.GetValueForProperty("EncryptionKeyKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKeyKekUrl, global::System.Convert.ToString); - } - if (content.Contains("EncryptionKeyKekVaultResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKeyKekVaultResourceId = (string) content.GetValueForProperty("EncryptionKeyKekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKeyKekVaultResourceId, global::System.Convert.ToString); - } - if (content.Contains("BlobListBlobPathPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).BlobListBlobPathPrefix = (string[]) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal JobResponse(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("SystemData")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.SystemDataTypeConverter.ConvertFrom); - } - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Identity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IdentityDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Type, global::System.Convert.ToString); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.AnyTypeConverter.ConvertFrom); - } - if (content.Contains("SystemDataCreatedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataCreatedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("ReturnAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddressTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnShipping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShippingTypeConverter.ConvertFrom); - } - if (content.Contains("ShippingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformation = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation) content.GetValueForProperty("ShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformation, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ShippingInformationTypeConverter.ConvertFrom); - } - if (content.Contains("Export")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Export = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport) content.GetValueForProperty("Export",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).Export, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportTypeConverter.ConvertFrom); - } - if (content.Contains("IdentityType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType?) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType.CreateFrom); - } - if (content.Contains("SystemDataCreatedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedBy")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); - } - if (content.Contains("SystemDataLastModifiedByType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType.CreateFrom); - } - if (content.Contains("SystemDataLastModifiedAt")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); - } - if (content.Contains("DeliveryPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation) content.GetValueForProperty("ReturnPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.EncryptionKeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("StorageAccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).StorageAccountId, global::System.Convert.ToString); - } - if (content.Contains("JobType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).JobType, global::System.Convert.ToString); - } - if (content.Contains("DiagnosticsPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DiagnosticsPath = (string) content.GetValueForProperty("DiagnosticsPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DiagnosticsPath, global::System.Convert.ToString); - } - if (content.Contains("LogLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).LogLevel, global::System.Convert.ToString); - } - if (content.Contains("BackupDriveManifest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("State")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).State, global::System.Convert.ToString); - } - if (content.Contains("CancelRequested")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("PercentComplete")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("IncompleteBlobListUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IncompleteBlobListUri = (string) content.GetValueForProperty("IncompleteBlobListUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IncompleteBlobListUri, global::System.Convert.ToString); - } - if (content.Contains("DriveList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DriveList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DriveList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressCity, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressPhone, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressEmail, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationRecipientName = (string) content.GetValueForProperty("ShippingInformationRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationStreetAddress1 = (string) content.GetValueForProperty("ShippingInformationStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationStreetAddress2 = (string) content.GetValueForProperty("ShippingInformationStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationCity = (string) content.GetValueForProperty("ShippingInformationCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationCity, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationPostalCode = (string) content.GetValueForProperty("ShippingInformationPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationPhone = (string) content.GetValueForProperty("ShippingInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationPhone, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationAdditionalInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationAdditionalInformation = (string) content.GetValueForProperty("ShippingInformationAdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationAdditionalInformation, global::System.Convert.ToString); - } - if (content.Contains("ExportBlobList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ExportBlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList) content.GetValueForProperty("ExportBlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ExportBlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportBlobListTypeConverter.ConvertFrom); - } - if (content.Contains("IdentityPrincipalId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IdentityPrincipalId, global::System.Convert.ToString); - } - if (content.Contains("IdentityTenantId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).IdentityTenantId, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierAccountNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationStateOrProvince = (string) content.GetValueForProperty("ShippingInformationStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationCountryOrRegion = (string) content.GetValueForProperty("ShippingInformationCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ShippingInformationCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DeliveryPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageCarrierName = (string) content.GetValueForProperty("ReturnPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageTrackingNumber = (string) content.GetValueForProperty("ReturnPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageDriveCount = (long) content.GetValueForProperty("ReturnPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ReturnPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageShipDate = (string) content.GetValueForProperty("ReturnPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ReturnPackageShipDate, global::System.Convert.ToString); - } - if (content.Contains("ExportBlobListBlobPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ExportBlobListBlobPath = (string) content.GetValueForProperty("ExportBlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).ExportBlobListBlobPath, global::System.Convert.ToString); - } - if (content.Contains("BlobPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).BlobPath = (string[]) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EncryptionKeyKekType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKeyKekType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType?) content.GetValueForProperty("EncryptionKeyKekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKeyKekType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType.CreateFrom); - } - if (content.Contains("EncryptionKeyKekUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKeyKekUrl = (string) content.GetValueForProperty("EncryptionKeyKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKeyKekUrl, global::System.Convert.ToString); - } - if (content.Contains("EncryptionKeyKekVaultResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKeyKekVaultResourceId = (string) content.GetValueForProperty("EncryptionKeyKekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).EncryptionKeyKekVaultResourceId, global::System.Convert.ToString); - } - if (content.Contains("BlobListBlobPathPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).BlobListBlobPathPrefix = (string[]) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Contains the job information. - [System.ComponentModel.TypeConverter(typeof(JobResponseTypeConverter))] - public partial interface IJobResponse - - { - - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationProperties.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationProperties.PowerShell.cs deleted file mode 100644 index 5f62468c93f4..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationProperties.PowerShell.cs +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; - - /// location properties - [System.ComponentModel.TypeConverter(typeof(LocationPropertiesTypeConverter))] - public partial class LocationProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new LocationProperties(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new LocationProperties(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal LocationProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("RecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).RecipientName, global::System.Convert.ToString); - } - if (content.Contains("StreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).StreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("StreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).StreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("City")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).City, global::System.Convert.ToString); - } - if (content.Contains("StateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).StateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("PostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).PostalCode, global::System.Convert.ToString); - } - if (content.Contains("CountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).CountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("Phone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).Phone, global::System.Convert.ToString); - } - if (content.Contains("AdditionalShippingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).AdditionalShippingInformation = (string) content.GetValueForProperty("AdditionalShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).AdditionalShippingInformation, global::System.Convert.ToString); - } - if (content.Contains("SupportedCarrier")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).SupportedCarrier = (string[]) content.GetValueForProperty("SupportedCarrier",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).SupportedCarrier, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AlternateLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).AlternateLocation = (string[]) content.GetValueForProperty("AlternateLocation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).AlternateLocation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal LocationProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("RecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).RecipientName, global::System.Convert.ToString); - } - if (content.Contains("StreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).StreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("StreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).StreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("City")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).City, global::System.Convert.ToString); - } - if (content.Contains("StateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).StateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("PostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).PostalCode, global::System.Convert.ToString); - } - if (content.Contains("CountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).CountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("Phone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).Phone, global::System.Convert.ToString); - } - if (content.Contains("AdditionalShippingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).AdditionalShippingInformation = (string) content.GetValueForProperty("AdditionalShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).AdditionalShippingInformation, global::System.Convert.ToString); - } - if (content.Contains("SupportedCarrier")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).SupportedCarrier = (string[]) content.GetValueForProperty("SupportedCarrier",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).SupportedCarrier, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("AlternateLocation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).AlternateLocation = (string[]) content.GetValueForProperty("AlternateLocation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)this).AlternateLocation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// location properties - [System.ComponentModel.TypeConverter(typeof(LocationPropertiesTypeConverter))] - public partial interface ILocationProperties - - { - - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParameters.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParameters.PowerShell.cs deleted file mode 100644 index 250dc9a66b15..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParameters.PowerShell.cs +++ /dev/null @@ -1,584 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; - - /// Put Job parameters - [System.ComponentModel.TypeConverter(typeof(PutJobParametersTypeConverter))] - public partial class PutJobParameters - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new PutJobParameters(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new PutJobParameters(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal PutJobParameters(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PutJobParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddressTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnShipping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShippingTypeConverter.ConvertFrom); - } - if (content.Contains("ShippingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformation = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation) content.GetValueForProperty("ShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformation, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ShippingInformationTypeConverter.ConvertFrom); - } - if (content.Contains("Export")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Export = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport) content.GetValueForProperty("Export",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Export, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportTypeConverter.ConvertFrom); - } - if (content.Contains("DeliveryPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation) content.GetValueForProperty("ReturnPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.EncryptionKeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("StorageAccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).StorageAccountId, global::System.Convert.ToString); - } - if (content.Contains("JobType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).JobType, global::System.Convert.ToString); - } - if (content.Contains("DiagnosticsPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DiagnosticsPath = (string) content.GetValueForProperty("DiagnosticsPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DiagnosticsPath, global::System.Convert.ToString); - } - if (content.Contains("LogLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).LogLevel, global::System.Convert.ToString); - } - if (content.Contains("BackupDriveManifest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("State")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).State, global::System.Convert.ToString); - } - if (content.Contains("CancelRequested")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("PercentComplete")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("IncompleteBlobListUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).IncompleteBlobListUri = (string) content.GetValueForProperty("IncompleteBlobListUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).IncompleteBlobListUri, global::System.Convert.ToString); - } - if (content.Contains("DriveList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DriveList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DriveList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressCity, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressPhone, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressEmail, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationRecipientName = (string) content.GetValueForProperty("ShippingInformationRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationStreetAddress1 = (string) content.GetValueForProperty("ShippingInformationStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationStreetAddress2 = (string) content.GetValueForProperty("ShippingInformationStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationCity = (string) content.GetValueForProperty("ShippingInformationCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationCity, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationPostalCode = (string) content.GetValueForProperty("ShippingInformationPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationPhone = (string) content.GetValueForProperty("ShippingInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationPhone, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationAdditionalInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationAdditionalInformation = (string) content.GetValueForProperty("ShippingInformationAdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationAdditionalInformation, global::System.Convert.ToString); - } - if (content.Contains("ExportBlobList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ExportBlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList) content.GetValueForProperty("ExportBlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ExportBlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportBlobListTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnAddressStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierAccountNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationStateOrProvince = (string) content.GetValueForProperty("ShippingInformationStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationCountryOrRegion = (string) content.GetValueForProperty("ShippingInformationCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DeliveryPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageCarrierName = (string) content.GetValueForProperty("ReturnPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageTrackingNumber = (string) content.GetValueForProperty("ReturnPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageDriveCount = (long) content.GetValueForProperty("ReturnPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ReturnPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageShipDate = (string) content.GetValueForProperty("ReturnPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageShipDate, global::System.Convert.ToString); - } - if (content.Contains("ExportBlobListBlobPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ExportBlobListBlobPath = (string) content.GetValueForProperty("ExportBlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ExportBlobListBlobPath, global::System.Convert.ToString); - } - if (content.Contains("BlobPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).BlobPath = (string[]) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EncryptionKeyKekType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKeyKekType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType?) content.GetValueForProperty("EncryptionKeyKekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKeyKekType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType.CreateFrom); - } - if (content.Contains("EncryptionKeyKekUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKeyKekUrl = (string) content.GetValueForProperty("EncryptionKeyKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKeyKekUrl, global::System.Convert.ToString); - } - if (content.Contains("EncryptionKeyKekVaultResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKeyKekVaultResourceId = (string) content.GetValueForProperty("EncryptionKeyKekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKeyKekVaultResourceId, global::System.Convert.ToString); - } - if (content.Contains("BlobListBlobPathPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).BlobListBlobPathPrefix = (string[]) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal PutJobParameters(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("Location")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Location, global::System.Convert.ToString); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PutJobParametersTagsTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddressTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnShipping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShippingTypeConverter.ConvertFrom); - } - if (content.Contains("ShippingInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformation = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation) content.GetValueForProperty("ShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformation, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ShippingInformationTypeConverter.ConvertFrom); - } - if (content.Contains("Export")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Export = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport) content.GetValueForProperty("Export",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).Export, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportTypeConverter.ConvertFrom); - } - if (content.Contains("DeliveryPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation) content.GetValueForProperty("ReturnPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("EncryptionKey")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.EncryptionKeyDetailsTypeConverter.ConvertFrom); - } - if (content.Contains("StorageAccountId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).StorageAccountId, global::System.Convert.ToString); - } - if (content.Contains("JobType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).JobType, global::System.Convert.ToString); - } - if (content.Contains("DiagnosticsPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DiagnosticsPath = (string) content.GetValueForProperty("DiagnosticsPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DiagnosticsPath, global::System.Convert.ToString); - } - if (content.Contains("LogLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).LogLevel, global::System.Convert.ToString); - } - if (content.Contains("BackupDriveManifest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("State")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).State, global::System.Convert.ToString); - } - if (content.Contains("CancelRequested")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("PercentComplete")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("IncompleteBlobListUri")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).IncompleteBlobListUri = (string) content.GetValueForProperty("IncompleteBlobListUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).IncompleteBlobListUri, global::System.Convert.ToString); - } - if (content.Contains("DriveList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DriveList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DriveList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("ProvisioningState")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ProvisioningState, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressCity, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressPhone, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressEmail, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationRecipientName = (string) content.GetValueForProperty("ShippingInformationRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationStreetAddress1 = (string) content.GetValueForProperty("ShippingInformationStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationStreetAddress2 = (string) content.GetValueForProperty("ShippingInformationStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationCity = (string) content.GetValueForProperty("ShippingInformationCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationCity, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationPostalCode = (string) content.GetValueForProperty("ShippingInformationPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationPhone = (string) content.GetValueForProperty("ShippingInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationPhone, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationAdditionalInformation")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationAdditionalInformation = (string) content.GetValueForProperty("ShippingInformationAdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationAdditionalInformation, global::System.Convert.ToString); - } - if (content.Contains("ExportBlobList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ExportBlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList) content.GetValueForProperty("ExportBlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ExportBlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportBlobListTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnAddressStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierAccountNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationStateOrProvince = (string) content.GetValueForProperty("ShippingInformationStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ShippingInformationCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationCountryOrRegion = (string) content.GetValueForProperty("ShippingInformationCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ShippingInformationCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DeliveryPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageCarrierName = (string) content.GetValueForProperty("ReturnPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageTrackingNumber = (string) content.GetValueForProperty("ReturnPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("ReturnPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageDriveCount = (long) content.GetValueForProperty("ReturnPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("ReturnPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageShipDate = (string) content.GetValueForProperty("ReturnPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ReturnPackageShipDate, global::System.Convert.ToString); - } - if (content.Contains("ExportBlobListBlobPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ExportBlobListBlobPath = (string) content.GetValueForProperty("ExportBlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).ExportBlobListBlobPath, global::System.Convert.ToString); - } - if (content.Contains("BlobPath")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).BlobPath = (string[]) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - if (content.Contains("EncryptionKeyKekType")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKeyKekType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType?) content.GetValueForProperty("EncryptionKeyKekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKeyKekType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType.CreateFrom); - } - if (content.Contains("EncryptionKeyKekUrl")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKeyKekUrl = (string) content.GetValueForProperty("EncryptionKeyKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKeyKekUrl, global::System.Convert.ToString); - } - if (content.Contains("EncryptionKeyKekVaultResourceId")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKeyKekVaultResourceId = (string) content.GetValueForProperty("EncryptionKeyKekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).EncryptionKeyKekVaultResourceId, global::System.Convert.ToString); - } - if (content.Contains("BlobListBlobPathPrefix")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).BlobListBlobPathPrefix = (string[]) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); - } - AfterDeserializePSObject(content); - } - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); - } - /// Put Job parameters - [System.ComponentModel.TypeConverter(typeof(PutJobParametersTypeConverter))] - public partial interface IPutJobParameters - - { - - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersProperties.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersProperties.PowerShell.cs deleted file mode 100644 index ec1da496bbd5..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersProperties.PowerShell.cs +++ /dev/null @@ -1,322 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 -{ - using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; - - /// Specifies the properties of a UpdateJob. - [System.ComponentModel.TypeConverter(typeof(UpdateJobParametersPropertiesTypeConverter))] - public partial class UpdateJobParametersProperties - { - - /// - /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the - /// object before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Collections.IDictionary content that should be used. - - partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); - - /// - /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object - /// before it is returned. Implement this method in a partial class to enable this behavior - /// - /// The global::System.Management.Automation.PSObject content that should be used. - - partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); - - /// - /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Collections.IDictionary content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); - - /// - /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization - /// of the object before it is deserialized. - /// If you wish to disable the default deserialization entirely, return true in the output - /// parameter. - /// Implement this method in a partial class to enable this behavior. - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// Determines if the rest of the serialization should be processed, or if the method should return - /// instantly. - - partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) - { - return new UpdateJobParametersProperties(content); - } - - /// - /// Deserializes a into an instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - /// - /// an instance of . - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) - { - return new UpdateJobParametersProperties(content); - } - - /// - /// Creates a new instance of , deserializing the content from a json string. - /// - /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); - - /// Serializes this instance to a json string. - - /// a containing this model serialized to JSON text. - public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Collections.IDictionary content that should be used. - internal UpdateJobParametersProperties(global::System.Collections.IDictionary content) - { - bool returnNow = false; - BeforeDeserializeDictionary(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ReturnAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddressTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnShipping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShippingTypeConverter.ConvertFrom); - } - if (content.Contains("DeliveryPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("CancelRequested")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("State")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).State, global::System.Convert.ToString); - } - if (content.Contains("LogLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).LogLevel, global::System.Convert.ToString); - } - if (content.Contains("BackupDriveManifest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("DriveList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DriveList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DriveList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("ReturnAddressRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCity, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPhone, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressEmail, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierAccountNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DeliveryPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); - } - AfterDeserializeDictionary(content); - } - - /// - /// Deserializes a into a new instance of . - /// - /// The global::System.Management.Automation.PSObject content that should be used. - internal UpdateJobParametersProperties(global::System.Management.Automation.PSObject content) - { - bool returnNow = false; - BeforeDeserializePSObject(content, ref returnNow); - if (returnNow) - { - return; - } - // actually deserialize - if (content.Contains("ReturnAddress")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddressTypeConverter.ConvertFrom); - } - if (content.Contains("ReturnShipping")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShippingTypeConverter.ConvertFrom); - } - if (content.Contains("DeliveryPackage")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformationTypeConverter.ConvertFrom); - } - if (content.Contains("CancelRequested")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("State")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).State, global::System.Convert.ToString); - } - if (content.Contains("LogLevel")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).LogLevel, global::System.Convert.ToString); - } - if (content.Contains("BackupDriveManifest")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); - } - if (content.Contains("DriveList")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DriveList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DriveList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatusTypeConverter.ConvertFrom)); - } - if (content.Contains("ReturnAddressRecipientName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress1")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStreetAddress2")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCity")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCity, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPostalCode")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressPhone")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPhone, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressEmail")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressEmail, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressStateOrProvince")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); - } - if (content.Contains("ReturnAddressCountryOrRegion")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); - } - if (content.Contains("ReturnShippingCarrierAccountNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageCarrierName")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageTrackingNumber")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); - } - if (content.Contains("DeliveryPackageDriveCount")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); - } - if (content.Contains("DeliveryPackageShipDate")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); - } - AfterDeserializePSObject(content); - } - } - /// Specifies the properties of a UpdateJob. - [System.ComponentModel.TypeConverter(typeof(UpdateJobParametersPropertiesTypeConverter))] - public partial interface IUpdateJobParametersProperties - - { - - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DeliveryPackageInformation.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DeliveryPackageInformation.PowerShell.cs similarity index 68% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DeliveryPackageInformation.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/DeliveryPackageInformation.PowerShell.cs index 23ecc67534bc..92970c0e8115 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DeliveryPackageInformation.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DeliveryPackageInformation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -57,7 +57,15 @@ public partial class DeliveryPackageInformation partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into a new instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -72,25 +80,25 @@ internal DeliveryPackageInformation(global::System.Collections.IDictionary conte // actually deserialize if (content.Contains("CarrierName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).CarrierName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).CarrierName, global::System.Convert.ToString); } if (content.Contains("TrackingNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).TrackingNumber = (string) content.GetValueForProperty("TrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).TrackingNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).TrackingNumber = (string) content.GetValueForProperty("TrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).TrackingNumber, global::System.Convert.ToString); } if (content.Contains("DriveCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).DriveCount = (long?) content.GetValueForProperty("DriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).DriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).DriveCount = (long?) content.GetValueForProperty("DriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).DriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("ShipDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).ShipDate = (string) content.GetValueForProperty("ShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).ShipDate, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).ShipDate = (string) content.GetValueForProperty("ShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).ShipDate, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -105,47 +113,45 @@ internal DeliveryPackageInformation(global::System.Management.Automation.PSObjec // actually deserialize if (content.Contains("CarrierName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).CarrierName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).CarrierName, global::System.Convert.ToString); } if (content.Contains("TrackingNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).TrackingNumber = (string) content.GetValueForProperty("TrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).TrackingNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).TrackingNumber = (string) content.GetValueForProperty("TrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).TrackingNumber, global::System.Convert.ToString); } if (content.Contains("DriveCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).DriveCount = (long?) content.GetValueForProperty("DriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).DriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).DriveCount = (long?) content.GetValueForProperty("DriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).DriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("ShipDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).ShipDate = (string) content.GetValueForProperty("ShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)this).ShipDate, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).ShipDate = (string) content.GetValueForProperty("ShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)this).ShipDate, global::System.Convert.ToString); } AfterDeserializePSObject(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DeliveryPackageInformation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DeliveryPackageInformation(content); } @@ -155,12 +161,24 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Contains information about the delivery package being shipped by the customer to the Microsoft data center. [System.ComponentModel.TypeConverter(typeof(DeliveryPackageInformationTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DeliveryPackageInformation.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DeliveryPackageInformation.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DeliveryPackageInformation.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/DeliveryPackageInformation.TypeConverter.cs index 43d43fc8b6f6..9842cd2e1e87 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DeliveryPackageInformation.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DeliveryPackageInformation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DeliveryPackageInformation.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DeliveryPackageInformation.cs similarity index 91% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DeliveryPackageInformation.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/DeliveryPackageInformation.cs index a1d38f501a44..33573504c760 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DeliveryPackageInformation.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DeliveryPackageInformation.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 /// Contains information about the delivery package being shipped by the customer to the Microsoft data center. /// public partial class DeliveryPackageInformation : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal { /// Backing field for property. @@ -57,6 +57,9 @@ public partial interface IDeliveryPackageInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the carrier that is used to ship the import or export drives.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -65,6 +68,9 @@ public partial interface IDeliveryPackageInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of drives included in the package.", SerializedName = @"driveCount", PossibleTypes = new [] { typeof(long) })] @@ -73,6 +79,9 @@ public partial interface IDeliveryPackageInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The date when the package is shipped.", SerializedName = @"shipDate", PossibleTypes = new [] { typeof(string) })] @@ -81,6 +90,9 @@ public partial interface IDeliveryPackageInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tracking number of the package.", SerializedName = @"trackingNumber", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DeliveryPackageInformation.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DeliveryPackageInformation.json.cs similarity index 94% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DeliveryPackageInformation.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/DeliveryPackageInformation.json.cs index 61afad0d00f7..b2060dd3c3cd 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DeliveryPackageInformation.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DeliveryPackageInformation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -67,21 +67,21 @@ internal DeliveryPackageInformation(Microsoft.Azure.PowerShell.Cmdlets.ImportExp { return; } - {_carrierName = If( json?.PropertyT("carrierName"), out var __jsonCarrierName) ? (string)__jsonCarrierName : (string)CarrierName;} - {_trackingNumber = If( json?.PropertyT("trackingNumber"), out var __jsonTrackingNumber) ? (string)__jsonTrackingNumber : (string)TrackingNumber;} - {_driveCount = If( json?.PropertyT("driveCount"), out var __jsonDriveCount) ? (long?)__jsonDriveCount : DriveCount;} - {_shipDate = If( json?.PropertyT("shipDate"), out var __jsonShipDate) ? (string)__jsonShipDate : (string)ShipDate;} + {_carrierName = If( json?.PropertyT("carrierName"), out var __jsonCarrierName) ? (string)__jsonCarrierName : (string)_carrierName;} + {_trackingNumber = If( json?.PropertyT("trackingNumber"), out var __jsonTrackingNumber) ? (string)__jsonTrackingNumber : (string)_trackingNumber;} + {_driveCount = If( json?.PropertyT("driveCount"), out var __jsonDriveCount) ? (long?)__jsonDriveCount : _driveCount;} + {_shipDate = If( json?.PropertyT("shipDate"), out var __jsonShipDate) ? (string)__jsonShipDate : (string)_shipDate;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new DeliveryPackageInformation(json) : null; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveBitLockerKey.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveBitLockerKey.PowerShell.cs similarity index 74% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveBitLockerKey.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveBitLockerKey.PowerShell.cs index c103903bd715..774fe67e0ce8 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveBitLockerKey.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveBitLockerKey.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class DriveBitLockerKey partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DriveBitLockerKey(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DriveBitLockerKey(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,17 +104,17 @@ internal DriveBitLockerKey(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("BitLockerKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKeyInternal)this).BitLockerKey = (string) content.GetValueForProperty("BitLockerKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKeyInternal)this).BitLockerKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKeyInternal)this).BitLockerKey = (string) content.GetValueForProperty("BitLockerKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKeyInternal)this).BitLockerKey, global::System.Convert.ToString); } if (content.Contains("DriveId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKeyInternal)this).DriveId = (string) content.GetValueForProperty("DriveId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKeyInternal)this).DriveId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKeyInternal)this).DriveId = (string) content.GetValueForProperty("DriveId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKeyInternal)this).DriveId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -121,11 +129,11 @@ internal DriveBitLockerKey(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("BitLockerKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKeyInternal)this).BitLockerKey = (string) content.GetValueForProperty("BitLockerKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKeyInternal)this).BitLockerKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKeyInternal)this).BitLockerKey = (string) content.GetValueForProperty("BitLockerKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKeyInternal)this).BitLockerKey, global::System.Convert.ToString); } if (content.Contains("DriveId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKeyInternal)this).DriveId = (string) content.GetValueForProperty("DriveId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKeyInternal)this).DriveId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKeyInternal)this).DriveId = (string) content.GetValueForProperty("DriveId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKeyInternal)this).DriveId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -135,12 +143,24 @@ internal DriveBitLockerKey(global::System.Management.Automation.PSObject content /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// BitLocker recovery key or password to the specified drive [System.ComponentModel.TypeConverter(typeof(DriveBitLockerKeyTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveBitLockerKey.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveBitLockerKey.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveBitLockerKey.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveBitLockerKey.TypeConverter.cs index 4025fdf0005d..541fb56a7a6b 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveBitLockerKey.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveBitLockerKey.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveBitLockerKey.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveBitLockerKey.cs similarity index 90% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveBitLockerKey.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveBitLockerKey.cs index 82857bd8eaa7..5365a126e64a 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveBitLockerKey.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveBitLockerKey.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// BitLocker recovery key or password to the specified drive public partial class DriveBitLockerKey : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKeyInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKeyInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IDriveBitLockerKey : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"BitLocker recovery key or password", SerializedName = @"bitLockerKey", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface IDriveBitLockerKey : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Drive ID", SerializedName = @"driveId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveBitLockerKey.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveBitLockerKey.json.cs similarity index 95% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveBitLockerKey.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveBitLockerKey.json.cs index efc041119de4..e928e7f9edc7 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveBitLockerKey.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveBitLockerKey.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -65,19 +65,19 @@ internal DriveBitLockerKey(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runti { return; } - {_bitLockerKey = If( json?.PropertyT("bitLockerKey"), out var __jsonBitLockerKey) ? (string)__jsonBitLockerKey : (string)BitLockerKey;} - {_driveId = If( json?.PropertyT("driveId"), out var __jsonDriveId) ? (string)__jsonDriveId : (string)DriveId;} + {_bitLockerKey = If( json?.PropertyT("bitLockerKey"), out var __jsonBitLockerKey) ? (string)__jsonBitLockerKey : (string)_bitLockerKey;} + {_driveId = If( json?.PropertyT("driveId"), out var __jsonDriveId) ? (string)__jsonDriveId : (string)_driveId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new DriveBitLockerKey(json) : null; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveStatus.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveStatus.PowerShell.cs similarity index 58% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveStatus.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveStatus.PowerShell.cs index d5049bd945c2..d82ba7205941 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveStatus.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveStatus.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class DriveStatus partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new DriveStatus(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new DriveStatus(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,57 +104,57 @@ internal DriveStatus(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("DriveId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).DriveId = (string) content.GetValueForProperty("DriveId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).DriveId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).DriveId = (string) content.GetValueForProperty("DriveId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).DriveId, global::System.Convert.ToString); } if (content.Contains("BitLockerKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).BitLockerKey = (string) content.GetValueForProperty("BitLockerKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).BitLockerKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).BitLockerKey = (string) content.GetValueForProperty("BitLockerKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).BitLockerKey, global::System.Convert.ToString); } if (content.Contains("ManifestFile")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ManifestFile = (string) content.GetValueForProperty("ManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ManifestFile, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ManifestFile = (string) content.GetValueForProperty("ManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ManifestFile, global::System.Convert.ToString); } if (content.Contains("ManifestHash")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ManifestHash = (string) content.GetValueForProperty("ManifestHash",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ManifestHash, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ManifestHash = (string) content.GetValueForProperty("ManifestHash",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ManifestHash, global::System.Convert.ToString); } if (content.Contains("DriveHeaderHash")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).DriveHeaderHash = (string) content.GetValueForProperty("DriveHeaderHash",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).DriveHeaderHash, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).DriveHeaderHash = (string) content.GetValueForProperty("DriveHeaderHash",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).DriveHeaderHash, global::System.Convert.ToString); } if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).State, global::System.Convert.ToString); } if (content.Contains("CopyStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).CopyStatus = (string) content.GetValueForProperty("CopyStatus",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).CopyStatus, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).CopyStatus = (string) content.GetValueForProperty("CopyStatus",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).CopyStatus, global::System.Convert.ToString); } if (content.Contains("PercentComplete")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("VerboseLogUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).VerboseLogUri = (string) content.GetValueForProperty("VerboseLogUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).VerboseLogUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).VerboseLogUri = (string) content.GetValueForProperty("VerboseLogUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).VerboseLogUri, global::System.Convert.ToString); } if (content.Contains("ErrorLogUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ErrorLogUri = (string) content.GetValueForProperty("ErrorLogUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ErrorLogUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ErrorLogUri = (string) content.GetValueForProperty("ErrorLogUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ErrorLogUri, global::System.Convert.ToString); } if (content.Contains("ManifestUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ManifestUri = (string) content.GetValueForProperty("ManifestUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ManifestUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ManifestUri = (string) content.GetValueForProperty("ManifestUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ManifestUri, global::System.Convert.ToString); } if (content.Contains("BytesSucceeded")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).BytesSucceeded = (long?) content.GetValueForProperty("BytesSucceeded",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).BytesSucceeded, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).BytesSucceeded = (long?) content.GetValueForProperty("BytesSucceeded",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).BytesSucceeded, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -161,51 +169,51 @@ internal DriveStatus(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("DriveId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).DriveId = (string) content.GetValueForProperty("DriveId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).DriveId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).DriveId = (string) content.GetValueForProperty("DriveId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).DriveId, global::System.Convert.ToString); } if (content.Contains("BitLockerKey")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).BitLockerKey = (string) content.GetValueForProperty("BitLockerKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).BitLockerKey, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).BitLockerKey = (string) content.GetValueForProperty("BitLockerKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).BitLockerKey, global::System.Convert.ToString); } if (content.Contains("ManifestFile")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ManifestFile = (string) content.GetValueForProperty("ManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ManifestFile, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ManifestFile = (string) content.GetValueForProperty("ManifestFile",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ManifestFile, global::System.Convert.ToString); } if (content.Contains("ManifestHash")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ManifestHash = (string) content.GetValueForProperty("ManifestHash",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ManifestHash, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ManifestHash = (string) content.GetValueForProperty("ManifestHash",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ManifestHash, global::System.Convert.ToString); } if (content.Contains("DriveHeaderHash")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).DriveHeaderHash = (string) content.GetValueForProperty("DriveHeaderHash",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).DriveHeaderHash, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).DriveHeaderHash = (string) content.GetValueForProperty("DriveHeaderHash",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).DriveHeaderHash, global::System.Convert.ToString); } if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).State, global::System.Convert.ToString); } if (content.Contains("CopyStatus")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).CopyStatus = (string) content.GetValueForProperty("CopyStatus",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).CopyStatus, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).CopyStatus = (string) content.GetValueForProperty("CopyStatus",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).CopyStatus, global::System.Convert.ToString); } if (content.Contains("PercentComplete")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("VerboseLogUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).VerboseLogUri = (string) content.GetValueForProperty("VerboseLogUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).VerboseLogUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).VerboseLogUri = (string) content.GetValueForProperty("VerboseLogUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).VerboseLogUri, global::System.Convert.ToString); } if (content.Contains("ErrorLogUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ErrorLogUri = (string) content.GetValueForProperty("ErrorLogUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ErrorLogUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ErrorLogUri = (string) content.GetValueForProperty("ErrorLogUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ErrorLogUri, global::System.Convert.ToString); } if (content.Contains("ManifestUri")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ManifestUri = (string) content.GetValueForProperty("ManifestUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).ManifestUri, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ManifestUri = (string) content.GetValueForProperty("ManifestUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).ManifestUri, global::System.Convert.ToString); } if (content.Contains("BytesSucceeded")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).BytesSucceeded = (long?) content.GetValueForProperty("BytesSucceeded",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal)this).BytesSucceeded, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).BytesSucceeded = (long?) content.GetValueForProperty("BytesSucceeded",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal)this).BytesSucceeded, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } AfterDeserializePSObject(content); } @@ -215,12 +223,24 @@ internal DriveStatus(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Provides information about the drive's status [System.ComponentModel.TypeConverter(typeof(DriveStatusTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveStatus.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveStatus.TypeConverter.cs similarity index 98% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveStatus.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveStatus.TypeConverter.cs index 56753fdd1f26..d372a3d66f30 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveStatus.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveStatus.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveStatus.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveStatus.cs similarity index 89% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveStatus.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveStatus.cs index d1ad7b1a98b2..08098ada76a3 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveStatus.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveStatus.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Provides information about the drive's status public partial class DriveStatus : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatusInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatusInternal { /// Backing field for property. @@ -89,11 +89,11 @@ public partial class DriveStatus : public long? PercentComplete { get => this._percentComplete; set => this._percentComplete = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState? _state; + private string _state; /// The drive's current state. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState? State { get => this._state; set => this._state = value; } + public string State { get => this._state; set => this._state = value; } /// Backing field for property. private string _verboseLogUri; @@ -118,6 +118,9 @@ public partial interface IDriveStatus : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The BitLocker key used to encrypt the drive.", SerializedName = @"bitLockerKey", PossibleTypes = new [] { typeof(string) })] @@ -126,6 +129,9 @@ public partial interface IDriveStatus : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Bytes successfully transferred for the drive.", SerializedName = @"bytesSucceeded", PossibleTypes = new [] { typeof(long) })] @@ -137,6 +143,9 @@ public partial interface IDriveStatus : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Detailed status about the data transfer process. This field is not returned in the response until the drive is in the Transferring state.", SerializedName = @"copyStatus", PossibleTypes = new [] { typeof(string) })] @@ -145,6 +154,9 @@ public partial interface IDriveStatus : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The drive header hash value.", SerializedName = @"driveHeaderHash", PossibleTypes = new [] { typeof(string) })] @@ -153,6 +165,9 @@ public partial interface IDriveStatus : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The drive's hardware serial number, without spaces.", SerializedName = @"driveId", PossibleTypes = new [] { typeof(string) })] @@ -163,6 +178,9 @@ public partial interface IDriveStatus : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A URI that points to the blob containing the error log for the data transfer operation.", SerializedName = @"errorLogUri", PossibleTypes = new [] { typeof(string) })] @@ -171,6 +189,9 @@ public partial interface IDriveStatus : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The relative path of the manifest file on the drive. ", SerializedName = @"manifestFile", PossibleTypes = new [] { typeof(string) })] @@ -179,6 +200,9 @@ public partial interface IDriveStatus : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The Base16-encoded MD5 hash of the manifest file on the drive.", SerializedName = @"manifestHash", PossibleTypes = new [] { typeof(string) })] @@ -187,6 +211,9 @@ public partial interface IDriveStatus : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A URI that points to the blob containing the drive manifest file. ", SerializedName = @"manifestUri", PossibleTypes = new [] { typeof(string) })] @@ -195,6 +222,9 @@ public partial interface IDriveStatus : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Percentage completed for the drive. ", SerializedName = @"percentComplete", PossibleTypes = new [] { typeof(long) })] @@ -203,16 +233,23 @@ public partial interface IDriveStatus : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The drive's current state. ", SerializedName = @"state", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState? State { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("Specified", "Received", "NeverReceived", "Transferring", "Completed", "CompletedMoreInfo", "ShippedBack")] + string State { get; set; } /// /// A URI that points to the blob containing the verbose log for the data transfer operation. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A URI that points to the blob containing the verbose log for the data transfer operation. ", SerializedName = @"verboseLogUri", PossibleTypes = new [] { typeof(string) })] @@ -249,7 +286,8 @@ internal partial interface IDriveStatusInternal /// Percentage completed for the drive. long? PercentComplete { get; set; } /// The drive's current state. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState? State { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("Specified", "Received", "NeverReceived", "Transferring", "Completed", "CompletedMoreInfo", "ShippedBack")] + string State { get; set; } /// /// A URI that points to the blob containing the verbose log for the data transfer operation. /// diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveStatus.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveStatus.json.cs similarity index 94% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveStatus.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveStatus.json.cs index 1ab7df76c794..88e9828be87b 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/DriveStatus.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/DriveStatus.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -65,29 +65,29 @@ internal DriveStatus(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Jso { return; } - {_driveId = If( json?.PropertyT("driveId"), out var __jsonDriveId) ? (string)__jsonDriveId : (string)DriveId;} - {_bitLockerKey = If( json?.PropertyT("bitLockerKey"), out var __jsonBitLockerKey) ? (string)__jsonBitLockerKey : (string)BitLockerKey;} - {_manifestFile = If( json?.PropertyT("manifestFile"), out var __jsonManifestFile) ? (string)__jsonManifestFile : (string)ManifestFile;} - {_manifestHash = If( json?.PropertyT("manifestHash"), out var __jsonManifestHash) ? (string)__jsonManifestHash : (string)ManifestHash;} - {_driveHeaderHash = If( json?.PropertyT("driveHeaderHash"), out var __jsonDriveHeaderHash) ? (string)__jsonDriveHeaderHash : (string)DriveHeaderHash;} - {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} - {_copyStatus = If( json?.PropertyT("copyStatus"), out var __jsonCopyStatus) ? (string)__jsonCopyStatus : (string)CopyStatus;} - {_percentComplete = If( json?.PropertyT("percentComplete"), out var __jsonPercentComplete) ? (long?)__jsonPercentComplete : PercentComplete;} - {_verboseLogUri = If( json?.PropertyT("verboseLogUri"), out var __jsonVerboseLogUri) ? (string)__jsonVerboseLogUri : (string)VerboseLogUri;} - {_errorLogUri = If( json?.PropertyT("errorLogUri"), out var __jsonErrorLogUri) ? (string)__jsonErrorLogUri : (string)ErrorLogUri;} - {_manifestUri = If( json?.PropertyT("manifestUri"), out var __jsonManifestUri) ? (string)__jsonManifestUri : (string)ManifestUri;} - {_bytesSucceeded = If( json?.PropertyT("bytesSucceeded"), out var __jsonBytesSucceeded) ? (long?)__jsonBytesSucceeded : BytesSucceeded;} + {_driveId = If( json?.PropertyT("driveId"), out var __jsonDriveId) ? (string)__jsonDriveId : (string)_driveId;} + {_bitLockerKey = If( json?.PropertyT("bitLockerKey"), out var __jsonBitLockerKey) ? (string)__jsonBitLockerKey : (string)_bitLockerKey;} + {_manifestFile = If( json?.PropertyT("manifestFile"), out var __jsonManifestFile) ? (string)__jsonManifestFile : (string)_manifestFile;} + {_manifestHash = If( json?.PropertyT("manifestHash"), out var __jsonManifestHash) ? (string)__jsonManifestHash : (string)_manifestHash;} + {_driveHeaderHash = If( json?.PropertyT("driveHeaderHash"), out var __jsonDriveHeaderHash) ? (string)__jsonDriveHeaderHash : (string)_driveHeaderHash;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)_state;} + {_copyStatus = If( json?.PropertyT("copyStatus"), out var __jsonCopyStatus) ? (string)__jsonCopyStatus : (string)_copyStatus;} + {_percentComplete = If( json?.PropertyT("percentComplete"), out var __jsonPercentComplete) ? (long?)__jsonPercentComplete : _percentComplete;} + {_verboseLogUri = If( json?.PropertyT("verboseLogUri"), out var __jsonVerboseLogUri) ? (string)__jsonVerboseLogUri : (string)_verboseLogUri;} + {_errorLogUri = If( json?.PropertyT("errorLogUri"), out var __jsonErrorLogUri) ? (string)__jsonErrorLogUri : (string)_errorLogUri;} + {_manifestUri = If( json?.PropertyT("manifestUri"), out var __jsonManifestUri) ? (string)__jsonManifestUri : (string)_manifestUri;} + {_bytesSucceeded = If( json?.PropertyT("bytesSucceeded"), out var __jsonBytesSucceeded) ? (long?)__jsonBytesSucceeded : _bytesSucceeded;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new DriveStatus(json) : null; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/EncryptionKeyDetails.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/EncryptionKeyDetails.PowerShell.cs similarity index 71% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/EncryptionKeyDetails.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/EncryptionKeyDetails.PowerShell.cs index 1beeedb8d4b6..77e628d54f80 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/EncryptionKeyDetails.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/EncryptionKeyDetails.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class EncryptionKeyDetails partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new EncryptionKeyDetails(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new EncryptionKeyDetails(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,21 +104,21 @@ internal EncryptionKeyDetails(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("KekType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)this).KekType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType?) content.GetValueForProperty("KekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)this).KekType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)this).KekType = (string) content.GetValueForProperty("KekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)this).KekType, global::System.Convert.ToString); } if (content.Contains("KekUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)this).KekUrl = (string) content.GetValueForProperty("KekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)this).KekUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)this).KekUrl = (string) content.GetValueForProperty("KekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)this).KekUrl, global::System.Convert.ToString); } if (content.Contains("KekVaultResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)this).KekVaultResourceId = (string) content.GetValueForProperty("KekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)this).KekVaultResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)this).KekVaultResourceId = (string) content.GetValueForProperty("KekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)this).KekVaultResourceId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -125,15 +133,15 @@ internal EncryptionKeyDetails(global::System.Management.Automation.PSObject cont // actually deserialize if (content.Contains("KekType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)this).KekType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType?) content.GetValueForProperty("KekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)this).KekType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)this).KekType = (string) content.GetValueForProperty("KekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)this).KekType, global::System.Convert.ToString); } if (content.Contains("KekUrl")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)this).KekUrl = (string) content.GetValueForProperty("KekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)this).KekUrl, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)this).KekUrl = (string) content.GetValueForProperty("KekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)this).KekUrl, global::System.Convert.ToString); } if (content.Contains("KekVaultResourceId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)this).KekVaultResourceId = (string) content.GetValueForProperty("KekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)this).KekVaultResourceId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)this).KekVaultResourceId = (string) content.GetValueForProperty("KekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)this).KekVaultResourceId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -143,12 +151,24 @@ internal EncryptionKeyDetails(global::System.Management.Automation.PSObject cont /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Specifies the encryption key properties [System.ComponentModel.TypeConverter(typeof(EncryptionKeyDetailsTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/EncryptionKeyDetails.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/EncryptionKeyDetails.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/EncryptionKeyDetails.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/EncryptionKeyDetails.TypeConverter.cs index feb1b13a0887..1f8b61740c2e 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/EncryptionKeyDetails.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/EncryptionKeyDetails.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/EncryptionKeyDetails.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/EncryptionKeyDetails.cs similarity index 80% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/EncryptionKeyDetails.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/EncryptionKeyDetails.cs index 73a6a8ff3f67..b2907ceda18a 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/EncryptionKeyDetails.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/EncryptionKeyDetails.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Specifies the encryption key properties public partial class EncryptionKeyDetails : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType? _kekType; + private string _kekType; /// The type of kek encryption key [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType? KekType { get => this._kekType; set => this._kekType = value; } + public string KekType { get => this._kekType; set => this._kekType = value; } /// Backing field for property. private string _kekUrl; @@ -48,14 +48,21 @@ public partial interface IEncryptionKeyDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of kek encryption key", SerializedName = @"kekType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType? KekType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("MicrosoftManaged", "CustomerManaged")] + string KekType { get; set; } /// Specifies the url for kek encryption key. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the url for kek encryption key. ", SerializedName = @"kekUrl", PossibleTypes = new [] { typeof(string) })] @@ -64,6 +71,9 @@ public partial interface IEncryptionKeyDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the keyvault resource id for kek encryption key. ", SerializedName = @"kekVaultResourceID", PossibleTypes = new [] { typeof(string) })] @@ -75,7 +85,8 @@ internal partial interface IEncryptionKeyDetailsInternal { /// The type of kek encryption key - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType? KekType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("MicrosoftManaged", "CustomerManaged")] + string KekType { get; set; } /// Specifies the url for kek encryption key. string KekUrl { get; set; } /// Specifies the keyvault resource id for kek encryption key. diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/EncryptionKeyDetails.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/EncryptionKeyDetails.json.cs similarity index 94% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/EncryptionKeyDetails.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/EncryptionKeyDetails.json.cs index c386a3dc0db0..7174866987a4 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/EncryptionKeyDetails.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/EncryptionKeyDetails.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -65,20 +65,20 @@ internal EncryptionKeyDetails(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Ru { return; } - {_kekType = If( json?.PropertyT("kekType"), out var __jsonKekType) ? (string)__jsonKekType : (string)KekType;} - {_kekUrl = If( json?.PropertyT("kekUrl"), out var __jsonKekUrl) ? (string)__jsonKekUrl : (string)KekUrl;} - {_kekVaultResourceId = If( json?.PropertyT("kekVaultResourceID"), out var __jsonKekVaultResourceId) ? (string)__jsonKekVaultResourceId : (string)KekVaultResourceId;} + {_kekType = If( json?.PropertyT("kekType"), out var __jsonKekType) ? (string)__jsonKekType : (string)_kekType;} + {_kekUrl = If( json?.PropertyT("kekUrl"), out var __jsonKekUrl) ? (string)__jsonKekUrl : (string)_kekUrl;} + {_kekVaultResourceId = If( json?.PropertyT("kekVaultResourceID"), out var __jsonKekVaultResourceId) ? (string)__jsonKekVaultResourceId : (string)_kekVaultResourceId;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new EncryptionKeyDetails(json) : null; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponse.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs similarity index 61% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponse.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs index 71c7c73f9c68..f8ceb827f56a 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponse.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ErrorResponse partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponse(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,33 +104,33 @@ internal ErrorResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseErrorTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseErrorTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseErrorDetailsItemTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseErrorDetailsItemTypeConverter.ConvertFrom)); } if (content.Contains("Innererror")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -137,27 +145,27 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Error")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseErrorTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseErrorTypeConverter.ConvertFrom); } if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseErrorDetailsItemTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseErrorDetailsItemTypeConverter.ConvertFrom)); } if (content.Contains("Innererror")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -167,12 +175,24 @@ internal ErrorResponse(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Response when errors occurred [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponse.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs similarity index 98% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponse.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs index 9fc9546500b0..9eb73c11b503 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponse.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponse.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponse.cs similarity index 66% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponse.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponse.cs index 0a141994e125..b4abee4f2e71 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponse.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponse.cs @@ -3,45 +3,45 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Response when errors occurred public partial class ErrorResponse : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal { /// Provides information about the error code. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)Error).Code = value ?? null; } + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)Error).Code = value ?? null; } /// Describes the error details if present. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)Error).Detail = value ?? null /* arrayOf */; } + public System.Collections.Generic.List Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)Error).Detail = value ?? null /* arrayOf */; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError _error; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError _error; /// Describes the error information. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseError()); set => this._error = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseError()); set => this._error = value; } /// Inner error object if present. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny Innererror { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)Error).Innererror; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)Error).Innererror = value ?? null /* model class */; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny Innererror { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)Error).Innererror; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)Error).Innererror = value ?? null /* model class */; } /// Provides information about the error message. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)Error).Message = value ?? null; } + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)Error).Message = value ?? null; } /// Internal Acessors for Error - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseError()); set { {_error = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseError()); set { {_error = value;} } } /// Provides information about the error target. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)Error).Target = value ?? null; } + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)Error).Target = value ?? null; } /// Creates an new instance. public ErrorResponse() @@ -57,6 +57,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provides information about the error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -65,14 +68,20 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Describes the error details if present.", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem[] Detail { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItem) })] + System.Collections.Generic.List Detail { get; set; } /// Inner error object if present. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Inner error object if present.", SerializedName = @"innererror", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) })] @@ -81,6 +90,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provides information about the error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -89,6 +101,9 @@ public partial interface IErrorResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provides information about the error target.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -102,9 +117,9 @@ internal partial interface IErrorResponseInternal /// Provides information about the error code. string Code { get; set; } /// Describes the error details if present. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// Describes the error information. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError Error { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError Error { get; set; } /// Inner error object if present. Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny Innererror { get; set; } /// Provides information about the error message. diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponse.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponse.json.cs similarity index 95% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponse.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponse.json.cs index 73881d88e586..2f82e144740d 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponse.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -65,18 +65,18 @@ internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.J { return; } - {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseError.FromJson(__jsonError) : Error;} + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseError.FromJson(__jsonError) : _error;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseError.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseError.PowerShell.cs similarity index 63% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseError.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseError.PowerShell.cs index 7a9024997a2f..01911dc6dbde 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseError.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseError.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ErrorResponseError partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponseError(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponseError(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,29 +104,29 @@ internal ErrorResponseError(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseErrorDetailsItemTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseErrorDetailsItemTypeConverter.ConvertFrom)); } if (content.Contains("Innererror")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -133,23 +141,23 @@ internal ErrorResponseError(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Message, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Detail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseErrorDetailsItemTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Detail = (System.Collections.Generic.List) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseErrorDetailsItemTypeConverter.ConvertFrom)); } if (content.Contains("Innererror")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.AnyTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Innererror = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) content.GetValueForProperty("Innererror",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal)this).Innererror, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.AnyTypeConverter.ConvertFrom); } AfterDeserializePSObject(content); } @@ -159,12 +167,24 @@ internal ErrorResponseError(global::System.Management.Automation.PSObject conten /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Describes the error information. [System.ComponentModel.TypeConverter(typeof(ErrorResponseErrorTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseError.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseError.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseError.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseError.TypeConverter.cs index 67a15d2a3e11..fce98a90d1c9 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseError.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseError.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseError.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseError.cs similarity index 82% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseError.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseError.cs index 461a3d5d7332..ca88d118c10f 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseError.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseError.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Describes the error information. public partial class ErrorResponseError : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class ErrorResponseError : public string Code { get => this._code; set => this._code = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem[] _detail; + private System.Collections.Generic.List _detail; /// Describes the error details if present. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem[] Detail { get => this._detail; set => this._detail = value; } + public System.Collections.Generic.List Detail { get => this._detail; set => this._detail = value; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny _innererror; @@ -62,6 +62,9 @@ public partial interface IErrorResponseError : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provides information about the error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -70,14 +73,20 @@ public partial interface IErrorResponseError : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Describes the error details if present.", SerializedName = @"details", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem[] Detail { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItem) })] + System.Collections.Generic.List Detail { get; set; } /// Inner error object if present. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Inner error object if present.", SerializedName = @"innererror", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) })] @@ -86,6 +95,9 @@ public partial interface IErrorResponseError : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provides information about the error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -94,6 +106,9 @@ public partial interface IErrorResponseError : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provides information about the error target.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] @@ -107,7 +122,7 @@ internal partial interface IErrorResponseErrorInternal /// Provides information about the error code. string Code { get; set; } /// Describes the error details if present. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem[] Detail { get; set; } + System.Collections.Generic.List Detail { get; set; } /// Inner error object if present. Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny Innererror { get; set; } /// Provides information about the error message. diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseError.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseError.json.cs similarity index 89% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseError.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseError.json.cs index 5be154eeaabc..bf14682002f1 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseError.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseError.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -65,22 +65,22 @@ internal ErrorResponseError(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runt { return; } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} - {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} - {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ErrorResponseErrorDetailsItem.FromJson(__u) )) ))() : null : Detail;} - {_innererror = If( json?.PropertyT("innererror"), out var __jsonInnererror) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Any.FromJson(__jsonInnererror) : Innererror;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)_target;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItem) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ErrorResponseErrorDetailsItem.FromJson(__u) )) ))() : null : _detail;} + {_innererror = If( json?.PropertyT("innererror"), out var __jsonInnererror) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Any.FromJson(__jsonInnererror) : _innererror;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseError FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new ErrorResponseError(json) : null; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseErrorDetailsItem.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseErrorDetailsItem.PowerShell.cs similarity index 70% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseErrorDetailsItem.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseErrorDetailsItem.PowerShell.cs index c9826c9945bd..c2b014fed99a 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseErrorDetailsItem.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseErrorDetailsItem.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -54,35 +54,41 @@ public partial class ErrorResponseErrorDetailsItem partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItem DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ErrorResponseErrorDetailsItem(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ErrorResponseErrorDetailsItem(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -97,21 +103,21 @@ internal ErrorResponseErrorDetailsItem(global::System.Collections.IDictionary co // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItemInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItemInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItemInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItemInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItemInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItemInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItemInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItemInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItemInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItemInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItemInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItemInternal)this).Message, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -126,15 +132,15 @@ internal ErrorResponseErrorDetailsItem(global::System.Management.Automation.PSOb // actually deserialize if (content.Contains("Code")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItemInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItemInternal)this).Code, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItemInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItemInternal)this).Code, global::System.Convert.ToString); } if (content.Contains("Target")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItemInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItemInternal)this).Target, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItemInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItemInternal)this).Target, global::System.Convert.ToString); } if (content.Contains("Message")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItemInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItemInternal)this).Message, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItemInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItemInternal)this).Message, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -144,12 +150,24 @@ internal ErrorResponseErrorDetailsItem(global::System.Management.Automation.PSOb /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } [System.ComponentModel.TypeConverter(typeof(ErrorResponseErrorDetailsItemTypeConverter))] public partial interface IErrorResponseErrorDetailsItem diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseErrorDetailsItem.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseErrorDetailsItem.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseErrorDetailsItem.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseErrorDetailsItem.TypeConverter.cs index 6c6fb4af5944..e1aad20e1b2b 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseErrorDetailsItem.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseErrorDetailsItem.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItem ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItem).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseErrorDetailsItem.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseErrorDetailsItem.cs similarity index 90% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseErrorDetailsItem.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseErrorDetailsItem.cs index 618fa253cae4..23a420b44c2d 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseErrorDetailsItem.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseErrorDetailsItem.cs @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; public partial class ErrorResponseErrorDetailsItem : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItemInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItem, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItemInternal { /// Backing field for property. @@ -46,6 +46,9 @@ public partial interface IErrorResponseErrorDetailsItem : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provides information about the error code.", SerializedName = @"code", PossibleTypes = new [] { typeof(string) })] @@ -54,6 +57,9 @@ public partial interface IErrorResponseErrorDetailsItem : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provides information about the error message.", SerializedName = @"message", PossibleTypes = new [] { typeof(string) })] @@ -62,6 +68,9 @@ public partial interface IErrorResponseErrorDetailsItem : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Provides information about the error target.", SerializedName = @"target", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseErrorDetailsItem.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseErrorDetailsItem.json.cs similarity index 93% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseErrorDetailsItem.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseErrorDetailsItem.json.cs index 0a3e54356572..594c99965f34 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ErrorResponseErrorDetailsItem.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ErrorResponseErrorDetailsItem.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -64,20 +64,20 @@ internal ErrorResponseErrorDetailsItem(Microsoft.Azure.PowerShell.Cmdlets.Import { return; } - {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} - {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} - {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)_code;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)_target;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)_message;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItem. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItem. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponseErrorDetailsItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponseErrorDetailsItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new ErrorResponseErrorDetailsItem(json) : null; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Export.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Export.PowerShell.cs similarity index 67% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Export.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/Export.PowerShell.cs index 282f48354950..9da333e8124b 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Export.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Export.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -58,33 +58,41 @@ public partial class Export partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Export(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Export(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -99,25 +107,25 @@ internal Export(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("BlobList")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList) content.GetValueForProperty("BlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportBlobListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList) content.GetValueForProperty("BlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportBlobListTypeConverter.ConvertFrom); } if (content.Contains("BlobListBlobPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobListBlobPath = (string) content.GetValueForProperty("BlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobListBlobPath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobListBlobPath = (string) content.GetValueForProperty("BlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobListBlobPath, global::System.Convert.ToString); } if (content.Contains("BlobPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobPath = (string[]) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobPath = (System.Collections.Generic.List) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("BlobListBlobPathPrefix")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobListBlobPathPrefix = (string[]) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobListBlobPathPrefix = (System.Collections.Generic.List) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -132,19 +140,19 @@ internal Export(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("BlobList")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList) content.GetValueForProperty("BlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportBlobListTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList) content.GetValueForProperty("BlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportBlobListTypeConverter.ConvertFrom); } if (content.Contains("BlobListBlobPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobListBlobPath = (string) content.GetValueForProperty("BlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobListBlobPath, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobListBlobPath = (string) content.GetValueForProperty("BlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobListBlobPath, global::System.Convert.ToString); } if (content.Contains("BlobPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobPath = (string[]) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobPath = (System.Collections.Generic.List) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("BlobListBlobPathPrefix")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobListBlobPathPrefix = (string[]) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobListBlobPathPrefix = (System.Collections.Generic.List) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -154,12 +162,24 @@ internal Export(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// A property containing information about the blobs to be exported for an export job. This property is required for export /// jobs, but must not be specified for import jobs. diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Export.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Export.TypeConverter.cs similarity index 98% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Export.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/Export.TypeConverter.cs index f6d293078087..f8b8afea1df2 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Export.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Export.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Export.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Export.cs similarity index 71% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Export.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/Export.cs index 6c4dfa741f34..b4542b760ea4 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Export.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Export.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -12,16 +12,16 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 /// jobs, but must not be specified for import jobs. /// public partial class Export : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList _blobList; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList _blobList; /// A list of the blobs to be exported. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList BlobList { get => (this._blobList = this._blobList ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportBlobList()); set => this._blobList = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList BlobList { get => (this._blobList = this._blobList ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportBlobList()); set => this._blobList = value; } /// Backing field for property. private string _blobListBlobPath; @@ -35,14 +35,14 @@ public partial class Export : /// A collection of blob-prefix strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string[] BlobListBlobPathPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobListInternal)BlobList).BlobPathPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobListInternal)BlobList).BlobPathPrefix = value ?? null /* arrayOf */; } + public System.Collections.Generic.List BlobListBlobPathPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobListInternal)BlobList).BlobPathPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobListInternal)BlobList).BlobPathPrefix = value ?? null /* arrayOf */; } /// A collection of blob-path strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string[] BlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobListInternal)BlobList).BlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobListInternal)BlobList).BlobPath = value ?? null /* arrayOf */; } + public System.Collections.Generic.List BlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobListInternal)BlobList).BlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobListInternal)BlobList).BlobPath = value ?? null /* arrayOf */; } /// Internal Acessors for BlobList - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal.BlobList { get => (this._blobList = this._blobList ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportBlobList()); set { {_blobList = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal.BlobList { get => (this._blobList = this._blobList ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportBlobList()); set { {_blobList = value;} } } /// Creates an new instance. public Export() @@ -62,6 +62,9 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning with the container name. If the blob is in root container, the URI must begin with $root. ", SerializedName = @"blobListBlobPath", PossibleTypes = new [] { typeof(string) })] @@ -70,18 +73,24 @@ public partial interface IExport : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A collection of blob-prefix strings.", SerializedName = @"blobPathPrefix", PossibleTypes = new [] { typeof(string) })] - string[] BlobListBlobPathPrefix { get; set; } + System.Collections.Generic.List BlobListBlobPathPrefix { get; set; } /// A collection of blob-path strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A collection of blob-path strings.", SerializedName = @"blobPath", PossibleTypes = new [] { typeof(string) })] - string[] BlobPath { get; set; } + System.Collections.Generic.List BlobPath { get; set; } } /// A property containing information about the blobs to be exported for an export job. This property is required for export @@ -90,16 +99,16 @@ internal partial interface IExportInternal { /// A list of the blobs to be exported. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList BlobList { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList BlobList { get; set; } /// /// The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning /// with the container name. If the blob is in root container, the URI must begin with $root. /// string BlobListBlobPath { get; set; } /// A collection of blob-prefix strings. - string[] BlobListBlobPathPrefix { get; set; } + System.Collections.Generic.List BlobListBlobPathPrefix { get; set; } /// A collection of blob-path strings. - string[] BlobPath { get; set; } + System.Collections.Generic.List BlobPath { get; set; } } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Export.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Export.json.cs similarity index 93% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Export.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/Export.json.cs index 196598a9d910..5491058e3739 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Export.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Export.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -68,19 +68,17 @@ internal Export(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.Jso { return; } - {_blobList = If( json?.PropertyT("blobList"), out var __jsonBlobList) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ExportBlobList.FromJson(__jsonBlobList) : BlobList;} - {_blobListBlobPath = If( json?.PropertyT("blobListBlobPath"), out var __jsonBlobListBlobPath) ? (string)__jsonBlobListBlobPath : (string)BlobListBlobPath;} + {_blobList = If( json?.PropertyT("blobList"), out var __jsonBlobList) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportBlobList.FromJson(__jsonBlobList) : _blobList;} + {_blobListBlobPath = If( json?.PropertyT("blobListBlobPath"), out var __jsonBlobListBlobPath) ? (string)__jsonBlobListBlobPath : (string)_blobListBlobPath;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport. /// /// a to deserialize from. - /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport. - /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport. + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new Export(json) : null; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ExportBlobList.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ExportBlobList.PowerShell.cs similarity index 71% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ExportBlobList.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ExportBlobList.PowerShell.cs index c47482e4d71e..cb3ee2a6dbbb 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ExportBlobList.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ExportBlobList.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,33 +55,41 @@ public partial class ExportBlobList partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ExportBlobList(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ExportBlobList(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -96,17 +104,17 @@ internal ExportBlobList(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("BlobPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobListInternal)this).BlobPath = (string[]) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobListInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobListInternal)this).BlobPath = (System.Collections.Generic.List) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobListInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("BlobPathPrefix")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobListInternal)this).BlobPathPrefix = (string[]) content.GetValueForProperty("BlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobListInternal)this).BlobPathPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobListInternal)this).BlobPathPrefix = (System.Collections.Generic.List) content.GetValueForProperty("BlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobListInternal)this).BlobPathPrefix, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -121,11 +129,11 @@ internal ExportBlobList(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("BlobPath")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobListInternal)this).BlobPath = (string[]) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobListInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobListInternal)this).BlobPath = (System.Collections.Generic.List) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobListInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("BlobPathPrefix")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobListInternal)this).BlobPathPrefix = (string[]) content.GetValueForProperty("BlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobListInternal)this).BlobPathPrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobListInternal)this).BlobPathPrefix = (System.Collections.Generic.List) content.GetValueForProperty("BlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobListInternal)this).BlobPathPrefix, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -135,12 +143,24 @@ internal ExportBlobList(global::System.Management.Automation.PSObject content) /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// A list of the blobs to be exported. [System.ComponentModel.TypeConverter(typeof(ExportBlobListTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ExportBlobList.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ExportBlobList.TypeConverter.cs similarity index 98% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ExportBlobList.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ExportBlobList.TypeConverter.cs index b0775cddfa63..b3c0e3c2dd8d 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ExportBlobList.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ExportBlobList.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ExportBlobList.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ExportBlobList.cs similarity index 70% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ExportBlobList.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ExportBlobList.cs index 8b5ac7ed4d55..8a21f1e6f972 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ExportBlobList.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ExportBlobList.cs @@ -3,29 +3,29 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// A list of the blobs to be exported. public partial class ExportBlobList : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobListInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobListInternal { /// Backing field for property. - private string[] _blobPath; + private System.Collections.Generic.List _blobPath; /// A collection of blob-path strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public string[] BlobPath { get => this._blobPath; set => this._blobPath = value; } + public System.Collections.Generic.List BlobPath { get => this._blobPath; set => this._blobPath = value; } /// Backing field for property. - private string[] _blobPathPrefix; + private System.Collections.Generic.List _blobPathPrefix; /// A collection of blob-prefix strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public string[] BlobPathPrefix { get => this._blobPathPrefix; set => this._blobPathPrefix = value; } + public System.Collections.Generic.List BlobPathPrefix { get => this._blobPathPrefix; set => this._blobPathPrefix = value; } /// Creates an new instance. public ExportBlobList() @@ -41,18 +41,24 @@ public partial interface IExportBlobList : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A collection of blob-path strings.", SerializedName = @"blobPath", PossibleTypes = new [] { typeof(string) })] - string[] BlobPath { get; set; } + System.Collections.Generic.List BlobPath { get; set; } /// A collection of blob-prefix strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A collection of blob-prefix strings.", SerializedName = @"blobPathPrefix", PossibleTypes = new [] { typeof(string) })] - string[] BlobPathPrefix { get; set; } + System.Collections.Generic.List BlobPathPrefix { get; set; } } /// A list of the blobs to be exported. @@ -60,9 +66,9 @@ internal partial interface IExportBlobListInternal { /// A collection of blob-path strings. - string[] BlobPath { get; set; } + System.Collections.Generic.List BlobPath { get; set; } /// A collection of blob-prefix strings. - string[] BlobPathPrefix { get; set; } + System.Collections.Generic.List BlobPathPrefix { get; set; } } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ExportBlobList.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ExportBlobList.json.cs similarity index 89% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ExportBlobList.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ExportBlobList.json.cs index 38feb9f7dd12..8b3607bfc5ec 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ExportBlobList.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ExportBlobList.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -65,19 +65,19 @@ internal ExportBlobList(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime. { return; } - {_blobPath = If( json?.PropertyT("blobPath"), out var __jsonBlobPath) ? If( __jsonBlobPath as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : BlobPath;} - {_blobPathPrefix = If( json?.PropertyT("blobPathPrefix"), out var __jsonBlobPathPrefix) ? If( __jsonBlobPathPrefix as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : BlobPathPrefix;} + {_blobPath = If( json?.PropertyT("blobPath"), out var __jsonBlobPath) ? If( __jsonBlobPath as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _blobPath;} + {_blobPathPrefix = If( json?.PropertyT("blobPathPrefix"), out var __jsonBlobPathPrefix) ? If( __jsonBlobPathPrefix as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _blobPathPrefix;} AfterFromJson(json); } /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new ExportBlobList(json) : null; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/GetBitLockerKeysResponse.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/GetBitLockerKeysResponse.PowerShell.cs similarity index 72% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/GetBitLockerKeysResponse.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/GetBitLockerKeysResponse.PowerShell.cs index 533909f9ef0f..7e767e49c552 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/GetBitLockerKeysResponse.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/GetBitLockerKeysResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,29 +55,35 @@ public partial class GetBitLockerKeysResponse partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new GetBitLockerKeysResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new GetBitLockerKeysResponse(content); } @@ -87,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,13 +111,13 @@ internal GetBitLockerKeysResponse(global::System.Collections.IDictionary content // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveBitLockerKeyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveBitLockerKeyTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -126,7 +132,7 @@ internal GetBitLockerKeysResponse(global::System.Management.Automation.PSObject // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveBitLockerKeyTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveBitLockerKeyTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -135,6 +141,18 @@ internal GetBitLockerKeysResponse(global::System.Management.Automation.PSObject /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// GetBitLockerKeys response [System.ComponentModel.TypeConverter(typeof(GetBitLockerKeysResponseTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/GetBitLockerKeysResponse.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/GetBitLockerKeysResponse.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/GetBitLockerKeysResponse.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/GetBitLockerKeysResponse.TypeConverter.cs index 5cb0bc66a1c1..65db9bae3642 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/GetBitLockerKeysResponse.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/GetBitLockerKeysResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/GetBitLockerKeysResponse.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/GetBitLockerKeysResponse.cs similarity index 64% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/GetBitLockerKeysResponse.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/GetBitLockerKeysResponse.cs index e18e38617b73..d4020c38cd8c 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/GetBitLockerKeysResponse.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/GetBitLockerKeysResponse.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// GetBitLockerKeys response public partial class GetBitLockerKeysResponse : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponse, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponse, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponseInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey[] _value; + private System.Collections.Generic.List _value; /// drive status [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public GetBitLockerKeysResponse() @@ -34,10 +34,13 @@ public partial interface IGetBitLockerKeysResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"drive status", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey) })] + System.Collections.Generic.List Value { get; set; } } /// GetBitLockerKeys response @@ -45,7 +48,7 @@ internal partial interface IGetBitLockerKeysResponseInternal { /// drive status - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/GetBitLockerKeysResponse.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/GetBitLockerKeysResponse.json.cs similarity index 90% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/GetBitLockerKeysResponse.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/GetBitLockerKeysResponse.json.cs index c40169bac405..f260bcd618ab 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/GetBitLockerKeysResponse.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/GetBitLockerKeysResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class GetBitLockerKeysResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new GetBitLockerKeysResponse(json) : null; } @@ -77,7 +77,7 @@ internal GetBitLockerKeysResponse(Microsoft.Azure.PowerShell.Cmdlets.ImportExpor { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveBitLockerKey.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveBitLockerKey.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/IdentityDetails.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/IdentityDetails.PowerShell.cs similarity index 72% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/IdentityDetails.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/IdentityDetails.PowerShell.cs index 4e306fc6e526..a6e445445fb2 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/IdentityDetails.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/IdentityDetails.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class IdentityDetails partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new IdentityDetails(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new IdentityDetails(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,21 +111,21 @@ internal IdentityDetails(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)this).TenantId, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -132,15 +140,15 @@ internal IdentityDetails(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Type")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)this).Type, global::System.Convert.ToString); } if (content.Contains("PrincipalId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)this).PrincipalId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)this).PrincipalId, global::System.Convert.ToString); } if (content.Contains("TenantId")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)this).TenantId, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)this).TenantId, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -149,6 +157,18 @@ internal IdentityDetails(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Specifies the identity properties. [System.ComponentModel.TypeConverter(typeof(IdentityDetailsTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/IdentityDetails.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/IdentityDetails.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/IdentityDetails.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/IdentityDetails.TypeConverter.cs index d431459c1461..539933c4d8ea 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/IdentityDetails.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/IdentityDetails.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/IdentityDetails.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/IdentityDetails.cs similarity index 77% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/IdentityDetails.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/IdentityDetails.cs index 888d1a308b60..94a5f3e238fd 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/IdentityDetails.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/IdentityDetails.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Specifies the identity properties. public partial class IdentityDetails : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal { /// Internal Acessors for PrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } /// Internal Acessors for TenantId - string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } /// Backing field for property. private string _principalId; @@ -34,11 +34,11 @@ public partial class IdentityDetails : public string TenantId { get => this._tenantId; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType? _type; + private string _type; /// The type of identity [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType? Type { get => this._type; set => this._type = value; } + public string Type { get => this._type; set => this._type = value; } /// Creates an new instance. public IdentityDetails() @@ -54,6 +54,9 @@ public partial interface IIdentityDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the principal id for the identity for the job. ", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -62,6 +65,9 @@ public partial interface IIdentityDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the tenant id for the identity for the job. ", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -70,10 +76,14 @@ public partial interface IIdentityDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType? Type { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned")] + string Type { get; set; } } /// Specifies the identity properties. @@ -85,7 +95,8 @@ internal partial interface IIdentityDetailsInternal /// Specifies the tenant id for the identity for the job. string TenantId { get; set; } /// The type of identity - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType? Type { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned")] + string Type { get; set; } } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/IdentityDetails.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/IdentityDetails.json.cs similarity index 93% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/IdentityDetails.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/IdentityDetails.json.cs index 2a3046bd9365..fed3ee16a5e6 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/IdentityDetails.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/IdentityDetails.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class IdentityDetails partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new IdentityDetails(json) : null; } @@ -77,9 +77,9 @@ internal IdentityDetails(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime { return; } - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} - {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)_principalId;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)_tenantId;} AfterFromJson(json); } @@ -103,11 +103,11 @@ public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode ToJ return container; } AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ImportExportIdentity.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ImportExportIdentity.PowerShell.cs index 977eb1b7db49..43239a843d8c 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ImportExportIdentity.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ImportExportIdentity.PowerShell.cs @@ -53,6 +53,14 @@ public partial class ImportExportIdentity partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + /// /// Deserializes a into an instance of . @@ -164,6 +172,18 @@ internal ImportExportIdentity(global::System.Management.Automation.PSObject cont /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } [System.ComponentModel.TypeConverter(typeof(ImportExportIdentityTypeConverter))] public partial interface IImportExportIdentity diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ImportExportIdentity.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ImportExportIdentity.cs index 29f164b87ada..38da789e453a 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ImportExportIdentity.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ImportExportIdentity.cs @@ -62,6 +62,9 @@ public partial interface IImportExportIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Resource identity path", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -70,6 +73,9 @@ public partial interface IImportExportIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the import/export job.", SerializedName = @"jobName", PossibleTypes = new [] { typeof(string) })] @@ -78,6 +84,9 @@ public partial interface IImportExportIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the location. For example, West US or westus.", SerializedName = @"locationName", PossibleTypes = new [] { typeof(string) })] @@ -88,6 +97,9 @@ public partial interface IImportExportIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource group name uniquely identifies the resource group within the user subscription.", SerializedName = @"resourceGroupName", PossibleTypes = new [] { typeof(string) })] @@ -96,6 +108,9 @@ public partial interface IImportExportIdentity : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The subscription ID for the Azure user.", SerializedName = @"subscriptionId", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ImportExportIdentity.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ImportExportIdentity.json.cs index 7dc17c118d88..da2003d6a5a6 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ImportExportIdentity.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ImportExportIdentity.json.cs @@ -76,11 +76,11 @@ internal ImportExportIdentity(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Ru { return; } - {_locationName = If( json?.PropertyT("locationName"), out var __jsonLocationName) ? (string)__jsonLocationName : (string)LocationName;} - {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} - {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} - {_jobName = If( json?.PropertyT("jobName"), out var __jsonJobName) ? (string)__jsonJobName : (string)JobName;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_locationName = If( json?.PropertyT("locationName"), out var __jsonLocationName) ? (string)__jsonLocationName : (string)_locationName;} + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)_subscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)_resourceGroupName;} + {_jobName = If( json?.PropertyT("jobName"), out var __jsonJobName) ? (string)__jsonJobName : (string)_jobName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobDetails.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobDetails.PowerShell.cs new file mode 100644 index 000000000000..e7b53196eeba --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobDetails.PowerShell.cs @@ -0,0 +1,580 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + + /// Specifies the job properties + [System.ComponentModel.TypeConverter(typeof(JobDetailsTypeConverter))] + public partial class JobDetails + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JobDetails(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JobDetails(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JobDetails(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ReturnAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddressTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnShipping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShippingTypeConverter.ConvertFrom); + } + if (content.Contains("ShippingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformation = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation) content.GetValueForProperty("ShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformation, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ShippingInformationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation) content.GetValueForProperty("ReturnPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("Export")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).Export = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport) content.GetValueForProperty("Export",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).Export, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.EncryptionKeyDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).JobType, global::System.Convert.ToString); + } + if (content.Contains("DiagnosticsPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DiagnosticsPath = (string) content.GetValueForProperty("DiagnosticsPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DiagnosticsPath, global::System.Convert.ToString); + } + if (content.Contains("LogLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).LogLevel, global::System.Convert.ToString); + } + if (content.Contains("BackupDriveManifest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).State, global::System.Convert.ToString); + } + if (content.Contains("CancelRequested")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncompleteBlobListUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).IncompleteBlobListUri = (string) content.GetValueForProperty("IncompleteBlobListUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).IncompleteBlobListUri, global::System.Convert.ToString); + } + if (content.Contains("DriveList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DriveList = (System.Collections.Generic.List) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DriveList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressCity, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressPhone, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressEmail, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationRecipientName = (string) content.GetValueForProperty("ShippingInformationRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationStreetAddress1 = (string) content.GetValueForProperty("ShippingInformationStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationStreetAddress2 = (string) content.GetValueForProperty("ShippingInformationStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationCity = (string) content.GetValueForProperty("ShippingInformationCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationCity, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationPostalCode = (string) content.GetValueForProperty("ShippingInformationPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationPhone = (string) content.GetValueForProperty("ShippingInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationPhone, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationAdditionalInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationAdditionalInformation = (string) content.GetValueForProperty("ShippingInformationAdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationAdditionalInformation, global::System.Convert.ToString); + } + if (content.Contains("ExportBlobList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ExportBlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList) content.GetValueForProperty("ExportBlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ExportBlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportBlobListTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnAddressStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierAccountNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationStateOrProvince = (string) content.GetValueForProperty("ShippingInformationStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationCountryOrRegion = (string) content.GetValueForProperty("ShippingInformationCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DeliveryPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageCarrierName = (string) content.GetValueForProperty("ReturnPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageTrackingNumber = (string) content.GetValueForProperty("ReturnPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageDriveCount = (long?) content.GetValueForProperty("ReturnPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ReturnPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageShipDate = (string) content.GetValueForProperty("ReturnPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageShipDate, global::System.Convert.ToString); + } + if (content.Contains("ExportBlobListBlobPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ExportBlobListBlobPath = (string) content.GetValueForProperty("ExportBlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ExportBlobListBlobPath, global::System.Convert.ToString); + } + if (content.Contains("BlobPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).BlobPath = (System.Collections.Generic.List) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EncryptionKeyKekType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKeyKekType = (string) content.GetValueForProperty("EncryptionKeyKekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKeyKekType, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyKekUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKeyKekUrl = (string) content.GetValueForProperty("EncryptionKeyKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKeyKekUrl, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyKekVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKeyKekVaultResourceId = (string) content.GetValueForProperty("EncryptionKeyKekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKeyKekVaultResourceId, global::System.Convert.ToString); + } + if (content.Contains("BlobListBlobPathPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).BlobListBlobPathPrefix = (System.Collections.Generic.List) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JobDetails(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ReturnAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddressTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnShipping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShippingTypeConverter.ConvertFrom); + } + if (content.Contains("ShippingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformation = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation) content.GetValueForProperty("ShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformation, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ShippingInformationTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation) content.GetValueForProperty("ReturnPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("Export")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).Export = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport) content.GetValueForProperty("Export",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).Export, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.EncryptionKeyDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).JobType, global::System.Convert.ToString); + } + if (content.Contains("DiagnosticsPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DiagnosticsPath = (string) content.GetValueForProperty("DiagnosticsPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DiagnosticsPath, global::System.Convert.ToString); + } + if (content.Contains("LogLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).LogLevel, global::System.Convert.ToString); + } + if (content.Contains("BackupDriveManifest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).State, global::System.Convert.ToString); + } + if (content.Contains("CancelRequested")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncompleteBlobListUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).IncompleteBlobListUri = (string) content.GetValueForProperty("IncompleteBlobListUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).IncompleteBlobListUri, global::System.Convert.ToString); + } + if (content.Contains("DriveList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DriveList = (System.Collections.Generic.List) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DriveList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressCity, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressPhone, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressEmail, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationRecipientName = (string) content.GetValueForProperty("ShippingInformationRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationStreetAddress1 = (string) content.GetValueForProperty("ShippingInformationStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationStreetAddress2 = (string) content.GetValueForProperty("ShippingInformationStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationCity = (string) content.GetValueForProperty("ShippingInformationCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationCity, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationPostalCode = (string) content.GetValueForProperty("ShippingInformationPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationPhone = (string) content.GetValueForProperty("ShippingInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationPhone, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationAdditionalInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationAdditionalInformation = (string) content.GetValueForProperty("ShippingInformationAdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationAdditionalInformation, global::System.Convert.ToString); + } + if (content.Contains("ExportBlobList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ExportBlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList) content.GetValueForProperty("ExportBlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ExportBlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportBlobListTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnAddressStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierAccountNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationStateOrProvince = (string) content.GetValueForProperty("ShippingInformationStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationCountryOrRegion = (string) content.GetValueForProperty("ShippingInformationCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ShippingInformationCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DeliveryPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageCarrierName = (string) content.GetValueForProperty("ReturnPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageTrackingNumber = (string) content.GetValueForProperty("ReturnPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageDriveCount = (long?) content.GetValueForProperty("ReturnPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ReturnPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageShipDate = (string) content.GetValueForProperty("ReturnPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ReturnPackageShipDate, global::System.Convert.ToString); + } + if (content.Contains("ExportBlobListBlobPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ExportBlobListBlobPath = (string) content.GetValueForProperty("ExportBlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).ExportBlobListBlobPath, global::System.Convert.ToString); + } + if (content.Contains("BlobPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).BlobPath = (System.Collections.Generic.List) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EncryptionKeyKekType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKeyKekType = (string) content.GetValueForProperty("EncryptionKeyKekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKeyKekType, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyKekUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKeyKekUrl = (string) content.GetValueForProperty("EncryptionKeyKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKeyKekUrl, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyKekVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKeyKekVaultResourceId = (string) content.GetValueForProperty("EncryptionKeyKekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).EncryptionKeyKekVaultResourceId, global::System.Convert.ToString); + } + if (content.Contains("BlobListBlobPathPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).BlobListBlobPathPrefix = (System.Collections.Generic.List) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Specifies the job properties + [System.ComponentModel.TypeConverter(typeof(JobDetailsTypeConverter))] + public partial interface IJobDetails + + { + + } +} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobDetails.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobDetails.TypeConverter.cs similarity index 98% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobDetails.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobDetails.TypeConverter.cs index d0b9c88fdb3d..42edbb665901 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobDetails.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobDetails.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobDetails.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobDetails.cs similarity index 72% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobDetails.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobDetails.cs index 02ae3a61a3b3..2edfa9567379 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobDetails.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobDetails.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Specifies the job properties public partial class JobDetails : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal { /// Backing field for property. @@ -24,11 +24,11 @@ public partial class JobDetails : /// A collection of blob-prefix strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string[] BlobListBlobPathPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)Export).BlobListBlobPathPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)Export).BlobListBlobPathPrefix = value ?? null /* arrayOf */; } + public System.Collections.Generic.List BlobListBlobPathPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)Export).BlobListBlobPathPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)Export).BlobListBlobPathPrefix = value ?? null /* arrayOf */; } /// A collection of blob-path strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string[] BlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)Export).BlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)Export).BlobPath = value ?? null /* arrayOf */; } + public System.Collections.Generic.List BlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)Export).BlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)Export).BlobPath = value ?? null /* arrayOf */; } /// Backing field for property. private bool? _cancelRequested; @@ -38,29 +38,29 @@ public partial class JobDetails : public bool? CancelRequested { get => this._cancelRequested; set => this._cancelRequested = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation _deliveryPackage; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation _deliveryPackage; /// /// Contains information about the package being shipped by the customer to the Microsoft data center. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation DeliveryPackage { get => (this._deliveryPackage = this._deliveryPackage ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformation()); set => this._deliveryPackage = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation DeliveryPackage { get => (this._deliveryPackage = this._deliveryPackage ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformation()); set => this._deliveryPackage = value; } /// The name of the carrier that is used to ship the import or export drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).CarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).CarrierName = value ?? null; } + public string DeliveryPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).CarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).CarrierName = value ?? null; } /// The number of drives included in the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public long? DeliveryPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).DriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).DriveCount = value ?? default(long); } + public long? DeliveryPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).DriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).DriveCount = value ?? default(long); } /// The date when the package is shipped. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).ShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).ShipDate = value ?? null; } + public string DeliveryPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).ShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).ShipDate = value ?? null; } /// The tracking number of the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).TrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).TrackingNumber = value ?? null; } + public string DeliveryPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).TrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).TrackingNumber = value ?? null; } /// Backing field for property. private string _diagnosticsPath; @@ -72,50 +72,50 @@ public partial class JobDetails : public string DiagnosticsPath { get => this._diagnosticsPath; set => this._diagnosticsPath = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] _driveList; + private System.Collections.Generic.List _driveList; /// /// List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is not specified /// for export jobs. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get => this._driveList; set => this._driveList = value; } + public System.Collections.Generic.List DriveList { get => this._driveList; set => this._driveList = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails _encryptionKey; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails _encryptionKey; /// Contains information about the encryption key. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails EncryptionKey { get => (this._encryptionKey = this._encryptionKey ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.EncryptionKeyDetails()); set => this._encryptionKey = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails EncryptionKey { get => (this._encryptionKey = this._encryptionKey ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.EncryptionKeyDetails()); set => this._encryptionKey = value; } /// The type of kek encryption key [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType? EncryptionKeyKekType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)EncryptionKey).KekType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)EncryptionKey).KekType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType)""); } + public string EncryptionKeyKekType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)EncryptionKey).KekType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)EncryptionKey).KekType = value ?? null; } /// Specifies the url for kek encryption key. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string EncryptionKeyKekUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)EncryptionKey).KekUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)EncryptionKey).KekUrl = value ?? null; } + public string EncryptionKeyKekUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)EncryptionKey).KekUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)EncryptionKey).KekUrl = value ?? null; } /// Specifies the keyvault resource id for kek encryption key. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string EncryptionKeyKekVaultResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)EncryptionKey).KekVaultResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetailsInternal)EncryptionKey).KekVaultResourceId = value ?? null; } + public string EncryptionKeyKekVaultResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)EncryptionKey).KekVaultResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetailsInternal)EncryptionKey).KekVaultResourceId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport _export; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport _export; /// /// A property containing information about the blobs to be exported for an export job. This property is included for export /// jobs only. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport Export { get => (this._export = this._export ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.Export()); set => this._export = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport Export { get => (this._export = this._export ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Export()); set => this._export = value; } /// /// The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning /// with the container name. If the blob is in root container, the URI must begin with $root. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ExportBlobListBlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)Export).BlobListBlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)Export).BlobListBlobPath = value ?? null; } + public string ExportBlobListBlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)Export).BlobListBlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)Export).BlobListBlobPath = value ?? null; } /// Backing field for property. private string _incompleteBlobListUri; @@ -144,31 +144,31 @@ public partial class JobDetails : public string LogLevel { get => this._logLevel; set => this._logLevel = value; } /// Internal Acessors for DeliveryPackage - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal.DeliveryPackage { get => (this._deliveryPackage = this._deliveryPackage ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformation()); set { {_deliveryPackage = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal.DeliveryPackage { get => (this._deliveryPackage = this._deliveryPackage ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformation()); set { {_deliveryPackage = value;} } } /// Internal Acessors for EncryptionKey - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal.EncryptionKey { get => (this._encryptionKey = this._encryptionKey ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.EncryptionKeyDetails()); set { {_encryptionKey = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal.EncryptionKey { get => (this._encryptionKey = this._encryptionKey ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.EncryptionKeyDetails()); set { {_encryptionKey = value;} } } /// Internal Acessors for Export - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal.Export { get => (this._export = this._export ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.Export()); set { {_export = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal.Export { get => (this._export = this._export ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Export()); set { {_export = value;} } } /// Internal Acessors for ExportBlobList - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal.ExportBlobList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)Export).BlobList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportInternal)Export).BlobList = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal.ExportBlobList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)Export).BlobList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportInternal)Export).BlobList = value; } /// Internal Acessors for ReturnAddress - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal.ReturnAddress { get => (this._returnAddress = this._returnAddress ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddress()); set { {_returnAddress = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal.ReturnAddress { get => (this._returnAddress = this._returnAddress ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddress()); set { {_returnAddress = value;} } } /// Internal Acessors for ReturnPackage - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal.ReturnPackage { get => (this._returnPackage = this._returnPackage ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PackageInformation()); set { {_returnPackage = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal.ReturnPackage { get => (this._returnPackage = this._returnPackage ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PackageInformation()); set { {_returnPackage = value;} } } /// Internal Acessors for ReturnShipping - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal.ReturnShipping { get => (this._returnShipping = this._returnShipping ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShipping()); set { {_returnShipping = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal.ReturnShipping { get => (this._returnShipping = this._returnShipping ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShipping()); set { {_returnShipping = value;} } } /// Internal Acessors for ShippingInformation - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal.ShippingInformation { get => (this._shippingInformation = this._shippingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ShippingInformation()); set { {_shippingInformation = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal.ShippingInformation { get => (this._shippingInformation = this._shippingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ShippingInformation()); set { {_shippingInformation = value;} } } /// Internal Acessors for ShippingInformationAdditionalInformation - string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal.ShippingInformationAdditionalInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).AdditionalInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).AdditionalInformation = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal.ShippingInformationAdditionalInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).AdditionalInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).AdditionalInformation = value; } /// Backing field for property. private long? _percentComplete; @@ -185,52 +185,52 @@ public partial class JobDetails : public string ProvisioningState { get => this._provisioningState; set => this._provisioningState = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress _returnAddress; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress _returnAddress; /// Specifies the return address information for the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress ReturnAddress { get => (this._returnAddress = this._returnAddress ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddress()); set => this._returnAddress = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress ReturnAddress { get => (this._returnAddress = this._returnAddress ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddress()); set => this._returnAddress = value; } /// The city name to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).City; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).City = value ?? null; } + public string ReturnAddressCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).City; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).City = value ?? null; } /// The country or region to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).CountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).CountryOrRegion = value ?? null; } + public string ReturnAddressCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).CountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).CountryOrRegion = value ?? null; } /// Email address of the recipient of the returned drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).Email = value ?? null; } + public string ReturnAddressEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).Email = value ?? null; } /// Phone number of the recipient of the returned drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).Phone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).Phone = value ?? null; } + public string ReturnAddressPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).Phone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).Phone = value ?? null; } /// The postal code to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).PostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).PostalCode = value ?? null; } + public string ReturnAddressPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).PostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).PostalCode = value ?? null; } /// /// The name of the recipient who will receive the hard drives when they are returned. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).RecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).RecipientName = value ?? null; } + public string ReturnAddressRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).RecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).RecipientName = value ?? null; } /// The state or province to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).StateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).StateOrProvince = value ?? null; } + public string ReturnAddressStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).StateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).StateOrProvince = value ?? null; } /// The first line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).StreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).StreetAddress1 = value ?? null; } + public string ReturnAddressStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).StreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).StreetAddress1 = value ?? null; } /// The second line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).StreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).StreetAddress2 = value ?? null; } + public string ReturnAddressStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).StreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).StreetAddress2 = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation _returnPackage; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation _returnPackage; /// /// Contains information about the package being shipped from the Microsoft data center to the customer to return the drives. @@ -238,87 +238,87 @@ public partial class JobDetails : /// been returned. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation ReturnPackage { get => (this._returnPackage = this._returnPackage ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PackageInformation()); set => this._returnPackage = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation ReturnPackage { get => (this._returnPackage = this._returnPackage ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PackageInformation()); set => this._returnPackage = value; } /// The name of the carrier that is used to ship the import or export drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)ReturnPackage).CarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)ReturnPackage).CarrierName = value ?? null; } + public string ReturnPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)ReturnPackage).CarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)ReturnPackage).CarrierName = value ?? null; } /// The number of drives included in the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public long? ReturnPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)ReturnPackage).DriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)ReturnPackage).DriveCount = value ?? default(long); } + public long? ReturnPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)ReturnPackage).DriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)ReturnPackage).DriveCount = value ?? default(long); } /// The date when the package is shipped. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)ReturnPackage).ShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)ReturnPackage).ShipDate = value ?? null; } + public string ReturnPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)ReturnPackage).ShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)ReturnPackage).ShipDate = value ?? null; } /// The tracking number of the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)ReturnPackage).TrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)ReturnPackage).TrackingNumber = value ?? null; } + public string ReturnPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)ReturnPackage).TrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)ReturnPackage).TrackingNumber = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping _returnShipping; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping _returnShipping; /// Specifies the return carrier and customer's account with the carrier. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping ReturnShipping { get => (this._returnShipping = this._returnShipping ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShipping()); set => this._returnShipping = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping ReturnShipping { get => (this._returnShipping = this._returnShipping ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShipping()); set => this._returnShipping = value; } /// The customer's account number with the carrier. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnShippingCarrierAccountNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)ReturnShipping).CarrierAccountNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)ReturnShipping).CarrierAccountNumber = value ?? null; } + public string ReturnShippingCarrierAccountNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)ReturnShipping).CarrierAccountNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)ReturnShipping).CarrierAccountNumber = value ?? null; } /// The carrier's name. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnShippingCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)ReturnShipping).CarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)ReturnShipping).CarrierName = value ?? null; } + public string ReturnShippingCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)ReturnShipping).CarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)ReturnShipping).CarrierName = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation _shippingInformation; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation _shippingInformation; /// /// Contains information about the Microsoft datacenter to which the drives should be shipped. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation ShippingInformation { get => (this._shippingInformation = this._shippingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ShippingInformation()); set => this._shippingInformation = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation ShippingInformation { get => (this._shippingInformation = this._shippingInformation ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ShippingInformation()); set => this._shippingInformation = value; } /// /// Additional shipping information for customer, specific to datacenter to which customer should send their disks. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationAdditionalInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).AdditionalInformation; } + public string ShippingInformationAdditionalInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).AdditionalInformation; } /// The city name to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).City; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).City = value ?? null; } + public string ShippingInformationCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).City; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).City = value ?? null; } /// The country or region to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).CountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).CountryOrRegion = value ?? null; } + public string ShippingInformationCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).CountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).CountryOrRegion = value ?? null; } /// Phone number of the recipient of the returned drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).Phone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).Phone = value ?? null; } + public string ShippingInformationPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).Phone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).Phone = value ?? null; } /// The postal code to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).PostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).PostalCode = value ?? null; } + public string ShippingInformationPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).PostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).PostalCode = value ?? null; } /// /// The name of the recipient who will receive the hard drives when they are returned. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).RecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).RecipientName = value ?? null; } + public string ShippingInformationRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).RecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).RecipientName = value ?? null; } /// The state or province to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).StateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).StateOrProvince = value ?? null; } + public string ShippingInformationStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).StateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).StateOrProvince = value ?? null; } /// The first line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).StreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).StreetAddress1 = value ?? null; } + public string ShippingInformationStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).StreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).StreetAddress1 = value ?? null; } /// The second line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).StreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)ShippingInformation).StreetAddress2 = value ?? null; } + public string ShippingInformationStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).StreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)ShippingInformation).StreetAddress2 = value ?? null; } /// Backing field for property. private string _state; @@ -352,6 +352,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Default value is false. Indicates whether the manifest files on the drives should be copied to block blobs.", SerializedName = @"backupDriveManifest", PossibleTypes = new [] { typeof(bool) })] @@ -360,22 +363,31 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A collection of blob-prefix strings.", SerializedName = @"blobPathPrefix", PossibleTypes = new [] { typeof(string) })] - string[] BlobListBlobPathPrefix { get; set; } + System.Collections.Generic.List BlobListBlobPathPrefix { get; set; } /// A collection of blob-path strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A collection of blob-path strings.", SerializedName = @"blobPath", PossibleTypes = new [] { typeof(string) })] - string[] BlobPath { get; set; } + System.Collections.Generic.List BlobPath { get; set; } /// Indicates whether a request has been submitted to cancel the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether a request has been submitted to cancel the job.", SerializedName = @"cancelRequested", PossibleTypes = new [] { typeof(bool) })] @@ -384,6 +396,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the carrier that is used to ship the import or export drives.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -392,6 +407,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of drives included in the package.", SerializedName = @"driveCount", PossibleTypes = new [] { typeof(long) })] @@ -400,6 +418,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The date when the package is shipped.", SerializedName = @"shipDate", PossibleTypes = new [] { typeof(string) })] @@ -408,6 +429,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tracking number of the package.", SerializedName = @"trackingNumber", PossibleTypes = new [] { typeof(string) })] @@ -418,6 +442,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The virtual blob directory to which the copy logs and backups of drive manifest files (if enabled) will be stored.", SerializedName = @"diagnosticsPath", PossibleTypes = new [] { typeof(string) })] @@ -429,22 +456,32 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is not specified for export jobs.", SerializedName = @"driveList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus) })] + System.Collections.Generic.List DriveList { get; set; } /// The type of kek encryption key [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of kek encryption key", SerializedName = @"kekType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType? EncryptionKeyKekType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("MicrosoftManaged", "CustomerManaged")] + string EncryptionKeyKekType { get; set; } /// Specifies the url for kek encryption key. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the url for kek encryption key. ", SerializedName = @"kekUrl", PossibleTypes = new [] { typeof(string) })] @@ -453,6 +490,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the keyvault resource id for kek encryption key. ", SerializedName = @"kekVaultResourceID", PossibleTypes = new [] { typeof(string) })] @@ -464,6 +504,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning with the container name. If the blob is in root container, the URI must begin with $root. ", SerializedName = @"blobListBlobPath", PossibleTypes = new [] { typeof(string) })] @@ -475,6 +518,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A blob path that points to a block blob containing a list of blob names that were not exported due to insufficient drive space. If all blobs were exported successfully, then this element is not included in the response.", SerializedName = @"incompleteBlobListUri", PossibleTypes = new [] { typeof(string) })] @@ -483,6 +529,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of job", SerializedName = @"jobType", PossibleTypes = new [] { typeof(string) })] @@ -493,6 +542,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Default value is Error. Indicates whether error logging or verbose logging will be enabled.", SerializedName = @"logLevel", PossibleTypes = new [] { typeof(string) })] @@ -501,6 +553,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Overall percentage completed for the job.", SerializedName = @"percentComplete", PossibleTypes = new [] { typeof(long) })] @@ -509,6 +564,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the provisioning state of the job.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -517,6 +575,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The city name to use when returning the drives.", SerializedName = @"city", PossibleTypes = new [] { typeof(string) })] @@ -525,6 +586,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The country or region to use when returning the drives. ", SerializedName = @"countryOrRegion", PossibleTypes = new [] { typeof(string) })] @@ -533,6 +597,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email address of the recipient of the returned drives.", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -541,6 +608,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Phone number of the recipient of the returned drives.", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] @@ -549,6 +619,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The postal code to use when returning the drives.", SerializedName = @"postalCode", PossibleTypes = new [] { typeof(string) })] @@ -559,6 +632,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the recipient who will receive the hard drives when they are returned. ", SerializedName = @"recipientName", PossibleTypes = new [] { typeof(string) })] @@ -567,6 +643,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The state or province to use when returning the drives.", SerializedName = @"stateOrProvince", PossibleTypes = new [] { typeof(string) })] @@ -575,6 +654,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The first line of the street address to use when returning the drives. ", SerializedName = @"streetAddress1", PossibleTypes = new [] { typeof(string) })] @@ -583,6 +665,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The second line of the street address to use when returning the drives. ", SerializedName = @"streetAddress2", PossibleTypes = new [] { typeof(string) })] @@ -591,6 +676,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the carrier that is used to ship the import or export drives.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -599,6 +687,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of drives included in the package.", SerializedName = @"driveCount", PossibleTypes = new [] { typeof(long) })] @@ -607,6 +698,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The date when the package is shipped.", SerializedName = @"shipDate", PossibleTypes = new [] { typeof(string) })] @@ -615,6 +709,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tracking number of the package.", SerializedName = @"trackingNumber", PossibleTypes = new [] { typeof(string) })] @@ -623,6 +720,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The customer's account number with the carrier.", SerializedName = @"carrierAccountNumber", PossibleTypes = new [] { typeof(string) })] @@ -631,6 +731,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The carrier's name.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -641,6 +744,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Additional shipping information for customer, specific to datacenter to which customer should send their disks.", SerializedName = @"additionalInformation", PossibleTypes = new [] { typeof(string) })] @@ -649,6 +755,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The city name to use when returning the drives.", SerializedName = @"city", PossibleTypes = new [] { typeof(string) })] @@ -657,6 +766,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The country or region to use when returning the drives. ", SerializedName = @"countryOrRegion", PossibleTypes = new [] { typeof(string) })] @@ -665,6 +777,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Phone number of the recipient of the returned drives.", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] @@ -673,6 +788,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The postal code to use when returning the drives.", SerializedName = @"postalCode", PossibleTypes = new [] { typeof(string) })] @@ -683,6 +801,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the recipient who will receive the hard drives when they are returned. ", SerializedName = @"recipientName", PossibleTypes = new [] { typeof(string) })] @@ -691,6 +812,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The state or province to use when returning the drives.", SerializedName = @"stateOrProvince", PossibleTypes = new [] { typeof(string) })] @@ -699,6 +823,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The first line of the street address to use when returning the drives. ", SerializedName = @"streetAddress1", PossibleTypes = new [] { typeof(string) })] @@ -707,6 +834,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The second line of the street address to use when returning the drives. ", SerializedName = @"streetAddress2", PossibleTypes = new [] { typeof(string) })] @@ -715,6 +845,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Current state of the job.", SerializedName = @"state", PossibleTypes = new [] { typeof(string) })] @@ -725,6 +858,9 @@ public partial interface IJobDetails : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource identifier of the storage account where data will be imported to or exported from.", SerializedName = @"storageAccountId", PossibleTypes = new [] { typeof(string) })] @@ -740,15 +876,15 @@ internal partial interface IJobDetailsInternal /// bool? BackupDriveManifest { get; set; } /// A collection of blob-prefix strings. - string[] BlobListBlobPathPrefix { get; set; } + System.Collections.Generic.List BlobListBlobPathPrefix { get; set; } /// A collection of blob-path strings. - string[] BlobPath { get; set; } + System.Collections.Generic.List BlobPath { get; set; } /// Indicates whether a request has been submitted to cancel the job. bool? CancelRequested { get; set; } /// /// Contains information about the package being shipped by the customer to the Microsoft data center. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation DeliveryPackage { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation DeliveryPackage { get; set; } /// The name of the carrier that is used to ship the import or export drives. string DeliveryPackageCarrierName { get; set; } /// The number of drives included in the package. @@ -765,11 +901,12 @@ internal partial interface IJobDetailsInternal /// List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is not specified /// for export jobs. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get; set; } + System.Collections.Generic.List DriveList { get; set; } /// Contains information about the encryption key. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails EncryptionKey { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails EncryptionKey { get; set; } /// The type of kek encryption key - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType? EncryptionKeyKekType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("MicrosoftManaged", "CustomerManaged")] + string EncryptionKeyKekType { get; set; } /// Specifies the url for kek encryption key. string EncryptionKeyKekUrl { get; set; } /// Specifies the keyvault resource id for kek encryption key. @@ -778,9 +915,9 @@ internal partial interface IJobDetailsInternal /// A property containing information about the blobs to be exported for an export job. This property is included for export /// jobs only. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport Export { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport Export { get; set; } /// A list of the blobs to be exported. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList ExportBlobList { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList ExportBlobList { get; set; } /// /// The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning /// with the container name. If the blob is in root container, the URI must begin with $root. @@ -802,7 +939,7 @@ internal partial interface IJobDetailsInternal /// Specifies the provisioning state of the job. string ProvisioningState { get; set; } /// Specifies the return address information for the job. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress ReturnAddress { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress ReturnAddress { get; set; } /// The city name to use when returning the drives. string ReturnAddressCity { get; set; } /// The country or region to use when returning the drives. @@ -828,7 +965,7 @@ internal partial interface IJobDetailsInternal /// The format is the same as the deliveryPackage property above. This property is not included if the drives have not yet /// been returned. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation ReturnPackage { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation ReturnPackage { get; set; } /// The name of the carrier that is used to ship the import or export drives. string ReturnPackageCarrierName { get; set; } /// The number of drives included in the package. @@ -838,7 +975,7 @@ internal partial interface IJobDetailsInternal /// The tracking number of the package. string ReturnPackageTrackingNumber { get; set; } /// Specifies the return carrier and customer's account with the carrier. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping ReturnShipping { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping ReturnShipping { get; set; } /// The customer's account number with the carrier. string ReturnShippingCarrierAccountNumber { get; set; } /// The carrier's name. @@ -846,7 +983,7 @@ internal partial interface IJobDetailsInternal /// /// Contains information about the Microsoft datacenter to which the drives should be shipped. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation ShippingInformation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation ShippingInformation { get; set; } /// /// Additional shipping information for customer, specific to datacenter to which customer should send their disks. /// diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobDetails.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobDetails.json.cs similarity index 87% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobDetails.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobDetails.json.cs index db9cb7ab2ec9..66e154ea7ea6 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobDetails.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobDetails.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class JobDetails partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new JobDetails(json) : null; } @@ -77,24 +77,24 @@ internal JobDetails(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json { return; } - {_returnAddress = If( json?.PropertyT("returnAddress"), out var __jsonReturnAddress) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddress.FromJson(__jsonReturnAddress) : ReturnAddress;} - {_returnShipping = If( json?.PropertyT("returnShipping"), out var __jsonReturnShipping) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShipping.FromJson(__jsonReturnShipping) : ReturnShipping;} - {_shippingInformation = If( json?.PropertyT("shippingInformation"), out var __jsonShippingInformation) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ShippingInformation.FromJson(__jsonShippingInformation) : ShippingInformation;} - {_deliveryPackage = If( json?.PropertyT("deliveryPackage"), out var __jsonDeliveryPackage) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformation.FromJson(__jsonDeliveryPackage) : DeliveryPackage;} - {_returnPackage = If( json?.PropertyT("returnPackage"), out var __jsonReturnPackage) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PackageInformation.FromJson(__jsonReturnPackage) : ReturnPackage;} - {_export = If( json?.PropertyT("export"), out var __jsonExport) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.Export.FromJson(__jsonExport) : Export;} - {_encryptionKey = If( json?.PropertyT("encryptionKey"), out var __jsonEncryptionKey) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.EncryptionKeyDetails.FromJson(__jsonEncryptionKey) : EncryptionKey;} - {_storageAccountId = If( json?.PropertyT("storageAccountId"), out var __jsonStorageAccountId) ? (string)__jsonStorageAccountId : (string)StorageAccountId;} - {_jobType = If( json?.PropertyT("jobType"), out var __jsonJobType) ? (string)__jsonJobType : (string)JobType;} - {_diagnosticsPath = If( json?.PropertyT("diagnosticsPath"), out var __jsonDiagnosticsPath) ? (string)__jsonDiagnosticsPath : (string)DiagnosticsPath;} - {_logLevel = If( json?.PropertyT("logLevel"), out var __jsonLogLevel) ? (string)__jsonLogLevel : (string)LogLevel;} - {_backupDriveManifest = If( json?.PropertyT("backupDriveManifest"), out var __jsonBackupDriveManifest) ? (bool?)__jsonBackupDriveManifest : BackupDriveManifest;} - {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} - {_cancelRequested = If( json?.PropertyT("cancelRequested"), out var __jsonCancelRequested) ? (bool?)__jsonCancelRequested : CancelRequested;} - {_percentComplete = If( json?.PropertyT("percentComplete"), out var __jsonPercentComplete) ? (long?)__jsonPercentComplete : PercentComplete;} - {_incompleteBlobListUri = If( json?.PropertyT("incompleteBlobListUri"), out var __jsonIncompleteBlobListUri) ? (string)__jsonIncompleteBlobListUri : (string)IncompleteBlobListUri;} - {_driveList = If( json?.PropertyT("driveList"), out var __jsonDriveList) ? If( __jsonDriveList as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatus.FromJson(__u) )) ))() : null : DriveList;} - {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_returnAddress = If( json?.PropertyT("returnAddress"), out var __jsonReturnAddress) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddress.FromJson(__jsonReturnAddress) : _returnAddress;} + {_returnShipping = If( json?.PropertyT("returnShipping"), out var __jsonReturnShipping) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShipping.FromJson(__jsonReturnShipping) : _returnShipping;} + {_shippingInformation = If( json?.PropertyT("shippingInformation"), out var __jsonShippingInformation) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ShippingInformation.FromJson(__jsonShippingInformation) : _shippingInformation;} + {_deliveryPackage = If( json?.PropertyT("deliveryPackage"), out var __jsonDeliveryPackage) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformation.FromJson(__jsonDeliveryPackage) : _deliveryPackage;} + {_returnPackage = If( json?.PropertyT("returnPackage"), out var __jsonReturnPackage) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PackageInformation.FromJson(__jsonReturnPackage) : _returnPackage;} + {_export = If( json?.PropertyT("export"), out var __jsonExport) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Export.FromJson(__jsonExport) : _export;} + {_encryptionKey = If( json?.PropertyT("encryptionKey"), out var __jsonEncryptionKey) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.EncryptionKeyDetails.FromJson(__jsonEncryptionKey) : _encryptionKey;} + {_storageAccountId = If( json?.PropertyT("storageAccountId"), out var __jsonStorageAccountId) ? (string)__jsonStorageAccountId : (string)_storageAccountId;} + {_jobType = If( json?.PropertyT("jobType"), out var __jsonJobType) ? (string)__jsonJobType : (string)_jobType;} + {_diagnosticsPath = If( json?.PropertyT("diagnosticsPath"), out var __jsonDiagnosticsPath) ? (string)__jsonDiagnosticsPath : (string)_diagnosticsPath;} + {_logLevel = If( json?.PropertyT("logLevel"), out var __jsonLogLevel) ? (string)__jsonLogLevel : (string)_logLevel;} + {_backupDriveManifest = If( json?.PropertyT("backupDriveManifest"), out var __jsonBackupDriveManifest) ? (bool?)__jsonBackupDriveManifest : _backupDriveManifest;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)_state;} + {_cancelRequested = If( json?.PropertyT("cancelRequested"), out var __jsonCancelRequested) ? (bool?)__jsonCancelRequested : _cancelRequested;} + {_percentComplete = If( json?.PropertyT("percentComplete"), out var __jsonPercentComplete) ? (long?)__jsonPercentComplete : _percentComplete;} + {_incompleteBlobListUri = If( json?.PropertyT("incompleteBlobListUri"), out var __jsonIncompleteBlobListUri) ? (string)__jsonIncompleteBlobListUri : (string)_incompleteBlobListUri;} + {_driveList = If( json?.PropertyT("driveList"), out var __jsonDriveList) ? If( __jsonDriveList as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatus.FromJson(__u) )) ))() : null : _driveList;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)_provisioningState;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobResponse.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobResponse.PowerShell.cs new file mode 100644 index 000000000000..68d55670d531 --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobResponse.PowerShell.cs @@ -0,0 +1,716 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + + /// Contains the job information. + [System.ComponentModel.TypeConverter(typeof(JobResponseTypeConverter))] + public partial class JobResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new JobResponse(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new JobResponse(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal JobResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IdentityDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ReturnAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddressTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnShipping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShippingTypeConverter.ConvertFrom); + } + if (content.Contains("ShippingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformation = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation) content.GetValueForProperty("ShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformation, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ShippingInformationTypeConverter.ConvertFrom); + } + if (content.Contains("Export")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Export = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport) content.GetValueForProperty("Export",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Export, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DeliveryPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation) content.GetValueForProperty("ReturnPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.EncryptionKeyDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).JobType, global::System.Convert.ToString); + } + if (content.Contains("DiagnosticsPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DiagnosticsPath = (string) content.GetValueForProperty("DiagnosticsPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DiagnosticsPath, global::System.Convert.ToString); + } + if (content.Contains("LogLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).LogLevel, global::System.Convert.ToString); + } + if (content.Contains("BackupDriveManifest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).State, global::System.Convert.ToString); + } + if (content.Contains("CancelRequested")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncompleteBlobListUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IncompleteBlobListUri = (string) content.GetValueForProperty("IncompleteBlobListUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IncompleteBlobListUri, global::System.Convert.ToString); + } + if (content.Contains("DriveList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DriveList = (System.Collections.Generic.List) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DriveList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressCity, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressPhone, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressEmail, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationRecipientName = (string) content.GetValueForProperty("ShippingInformationRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationStreetAddress1 = (string) content.GetValueForProperty("ShippingInformationStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationStreetAddress2 = (string) content.GetValueForProperty("ShippingInformationStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationCity = (string) content.GetValueForProperty("ShippingInformationCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationCity, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationPostalCode = (string) content.GetValueForProperty("ShippingInformationPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationPhone = (string) content.GetValueForProperty("ShippingInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationPhone, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationAdditionalInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationAdditionalInformation = (string) content.GetValueForProperty("ShippingInformationAdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationAdditionalInformation, global::System.Convert.ToString); + } + if (content.Contains("ExportBlobList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ExportBlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList) content.GetValueForProperty("ExportBlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ExportBlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportBlobListTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierAccountNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationStateOrProvince = (string) content.GetValueForProperty("ShippingInformationStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationCountryOrRegion = (string) content.GetValueForProperty("ShippingInformationCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DeliveryPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageCarrierName = (string) content.GetValueForProperty("ReturnPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageTrackingNumber = (string) content.GetValueForProperty("ReturnPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageDriveCount = (long?) content.GetValueForProperty("ReturnPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ReturnPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageShipDate = (string) content.GetValueForProperty("ReturnPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageShipDate, global::System.Convert.ToString); + } + if (content.Contains("ExportBlobListBlobPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ExportBlobListBlobPath = (string) content.GetValueForProperty("ExportBlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ExportBlobListBlobPath, global::System.Convert.ToString); + } + if (content.Contains("BlobPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).BlobPath = (System.Collections.Generic.List) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EncryptionKeyKekType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKeyKekType = (string) content.GetValueForProperty("EncryptionKeyKekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKeyKekType, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyKekUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKeyKekUrl = (string) content.GetValueForProperty("EncryptionKeyKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKeyKekUrl, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyKekVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKeyKekVaultResourceId = (string) content.GetValueForProperty("EncryptionKeyKekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKeyKekVaultResourceId, global::System.Convert.ToString); + } + if (content.Contains("BlobListBlobPathPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).BlobListBlobPathPrefix = (System.Collections.Generic.List) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal JobResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IdentityDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.AnyTypeConverter.ConvertFrom); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ReturnAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddressTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnShipping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShippingTypeConverter.ConvertFrom); + } + if (content.Contains("ShippingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformation = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation) content.GetValueForProperty("ShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformation, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ShippingInformationTypeConverter.ConvertFrom); + } + if (content.Contains("Export")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Export = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport) content.GetValueForProperty("Export",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).Export, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IdentityType = (string) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IdentityType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataCreatedByType = (string) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataCreatedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataLastModifiedByType = (string) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataLastModifiedByType, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("DeliveryPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation) content.GetValueForProperty("ReturnPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.EncryptionKeyDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).JobType, global::System.Convert.ToString); + } + if (content.Contains("DiagnosticsPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DiagnosticsPath = (string) content.GetValueForProperty("DiagnosticsPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DiagnosticsPath, global::System.Convert.ToString); + } + if (content.Contains("LogLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).LogLevel, global::System.Convert.ToString); + } + if (content.Contains("BackupDriveManifest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).State, global::System.Convert.ToString); + } + if (content.Contains("CancelRequested")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncompleteBlobListUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IncompleteBlobListUri = (string) content.GetValueForProperty("IncompleteBlobListUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IncompleteBlobListUri, global::System.Convert.ToString); + } + if (content.Contains("DriveList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DriveList = (System.Collections.Generic.List) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DriveList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressCity, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressPhone, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressEmail, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationRecipientName = (string) content.GetValueForProperty("ShippingInformationRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationStreetAddress1 = (string) content.GetValueForProperty("ShippingInformationStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationStreetAddress2 = (string) content.GetValueForProperty("ShippingInformationStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationCity = (string) content.GetValueForProperty("ShippingInformationCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationCity, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationPostalCode = (string) content.GetValueForProperty("ShippingInformationPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationPhone = (string) content.GetValueForProperty("ShippingInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationPhone, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationAdditionalInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationAdditionalInformation = (string) content.GetValueForProperty("ShippingInformationAdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationAdditionalInformation, global::System.Convert.ToString); + } + if (content.Contains("ExportBlobList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ExportBlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList) content.GetValueForProperty("ExportBlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ExportBlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportBlobListTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierAccountNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationStateOrProvince = (string) content.GetValueForProperty("ShippingInformationStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationCountryOrRegion = (string) content.GetValueForProperty("ShippingInformationCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ShippingInformationCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DeliveryPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageCarrierName = (string) content.GetValueForProperty("ReturnPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageTrackingNumber = (string) content.GetValueForProperty("ReturnPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageDriveCount = (long?) content.GetValueForProperty("ReturnPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ReturnPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageShipDate = (string) content.GetValueForProperty("ReturnPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ReturnPackageShipDate, global::System.Convert.ToString); + } + if (content.Contains("ExportBlobListBlobPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ExportBlobListBlobPath = (string) content.GetValueForProperty("ExportBlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).ExportBlobListBlobPath, global::System.Convert.ToString); + } + if (content.Contains("BlobPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).BlobPath = (System.Collections.Generic.List) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EncryptionKeyKekType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKeyKekType = (string) content.GetValueForProperty("EncryptionKeyKekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKeyKekType, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyKekUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKeyKekUrl = (string) content.GetValueForProperty("EncryptionKeyKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKeyKekUrl, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyKekVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKeyKekVaultResourceId = (string) content.GetValueForProperty("EncryptionKeyKekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).EncryptionKeyKekVaultResourceId, global::System.Convert.ToString); + } + if (content.Contains("BlobListBlobPathPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).BlobListBlobPathPrefix = (System.Collections.Generic.List) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Contains the job information. + [System.ComponentModel.TypeConverter(typeof(JobResponseTypeConverter))] + public partial interface IJobResponse + + { + + } +} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobResponse.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobResponse.TypeConverter.cs similarity index 98% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobResponse.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobResponse.TypeConverter.cs index 6a5ef3729491..d61c39185dec 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobResponse.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobResponse.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobResponse.cs similarity index 66% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobResponse.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobResponse.cs index c66d55f253ee..20e8a8124175 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobResponse.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobResponse.cs @@ -3,81 +3,81 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Contains the job information. public partial class JobResponse : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal { /// /// Default value is false. Indicates whether the manifest files on the drives should be copied to block blobs. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public bool? BackupDriveManifest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).BackupDriveManifest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).BackupDriveManifest = value ?? default(bool); } + public bool? BackupDriveManifest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).BackupDriveManifest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).BackupDriveManifest = value ?? default(bool); } /// A collection of blob-prefix strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string[] BlobListBlobPathPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).BlobListBlobPathPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).BlobListBlobPathPrefix = value ?? null /* arrayOf */; } + public System.Collections.Generic.List BlobListBlobPathPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).BlobListBlobPathPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).BlobListBlobPathPrefix = value ?? null /* arrayOf */; } /// A collection of blob-path strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string[] BlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).BlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).BlobPath = value ?? null /* arrayOf */; } + public System.Collections.Generic.List BlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).BlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).BlobPath = value ?? null /* arrayOf */; } /// Indicates whether a request has been submitted to cancel the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public bool? CancelRequested { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).CancelRequested; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).CancelRequested = value ?? default(bool); } + public bool? CancelRequested { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).CancelRequested; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).CancelRequested = value ?? default(bool); } /// The name of the carrier that is used to ship the import or export drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageCarrierName = value ?? null; } + public string DeliveryPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageCarrierName = value ?? null; } /// The number of drives included in the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public long? DeliveryPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageDriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageDriveCount = value ?? default(long); } + public long? DeliveryPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageDriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageDriveCount = value ?? default(long); } /// The date when the package is shipped. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageShipDate = value ?? null; } + public string DeliveryPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageShipDate = value ?? null; } /// The tracking number of the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageTrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageTrackingNumber = value ?? null; } + public string DeliveryPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageTrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageTrackingNumber = value ?? null; } /// /// The virtual blob directory to which the copy logs and backups of drive manifest files (if enabled) will be stored. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DiagnosticsPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DiagnosticsPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DiagnosticsPath = value ?? null; } + public string DiagnosticsPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DiagnosticsPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DiagnosticsPath = value ?? null; } /// /// List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is not specified /// for export jobs. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DriveList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DriveList = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DriveList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DriveList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DriveList = value ?? null /* arrayOf */; } /// The type of kek encryption key [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType? EncryptionKeyKekType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKeyKekType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKeyKekType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType)""); } + public string EncryptionKeyKekType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKeyKekType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKeyKekType = value ?? null; } /// Specifies the url for kek encryption key. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string EncryptionKeyKekUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKeyKekUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKeyKekUrl = value ?? null; } + public string EncryptionKeyKekUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKeyKekUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKeyKekUrl = value ?? null; } /// Specifies the keyvault resource id for kek encryption key. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string EncryptionKeyKekVaultResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKeyKekVaultResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKeyKekVaultResourceId = value ?? null; } + public string EncryptionKeyKekVaultResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKeyKekVaultResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKeyKekVaultResourceId = value ?? null; } /// /// The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning /// with the container name. If the blob is in root container, the URI must begin with $root. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ExportBlobListBlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ExportBlobListBlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ExportBlobListBlobPath = value ?? null; } + public string ExportBlobListBlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ExportBlobListBlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ExportBlobListBlobPath = value ?? null; } /// Backing field for property. private string _id; @@ -87,34 +87,34 @@ public partial class JobResponse : public string Id { get => this._id; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails _identity; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails _identity; /// Specifies the job identity details [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IdentityDetails()); set => this._identity = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IdentityDetails()); set => this._identity = value; } /// Specifies the principal id for the identity for the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)Identity).PrincipalId; } + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)Identity).PrincipalId; } /// Specifies the tenant id for the identity for the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)Identity).TenantId; } + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)Identity).TenantId; } /// The type of identity [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType)""); } + public string IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)Identity).Type = value ?? null; } /// /// A blob path that points to a block blob containing a list of blob names that were not exported due to insufficient drive /// space. If all blobs were exported successfully, then this element is not included in the response. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string IncompleteBlobListUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).IncompleteBlobListUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).IncompleteBlobListUri = value ?? null; } + public string IncompleteBlobListUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).IncompleteBlobListUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).IncompleteBlobListUri = value ?? null; } /// The type of job [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string JobType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).JobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).JobType = value ?? null; } + public string JobType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).JobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).JobType = value ?? null; } /// Backing field for property. private string _location; @@ -127,58 +127,76 @@ public partial class JobResponse : /// Default value is Error. Indicates whether error logging or verbose logging will be enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string LogLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).LogLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).LogLevel = value ?? null; } + public string LogLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).LogLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).LogLevel = value ?? null; } /// Internal Acessors for DeliveryPackage - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.DeliveryPackage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackage = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.DeliveryPackage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackage = value; } /// Internal Acessors for EncryptionKey - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.EncryptionKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKey = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.EncryptionKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKey = value; } /// Internal Acessors for Export - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.Export { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).Export; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).Export = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.Export { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).Export; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).Export = value; } /// Internal Acessors for ExportBlobList - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.ExportBlobList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ExportBlobList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ExportBlobList = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.ExportBlobList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ExportBlobList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ExportBlobList = value; } /// Internal Acessors for Id - string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.Id { get => this._id; set { {_id = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.Id { get => this._id; set { {_id = value;} } } /// Internal Acessors for Identity - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IdentityDetails()); set { {_identity = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IdentityDetails()); set { {_identity = value;} } } /// Internal Acessors for IdentityPrincipalId - string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)Identity).PrincipalId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)Identity).PrincipalId = value; } /// Internal Acessors for IdentityTenantId - string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetailsInternal)Identity).TenantId = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetailsInternal)Identity).TenantId = value; } /// Internal Acessors for Name - string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.Name { get => this._name; set { {_name = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.Name { get => this._name; set { {_name = value;} } } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobDetails()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobDetails()); set { {_property = value;} } } /// Internal Acessors for ReturnAddress - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.ReturnAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddress = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.ReturnAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddress = value; } /// Internal Acessors for ReturnPackage - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.ReturnPackage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackage = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.ReturnPackage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackage = value; } /// Internal Acessors for ReturnShipping - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.ReturnShipping { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnShipping; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnShipping = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.ReturnShipping { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnShipping; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnShipping = value; } /// Internal Acessors for ShippingInformation - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.ShippingInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformation = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.ShippingInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformation = value; } /// Internal Acessors for ShippingInformationAdditionalInformation - string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.ShippingInformationAdditionalInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationAdditionalInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationAdditionalInformation = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.ShippingInformationAdditionalInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationAdditionalInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationAdditionalInformation = value; } /// Internal Acessors for SystemData - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.SystemData()); set { {_systemData = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.SystemData()); set { {_systemData = value;} } } + + /// Internal Acessors for SystemDataCreatedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).CreatedAt = value; } + + /// Internal Acessors for SystemDataCreatedBy + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).CreatedBy = value; } + + /// Internal Acessors for SystemDataCreatedByType + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).CreatedByType = value; } + + /// Internal Acessors for SystemDataLastModifiedAt + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).LastModifiedAt = value; } + + /// Internal Acessors for SystemDataLastModifiedBy + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).LastModifiedBy = value; } + + /// Internal Acessors for SystemDataLastModifiedByType + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).LastModifiedByType = value; } /// Internal Acessors for Type - string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponseInternal.Type { get => this._type; set { {_type = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponseInternal.Type { get => this._type; set { {_type = value;} } } /// Backing field for property. private string _name; @@ -189,161 +207,165 @@ public partial class JobResponse : /// Overall percentage completed for the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public long? PercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).PercentComplete; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).PercentComplete = value ?? default(long); } + public long? PercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).PercentComplete; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).PercentComplete = value ?? default(long); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails _property; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails _property; /// Specifies the job properties [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobDetails()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobDetails()); set => this._property = value; } /// Specifies the provisioning state of the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ProvisioningState = value ?? null; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ProvisioningState = value ?? null; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// The city name to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressCity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressCity = value ?? null; } + public string ReturnAddressCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressCity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressCity = value ?? null; } /// The country or region to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressCountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressCountryOrRegion = value ?? null; } + public string ReturnAddressCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressCountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressCountryOrRegion = value ?? null; } /// Email address of the recipient of the returned drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressEmail = value ?? null; } + public string ReturnAddressEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressEmail = value ?? null; } /// Phone number of the recipient of the returned drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressPhone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressPhone = value ?? null; } + public string ReturnAddressPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressPhone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressPhone = value ?? null; } /// The postal code to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressPostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressPostalCode = value ?? null; } + public string ReturnAddressPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressPostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressPostalCode = value ?? null; } /// /// The name of the recipient who will receive the hard drives when they are returned. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressRecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressRecipientName = value ?? null; } + public string ReturnAddressRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressRecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressRecipientName = value ?? null; } /// The state or province to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressStateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressStateOrProvince = value ?? null; } + public string ReturnAddressStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressStateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressStateOrProvince = value ?? null; } /// The first line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressStreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressStreetAddress1 = value ?? null; } + public string ReturnAddressStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressStreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressStreetAddress1 = value ?? null; } /// The second line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressStreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressStreetAddress2 = value ?? null; } + public string ReturnAddressStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressStreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressStreetAddress2 = value ?? null; } /// The name of the carrier that is used to ship the import or export drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageCarrierName = value ?? null; } + public string ReturnPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageCarrierName = value ?? null; } /// The number of drives included in the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public long? ReturnPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageDriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageDriveCount = value ?? default(long); } + public long? ReturnPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageDriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageDriveCount = value ?? default(long); } /// The date when the package is shipped. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageShipDate = value ?? null; } + public string ReturnPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageShipDate = value ?? null; } /// The tracking number of the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageTrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageTrackingNumber = value ?? null; } + public string ReturnPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageTrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageTrackingNumber = value ?? null; } /// The customer's account number with the carrier. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnShippingCarrierAccountNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnShippingCarrierAccountNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnShippingCarrierAccountNumber = value ?? null; } + public string ReturnShippingCarrierAccountNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnShippingCarrierAccountNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnShippingCarrierAccountNumber = value ?? null; } /// The carrier's name. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnShippingCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnShippingCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnShippingCarrierName = value ?? null; } + public string ReturnShippingCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnShippingCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnShippingCarrierName = value ?? null; } /// /// Additional shipping information for customer, specific to datacenter to which customer should send their disks. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationAdditionalInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationAdditionalInformation; } + public string ShippingInformationAdditionalInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationAdditionalInformation; } /// The city name to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationCity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationCity = value ?? null; } + public string ShippingInformationCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationCity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationCity = value ?? null; } /// The country or region to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationCountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationCountryOrRegion = value ?? null; } + public string ShippingInformationCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationCountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationCountryOrRegion = value ?? null; } /// Phone number of the recipient of the returned drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationPhone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationPhone = value ?? null; } + public string ShippingInformationPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationPhone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationPhone = value ?? null; } /// The postal code to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationPostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationPostalCode = value ?? null; } + public string ShippingInformationPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationPostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationPostalCode = value ?? null; } /// /// The name of the recipient who will receive the hard drives when they are returned. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationRecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationRecipientName = value ?? null; } + public string ShippingInformationRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationRecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationRecipientName = value ?? null; } /// The state or province to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationStateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationStateOrProvince = value ?? null; } + public string ShippingInformationStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationStateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationStateOrProvince = value ?? null; } /// The first line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationStreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationStreetAddress1 = value ?? null; } + public string ShippingInformationStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationStreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationStreetAddress1 = value ?? null; } /// The second line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationStreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationStreetAddress2 = value ?? null; } + public string ShippingInformationStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationStreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationStreetAddress2 = value ?? null; } /// Current state of the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string State { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).State = value ?? null; } + public string State { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).State = value ?? null; } /// /// The resource identifier of the storage account where data will be imported to or exported from. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string StorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).StorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).StorageAccountId = value ?? null; } + public string StorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).StorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).StorageAccountId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData _systemData; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData _systemData; /// SystemData of ImportExport Jobs. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.SystemData()); } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.SystemData()); } /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).CreatedAt; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).CreatedBy; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType)""); } + public string SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).CreatedByType; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).LastModifiedAt; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).LastModifiedBy; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType)""); } + public string SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)SystemData).LastModifiedByType; } /// Backing field for property. private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny _tag; @@ -375,6 +397,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Default value is false. Indicates whether the manifest files on the drives should be copied to block blobs.", SerializedName = @"backupDriveManifest", PossibleTypes = new [] { typeof(bool) })] @@ -383,22 +408,31 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A collection of blob-prefix strings.", SerializedName = @"blobPathPrefix", PossibleTypes = new [] { typeof(string) })] - string[] BlobListBlobPathPrefix { get; set; } + System.Collections.Generic.List BlobListBlobPathPrefix { get; set; } /// A collection of blob-path strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A collection of blob-path strings.", SerializedName = @"blobPath", PossibleTypes = new [] { typeof(string) })] - string[] BlobPath { get; set; } + System.Collections.Generic.List BlobPath { get; set; } /// Indicates whether a request has been submitted to cancel the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether a request has been submitted to cancel the job.", SerializedName = @"cancelRequested", PossibleTypes = new [] { typeof(bool) })] @@ -407,6 +441,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the carrier that is used to ship the import or export drives.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -415,6 +452,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of drives included in the package.", SerializedName = @"driveCount", PossibleTypes = new [] { typeof(long) })] @@ -423,6 +463,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The date when the package is shipped.", SerializedName = @"shipDate", PossibleTypes = new [] { typeof(string) })] @@ -431,6 +474,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tracking number of the package.", SerializedName = @"trackingNumber", PossibleTypes = new [] { typeof(string) })] @@ -441,6 +487,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The virtual blob directory to which the copy logs and backups of drive manifest files (if enabled) will be stored.", SerializedName = @"diagnosticsPath", PossibleTypes = new [] { typeof(string) })] @@ -452,22 +501,32 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is not specified for export jobs.", SerializedName = @"driveList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus) })] + System.Collections.Generic.List DriveList { get; set; } /// The type of kek encryption key [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of kek encryption key", SerializedName = @"kekType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType? EncryptionKeyKekType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("MicrosoftManaged", "CustomerManaged")] + string EncryptionKeyKekType { get; set; } /// Specifies the url for kek encryption key. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the url for kek encryption key. ", SerializedName = @"kekUrl", PossibleTypes = new [] { typeof(string) })] @@ -476,6 +535,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the keyvault resource id for kek encryption key. ", SerializedName = @"kekVaultResourceID", PossibleTypes = new [] { typeof(string) })] @@ -487,6 +549,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning with the container name. If the blob is in root container, the URI must begin with $root. ", SerializedName = @"blobListBlobPath", PossibleTypes = new [] { typeof(string) })] @@ -495,6 +560,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the resource identifier of the job.", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -503,6 +571,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the principal id for the identity for the job. ", SerializedName = @"principalId", PossibleTypes = new [] { typeof(string) })] @@ -511,6 +582,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the tenant id for the identity for the job. ", SerializedName = @"tenantId", PossibleTypes = new [] { typeof(string) })] @@ -519,10 +593,14 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity", SerializedName = @"type", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType? IdentityType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned")] + string IdentityType { get; set; } /// /// A blob path that points to a block blob containing a list of blob names that were not exported due to insufficient drive /// space. If all blobs were exported successfully, then this element is not included in the response. @@ -530,6 +608,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A blob path that points to a block blob containing a list of blob names that were not exported due to insufficient drive space. If all blobs were exported successfully, then this element is not included in the response.", SerializedName = @"incompleteBlobListUri", PossibleTypes = new [] { typeof(string) })] @@ -538,6 +619,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of job", SerializedName = @"jobType", PossibleTypes = new [] { typeof(string) })] @@ -546,6 +630,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the Azure location where the job is created.", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -556,6 +643,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Default value is Error. Indicates whether error logging or verbose logging will be enabled.", SerializedName = @"logLevel", PossibleTypes = new [] { typeof(string) })] @@ -564,6 +654,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the name of the job.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -572,6 +665,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Overall percentage completed for the job.", SerializedName = @"percentComplete", PossibleTypes = new [] { typeof(long) })] @@ -580,6 +676,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the provisioning state of the job.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -588,6 +687,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The city name to use when returning the drives.", SerializedName = @"city", PossibleTypes = new [] { typeof(string) })] @@ -596,6 +698,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The country or region to use when returning the drives. ", SerializedName = @"countryOrRegion", PossibleTypes = new [] { typeof(string) })] @@ -604,6 +709,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email address of the recipient of the returned drives.", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -612,6 +720,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Phone number of the recipient of the returned drives.", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] @@ -620,6 +731,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The postal code to use when returning the drives.", SerializedName = @"postalCode", PossibleTypes = new [] { typeof(string) })] @@ -630,6 +744,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the recipient who will receive the hard drives when they are returned. ", SerializedName = @"recipientName", PossibleTypes = new [] { typeof(string) })] @@ -638,6 +755,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The state or province to use when returning the drives.", SerializedName = @"stateOrProvince", PossibleTypes = new [] { typeof(string) })] @@ -646,6 +766,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The first line of the street address to use when returning the drives. ", SerializedName = @"streetAddress1", PossibleTypes = new [] { typeof(string) })] @@ -654,6 +777,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The second line of the street address to use when returning the drives. ", SerializedName = @"streetAddress2", PossibleTypes = new [] { typeof(string) })] @@ -662,6 +788,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the carrier that is used to ship the import or export drives.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -670,6 +799,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of drives included in the package.", SerializedName = @"driveCount", PossibleTypes = new [] { typeof(long) })] @@ -678,6 +810,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The date when the package is shipped.", SerializedName = @"shipDate", PossibleTypes = new [] { typeof(string) })] @@ -686,6 +821,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tracking number of the package.", SerializedName = @"trackingNumber", PossibleTypes = new [] { typeof(string) })] @@ -694,6 +832,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The customer's account number with the carrier.", SerializedName = @"carrierAccountNumber", PossibleTypes = new [] { typeof(string) })] @@ -702,6 +843,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The carrier's name.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -712,6 +856,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Additional shipping information for customer, specific to datacenter to which customer should send their disks.", SerializedName = @"additionalInformation", PossibleTypes = new [] { typeof(string) })] @@ -720,6 +867,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The city name to use when returning the drives.", SerializedName = @"city", PossibleTypes = new [] { typeof(string) })] @@ -728,6 +878,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The country or region to use when returning the drives. ", SerializedName = @"countryOrRegion", PossibleTypes = new [] { typeof(string) })] @@ -736,6 +889,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Phone number of the recipient of the returned drives.", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] @@ -744,6 +900,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The postal code to use when returning the drives.", SerializedName = @"postalCode", PossibleTypes = new [] { typeof(string) })] @@ -754,6 +913,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the recipient who will receive the hard drives when they are returned. ", SerializedName = @"recipientName", PossibleTypes = new [] { typeof(string) })] @@ -762,6 +924,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The state or province to use when returning the drives.", SerializedName = @"stateOrProvince", PossibleTypes = new [] { typeof(string) })] @@ -770,6 +935,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The first line of the street address to use when returning the drives. ", SerializedName = @"streetAddress1", PossibleTypes = new [] { typeof(string) })] @@ -778,6 +946,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The second line of the street address to use when returning the drives. ", SerializedName = @"streetAddress2", PossibleTypes = new [] { typeof(string) })] @@ -786,6 +957,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Current state of the job.", SerializedName = @"state", PossibleTypes = new [] { typeof(string) })] @@ -796,6 +970,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource identifier of the storage account where data will be imported to or exported from.", SerializedName = @"storageAccountId", PossibleTypes = new [] { typeof(string) })] @@ -803,55 +980,78 @@ public partial interface IJobResponse : /// The timestamp of resource creation (UTC). [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataCreatedAt { get; set; } + global::System.DateTime? SystemDataCreatedAt { get; } /// The identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataCreatedBy { get; set; } + string SystemDataCreatedBy { get; } /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? SystemDataCreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] - global::System.DateTime? SystemDataLastModifiedAt { get; set; } + global::System.DateTime? SystemDataLastModifiedAt { get; } /// The identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] - string SystemDataLastModifiedBy { get; set; } + string SystemDataLastModifiedBy { get; } /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, - ReadOnly = false, + ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; } /// Specifies the tags that are assigned to the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the tags that are assigned to the job.", SerializedName = @"tags", PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny) })] @@ -860,6 +1060,9 @@ public partial interface IJobResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Specifies the type of the job resource.", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -875,15 +1078,15 @@ internal partial interface IJobResponseInternal /// bool? BackupDriveManifest { get; set; } /// A collection of blob-prefix strings. - string[] BlobListBlobPathPrefix { get; set; } + System.Collections.Generic.List BlobListBlobPathPrefix { get; set; } /// A collection of blob-path strings. - string[] BlobPath { get; set; } + System.Collections.Generic.List BlobPath { get; set; } /// Indicates whether a request has been submitted to cancel the job. bool? CancelRequested { get; set; } /// /// Contains information about the package being shipped by the customer to the Microsoft data center. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation DeliveryPackage { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation DeliveryPackage { get; set; } /// The name of the carrier that is used to ship the import or export drives. string DeliveryPackageCarrierName { get; set; } /// The number of drives included in the package. @@ -900,11 +1103,12 @@ internal partial interface IJobResponseInternal /// List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is not specified /// for export jobs. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get; set; } + System.Collections.Generic.List DriveList { get; set; } /// Contains information about the encryption key. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails EncryptionKey { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails EncryptionKey { get; set; } /// The type of kek encryption key - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType? EncryptionKeyKekType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("MicrosoftManaged", "CustomerManaged")] + string EncryptionKeyKekType { get; set; } /// Specifies the url for kek encryption key. string EncryptionKeyKekUrl { get; set; } /// Specifies the keyvault resource id for kek encryption key. @@ -913,9 +1117,9 @@ internal partial interface IJobResponseInternal /// A property containing information about the blobs to be exported for an export job. This property is included for export /// jobs only. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport Export { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport Export { get; set; } /// A list of the blobs to be exported. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList ExportBlobList { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList ExportBlobList { get; set; } /// /// The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning /// with the container name. If the blob is in root container, the URI must begin with $root. @@ -924,13 +1128,14 @@ internal partial interface IJobResponseInternal /// Specifies the resource identifier of the job. string Id { get; set; } /// Specifies the job identity details - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IIdentityDetails Identity { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IIdentityDetails Identity { get; set; } /// Specifies the principal id for the identity for the job. string IdentityPrincipalId { get; set; } /// Specifies the tenant id for the identity for the job. string IdentityTenantId { get; set; } /// The type of identity - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType? IdentityType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("None", "SystemAssigned", "UserAssigned")] + string IdentityType { get; set; } /// /// A blob path that points to a block blob containing a list of blob names that were not exported due to insufficient drive /// space. If all blobs were exported successfully, then this element is not included in the response. @@ -949,11 +1154,11 @@ internal partial interface IJobResponseInternal /// Overall percentage completed for the job. long? PercentComplete { get; set; } /// Specifies the job properties - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails Property { get; set; } /// Specifies the provisioning state of the job. string ProvisioningState { get; set; } /// Specifies the return address information for the job. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress ReturnAddress { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress ReturnAddress { get; set; } /// The city name to use when returning the drives. string ReturnAddressCity { get; set; } /// The country or region to use when returning the drives. @@ -979,7 +1184,7 @@ internal partial interface IJobResponseInternal /// The format is the same as the deliveryPackage property above. This property is not included if the drives have not yet /// been returned. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation ReturnPackage { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation ReturnPackage { get; set; } /// The name of the carrier that is used to ship the import or export drives. string ReturnPackageCarrierName { get; set; } /// The number of drives included in the package. @@ -989,7 +1194,7 @@ internal partial interface IJobResponseInternal /// The tracking number of the package. string ReturnPackageTrackingNumber { get; set; } /// Specifies the return carrier and customer's account with the carrier. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping ReturnShipping { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping ReturnShipping { get; set; } /// The customer's account number with the carrier. string ReturnShippingCarrierAccountNumber { get; set; } /// The carrier's name. @@ -997,7 +1202,7 @@ internal partial interface IJobResponseInternal /// /// Contains information about the Microsoft datacenter to which the drives should be shipped. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation ShippingInformation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation ShippingInformation { get; set; } /// /// Additional shipping information for customer, specific to datacenter to which customer should send their disks. /// @@ -1027,19 +1232,21 @@ internal partial interface IJobResponseInternal /// string StorageAccountId { get; set; } /// SystemData of ImportExport Jobs. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData SystemData { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData SystemData { get; set; } /// The timestamp of resource creation (UTC). global::System.DateTime? SystemDataCreatedAt { get; set; } /// The identity that created the resource. string SystemDataCreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? SystemDataCreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataCreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? SystemDataLastModifiedAt { get; set; } /// The identity that last modified the resource. string SystemDataLastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string SystemDataLastModifiedByType { get; set; } /// Specifies the tags that are assigned to the job. Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IAny Tag { get; set; } /// Specifies the type of the job resource. diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobResponse.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobResponse.json.cs similarity index 90% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobResponse.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobResponse.json.cs index 8eb22a096763..cc130c39b090 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/JobResponse.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/JobResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class JobResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new JobResponse(json) : null; } @@ -77,14 +77,14 @@ internal JobResponse(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Jso { return; } - {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobDetails.FromJson(__jsonProperties) : Property;} - {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IdentityDetails.FromJson(__jsonIdentity) : Identity;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Any.FromJson(__jsonTags) : Tag;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.SystemData.FromJson(__jsonSystemData) : _systemData;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobDetails.FromJson(__jsonProperties) : _property;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IdentityDetails.FromJson(__jsonIdentity) : _identity;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Any.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } @@ -107,21 +107,21 @@ public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode ToJ { return container; } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeRead)) { AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); } AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); } - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListJobsResponse.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListJobsResponse.PowerShell.cs similarity index 70% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListJobsResponse.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListJobsResponse.PowerShell.cs index 706f701f5666..d88221e5820a 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListJobsResponse.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListJobsResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ListJobsResponse partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ListJobsResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ListJobsResponse(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,17 +111,17 @@ internal ListJobsResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponseInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobResponseTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,11 +136,11 @@ internal ListJobsResponse(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("NextLink")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponseInternal)this).NextLink, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponseInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponseInternal)this).NextLink, global::System.Convert.ToString); } if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobResponseTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobResponseTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -141,6 +149,18 @@ internal ListJobsResponse(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// List jobs response [System.ComponentModel.TypeConverter(typeof(ListJobsResponseTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListJobsResponse.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListJobsResponse.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListJobsResponse.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListJobsResponse.TypeConverter.cs index 9eac0ef9dbff..516454e8ad0f 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListJobsResponse.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListJobsResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListJobsResponse.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListJobsResponse.cs similarity index 72% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListJobsResponse.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListJobsResponse.cs index a44aea83dbe0..6abd1ed998ad 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListJobsResponse.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListJobsResponse.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// List jobs response public partial class ListJobsResponse : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponse, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponseInternal { /// Backing field for property. @@ -21,11 +21,11 @@ public partial class ListJobsResponse : public string NextLink { get => this._nextLink; set => this._nextLink = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse[] _value; + private System.Collections.Generic.List _value; /// Job list [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public ListJobsResponse() @@ -41,6 +41,9 @@ public partial interface IListJobsResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"link to next batch of jobs", SerializedName = @"nextLink", PossibleTypes = new [] { typeof(string) })] @@ -49,10 +52,13 @@ public partial interface IListJobsResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Job list", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse) })] + System.Collections.Generic.List Value { get; set; } } /// List jobs response @@ -62,7 +68,7 @@ internal partial interface IListJobsResponseInternal /// link to next batch of jobs string NextLink { get; set; } /// Job list - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListJobsResponse.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListJobsResponse.json.cs similarity index 90% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListJobsResponse.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListJobsResponse.json.cs index a29ccd9bbb3b..67a216f2401b 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListJobsResponse.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListJobsResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ListJobsResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new ListJobsResponse(json) : null; } @@ -77,8 +77,8 @@ internal ListJobsResponse(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtim { return; } - {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobResponse.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)_nextLink;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobResponse.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListOperationsResponse.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListOperationsResponse.PowerShell.cs similarity index 73% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListOperationsResponse.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListOperationsResponse.PowerShell.cs index 72a63caa695f..715555ceb8a1 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListOperationsResponse.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListOperationsResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ListOperationsResponse partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ListOperationsResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ListOperationsResponse(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,13 +111,13 @@ internal ListOperationsResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.OperationTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -124,7 +132,7 @@ internal ListOperationsResponse(global::System.Management.Automation.PSObject co // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.OperationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.OperationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -133,6 +141,18 @@ internal ListOperationsResponse(global::System.Management.Automation.PSObject co /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// List operations response [System.ComponentModel.TypeConverter(typeof(ListOperationsResponseTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListOperationsResponse.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListOperationsResponse.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListOperationsResponse.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListOperationsResponse.TypeConverter.cs index bbed9ca9a97e..968d73bf2700 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListOperationsResponse.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListOperationsResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListOperationsResponse.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListOperationsResponse.cs similarity index 65% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListOperationsResponse.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListOperationsResponse.cs index f30941176fdc..fa9750364f5e 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListOperationsResponse.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListOperationsResponse.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// List operations response public partial class ListOperationsResponse : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponse, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponse, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponseInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation[] _value; + private System.Collections.Generic.List _value; /// operations [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public ListOperationsResponse() @@ -34,10 +34,13 @@ public partial interface IListOperationsResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"operations", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation) })] + System.Collections.Generic.List Value { get; set; } } /// List operations response @@ -45,7 +48,7 @@ internal partial interface IListOperationsResponseInternal { /// operations - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListOperationsResponse.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListOperationsResponse.json.cs similarity index 91% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListOperationsResponse.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListOperationsResponse.json.cs index 033483a59a1f..d1e1bb9a6302 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ListOperationsResponse.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ListOperationsResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ListOperationsResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new ListOperationsResponse(json) : null; } @@ -77,7 +77,7 @@ internal ListOperationsResponse(Microsoft.Azure.PowerShell.Cmdlets.ImportExport. { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.Operation.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Operation.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Location.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Location.PowerShell.cs new file mode 100644 index 000000000000..9448efc2c5cc --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Location.PowerShell.cs @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + + /// Provides information about an Azure data center location. + [System.ComponentModel.TypeConverter(typeof(LocationTypeConverter))] + public partial class Location + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Location(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Location(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Location(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.LocationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("RecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).RecipientName, global::System.Convert.ToString); + } + if (content.Contains("StreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).StreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("StreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).StreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("City")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).City, global::System.Convert.ToString); + } + if (content.Contains("StateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).StateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("PostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).PostalCode, global::System.Convert.ToString); + } + if (content.Contains("CountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).CountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("Phone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Phone, global::System.Convert.ToString); + } + if (content.Contains("AdditionalShippingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).AdditionalShippingInformation = (string) content.GetValueForProperty("AdditionalShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).AdditionalShippingInformation, global::System.Convert.ToString); + } + if (content.Contains("SupportedCarrier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).SupportedCarrier = (System.Collections.Generic.List) content.GetValueForProperty("SupportedCarrier",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).SupportedCarrier, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AlternateLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).AlternateLocation = (System.Collections.Generic.List) content.GetValueForProperty("AlternateLocation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).AlternateLocation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Location(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.LocationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("RecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).RecipientName, global::System.Convert.ToString); + } + if (content.Contains("StreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).StreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("StreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).StreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("City")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).City, global::System.Convert.ToString); + } + if (content.Contains("StateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).StateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("PostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).PostalCode, global::System.Convert.ToString); + } + if (content.Contains("CountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).CountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("Phone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).Phone, global::System.Convert.ToString); + } + if (content.Contains("AdditionalShippingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).AdditionalShippingInformation = (string) content.GetValueForProperty("AdditionalShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).AdditionalShippingInformation, global::System.Convert.ToString); + } + if (content.Contains("SupportedCarrier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).SupportedCarrier = (System.Collections.Generic.List) content.GetValueForProperty("SupportedCarrier",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).SupportedCarrier, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("AlternateLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).AlternateLocation = (System.Collections.Generic.List) content.GetValueForProperty("AlternateLocation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal)this).AlternateLocation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Provides information about an Azure data center location. + [System.ComponentModel.TypeConverter(typeof(LocationTypeConverter))] + public partial interface ILocation + + { + + } +} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Location.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Location.TypeConverter.cs similarity index 98% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Location.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/Location.TypeConverter.cs index 8f701aa3963d..134b856d683d 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Location.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Location.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Location.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Location.cs similarity index 73% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Location.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/Location.cs index 52eab56a409b..2952a19d698e 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Location.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Location.cs @@ -3,21 +3,21 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Provides information about an Azure data center location. public partial class Location : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal { /// /// Additional shipping information for customer, specific to datacenter to which customer should send their disks. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string AdditionalShippingInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).AdditionalShippingInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).AdditionalShippingInformation = value ?? null; } + public string AdditionalShippingInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).AdditionalShippingInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).AdditionalShippingInformation = value ?? null; } /// /// A list of location IDs that should be used to ship shipping drives to for jobs created against the current location. If @@ -25,17 +25,17 @@ public partial class Location : /// may contain other locations. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string[] AlternateLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).AlternateLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).AlternateLocation = value ?? null /* arrayOf */; } + public System.Collections.Generic.List AlternateLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).AlternateLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).AlternateLocation = value ?? null /* arrayOf */; } /// The city name to use when shipping the drives to the Azure data center. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string City { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).City; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).City = value ?? null; } + public string City { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).City; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).City = value ?? null; } /// /// The country or region to use when shipping the drives to the Azure data center. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string CountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).CountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).CountryOrRegion = value ?? null; } + public string CountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).CountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).CountryOrRegion = value ?? null; } /// Backing field for property. private string _id; @@ -45,7 +45,7 @@ public partial class Location : public string Id { get => this._id; set => this._id = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.LocationProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.LocationProperties()); set { {_property = value;} } } /// Backing field for property. private string _name; @@ -58,44 +58,48 @@ public partial class Location : /// The phone number for the Azure data center. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string Phone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).Phone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).Phone = value ?? null; } + public string Phone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).Phone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).Phone = value ?? null; } /// The postal code to use when shipping the drives to the Azure data center. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string PostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).PostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).PostalCode = value ?? null; } + public string PostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).PostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).PostalCode = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties _property; /// location properties [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.LocationProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.LocationProperties()); set => this._property = value; } /// The recipient name to use when shipping the drives to the Azure data center. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string RecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).RecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).RecipientName = value ?? null; } + public string RecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).RecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).RecipientName = value ?? null; } + + /// Gets the resource group name + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] + public string ResourceGroupName { get => (new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Success ? new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(this.Id).Groups["resourceGroupName"].Value : null); } /// /// The state or province to use when shipping the drives to the Azure data center. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string StateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).StateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).StateOrProvince = value ?? null; } + public string StateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).StateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).StateOrProvince = value ?? null; } /// /// The first line of the street address to use when shipping the drives to the Azure data center. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string StreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).StreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).StreetAddress1 = value ?? null; } + public string StreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).StreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).StreetAddress1 = value ?? null; } /// /// The second line of the street address to use when shipping the drives to the Azure data center. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string StreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).StreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).StreetAddress2 = value ?? null; } + public string StreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).StreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).StreetAddress2 = value ?? null; } /// A list of carriers that are supported at this location. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string[] SupportedCarrier { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).SupportedCarrier; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal)Property).SupportedCarrier = value ?? null /* arrayOf */; } + public System.Collections.Generic.List SupportedCarrier { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).SupportedCarrier; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)Property).SupportedCarrier = value ?? null /* arrayOf */; } /// Backing field for property. private string _type; @@ -120,6 +124,9 @@ public partial interface ILocation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Additional shipping information for customer, specific to datacenter to which customer should send their disks.", SerializedName = @"additionalShippingInformation", PossibleTypes = new [] { typeof(string) })] @@ -132,14 +139,20 @@ public partial interface ILocation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of location IDs that should be used to ship shipping drives to for jobs created against the current location. If the current location is active, it will be part of the list. If it is temporarily closed due to maintenance, this list may contain other locations. ", SerializedName = @"alternateLocations", PossibleTypes = new [] { typeof(string) })] - string[] AlternateLocation { get; set; } + System.Collections.Generic.List AlternateLocation { get; set; } /// The city name to use when shipping the drives to the Azure data center. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The city name to use when shipping the drives to the Azure data center. ", SerializedName = @"city", PossibleTypes = new [] { typeof(string) })] @@ -150,6 +163,9 @@ public partial interface ILocation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The country or region to use when shipping the drives to the Azure data center. ", SerializedName = @"countryOrRegion", PossibleTypes = new [] { typeof(string) })] @@ -158,6 +174,9 @@ public partial interface ILocation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the resource identifier of the location. ", SerializedName = @"id", PossibleTypes = new [] { typeof(string) })] @@ -168,6 +187,9 @@ public partial interface ILocation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the name of the location. Use List Locations to get all supported locations. ", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -176,6 +198,9 @@ public partial interface ILocation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The phone number for the Azure data center. ", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] @@ -184,6 +209,9 @@ public partial interface ILocation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The postal code to use when shipping the drives to the Azure data center. ", SerializedName = @"postalCode", PossibleTypes = new [] { typeof(string) })] @@ -192,6 +220,9 @@ public partial interface ILocation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The recipient name to use when shipping the drives to the Azure data center. ", SerializedName = @"recipientName", PossibleTypes = new [] { typeof(string) })] @@ -202,6 +233,9 @@ public partial interface ILocation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The state or province to use when shipping the drives to the Azure data center. ", SerializedName = @"stateOrProvince", PossibleTypes = new [] { typeof(string) })] @@ -212,6 +246,9 @@ public partial interface ILocation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The first line of the street address to use when shipping the drives to the Azure data center. ", SerializedName = @"streetAddress1", PossibleTypes = new [] { typeof(string) })] @@ -222,6 +259,9 @@ public partial interface ILocation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The second line of the street address to use when shipping the drives to the Azure data center. ", SerializedName = @"streetAddress2", PossibleTypes = new [] { typeof(string) })] @@ -230,14 +270,20 @@ public partial interface ILocation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of carriers that are supported at this location. ", SerializedName = @"supportedCarriers", PossibleTypes = new [] { typeof(string) })] - string[] SupportedCarrier { get; set; } + System.Collections.Generic.List SupportedCarrier { get; set; } /// Specifies the type of the location. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the type of the location. ", SerializedName = @"type", PossibleTypes = new [] { typeof(string) })] @@ -257,7 +303,7 @@ internal partial interface ILocationInternal /// the current location is active, it will be part of the list. If it is temporarily closed due to maintenance, this list /// may contain other locations. /// - string[] AlternateLocation { get; set; } + System.Collections.Generic.List AlternateLocation { get; set; } /// The city name to use when shipping the drives to the Azure data center. string City { get; set; } /// @@ -275,7 +321,7 @@ internal partial interface ILocationInternal /// The postal code to use when shipping the drives to the Azure data center. string PostalCode { get; set; } /// location properties - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties Property { get; set; } /// The recipient name to use when shipping the drives to the Azure data center. string RecipientName { get; set; } /// @@ -291,7 +337,7 @@ internal partial interface ILocationInternal /// string StreetAddress2 { get; set; } /// A list of carriers that are supported at this location. - string[] SupportedCarrier { get; set; } + System.Collections.Generic.List SupportedCarrier { get; set; } /// Specifies the type of the location. string Type { get; set; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Location.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Location.json.cs similarity index 94% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Location.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/Location.json.cs index 37b97bd8e3a5..90067963070c 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Location.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Location.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Location partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new Location(json) : null; } @@ -77,10 +77,10 @@ internal Location(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.J { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.LocationProperties.FromJson(__jsonProperties) : Property;} - {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} - {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.LocationProperties.FromJson(__jsonProperties) : _property;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)_id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)_type;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Location.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationProperties.PowerShell.cs similarity index 58% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Location.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationProperties.PowerShell.cs index f11be8cb3ea2..d88194a34d78 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Location.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationProperties.PowerShell.cs @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; - /// Provides information about an Azure data center location. - [System.ComponentModel.TypeConverter(typeof(LocationTypeConverter))] - public partial class Location + /// location properties + [System.ComponentModel.TypeConverter(typeof(LocationPropertiesTypeConverter))] + public partial class LocationProperties { /// @@ -55,44 +55,52 @@ public partial class Location partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new Location(content); + return new LocationProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new Location(content); + return new LocationProperties(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal Location(global::System.Collections.IDictionary content) + internal LocationProperties(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -101,75 +109,59 @@ internal Location(global::System.Collections.IDictionary content) return; } // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.LocationPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Type, global::System.Convert.ToString); - } if (content.Contains("RecipientName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).RecipientName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).RecipientName, global::System.Convert.ToString); } if (content.Contains("StreetAddress1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).StreetAddress1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).StreetAddress1, global::System.Convert.ToString); } if (content.Contains("StreetAddress2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).StreetAddress2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).StreetAddress2, global::System.Convert.ToString); } if (content.Contains("City")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).City, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).City, global::System.Convert.ToString); } if (content.Contains("StateOrProvince")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).StateOrProvince, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).StateOrProvince, global::System.Convert.ToString); } if (content.Contains("PostalCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).PostalCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).PostalCode, global::System.Convert.ToString); } if (content.Contains("CountryOrRegion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).CountryOrRegion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).CountryOrRegion, global::System.Convert.ToString); } if (content.Contains("Phone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Phone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).Phone, global::System.Convert.ToString); } if (content.Contains("AdditionalShippingInformation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).AdditionalShippingInformation = (string) content.GetValueForProperty("AdditionalShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).AdditionalShippingInformation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).AdditionalShippingInformation = (string) content.GetValueForProperty("AdditionalShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).AdditionalShippingInformation, global::System.Convert.ToString); } if (content.Contains("SupportedCarrier")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).SupportedCarrier = (string[]) content.GetValueForProperty("SupportedCarrier",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).SupportedCarrier, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).SupportedCarrier = (System.Collections.Generic.List) content.GetValueForProperty("SupportedCarrier",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).SupportedCarrier, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AlternateLocation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).AlternateLocation = (string[]) content.GetValueForProperty("AlternateLocation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).AlternateLocation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).AlternateLocation = (System.Collections.Generic.List) content.GetValueForProperty("AlternateLocation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).AlternateLocation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal Location(global::System.Management.Automation.PSObject content) + internal LocationProperties(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -178,65 +170,49 @@ internal Location(global::System.Management.Automation.PSObject content) return; } // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.LocationPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Id")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Id, global::System.Convert.ToString); - } - if (content.Contains("Name")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Name, global::System.Convert.ToString); - } - if (content.Contains("Type")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Type, global::System.Convert.ToString); - } if (content.Contains("RecipientName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).RecipientName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).RecipientName, global::System.Convert.ToString); } if (content.Contains("StreetAddress1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).StreetAddress1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).StreetAddress1, global::System.Convert.ToString); } if (content.Contains("StreetAddress2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).StreetAddress2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).StreetAddress2, global::System.Convert.ToString); } if (content.Contains("City")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).City, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).City, global::System.Convert.ToString); } if (content.Contains("StateOrProvince")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).StateOrProvince, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).StateOrProvince, global::System.Convert.ToString); } if (content.Contains("PostalCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).PostalCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).PostalCode, global::System.Convert.ToString); } if (content.Contains("CountryOrRegion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).CountryOrRegion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).CountryOrRegion, global::System.Convert.ToString); } if (content.Contains("Phone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).Phone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).Phone, global::System.Convert.ToString); } if (content.Contains("AdditionalShippingInformation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).AdditionalShippingInformation = (string) content.GetValueForProperty("AdditionalShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).AdditionalShippingInformation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).AdditionalShippingInformation = (string) content.GetValueForProperty("AdditionalShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).AdditionalShippingInformation, global::System.Convert.ToString); } if (content.Contains("SupportedCarrier")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).SupportedCarrier = (string[]) content.GetValueForProperty("SupportedCarrier",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).SupportedCarrier, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).SupportedCarrier = (System.Collections.Generic.List) content.GetValueForProperty("SupportedCarrier",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).SupportedCarrier, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } if (content.Contains("AlternateLocation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).AlternateLocation = (string[]) content.GetValueForProperty("AlternateLocation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationInternal)this).AlternateLocation, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).AlternateLocation = (System.Collections.Generic.List) content.GetValueForProperty("AlternateLocation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal)this).AlternateLocation, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); } AfterDeserializePSObject(content); } @@ -245,10 +221,22 @@ internal Location(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } - /// Provides information about an Azure data center location. - [System.ComponentModel.TypeConverter(typeof(LocationTypeConverter))] - public partial interface ILocation + /// location properties + [System.ComponentModel.TypeConverter(typeof(LocationPropertiesTypeConverter))] + public partial interface ILocationProperties { diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationProperties.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationProperties.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationProperties.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationProperties.TypeConverter.cs index c5b84392fbc1..5a3af486335b 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationProperties.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationProperties.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationProperties.cs similarity index 89% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationProperties.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationProperties.cs index 1c07306c7056..b7f58c218348 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationProperties.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// location properties public partial class LocationProperties : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationPropertiesInternal { /// Backing field for property. @@ -23,7 +23,7 @@ public partial class LocationProperties : public string AdditionalShippingInformation { get => this._additionalShippingInformation; set => this._additionalShippingInformation = value; } /// Backing field for property. - private string[] _alternateLocation; + private System.Collections.Generic.List _alternateLocation; /// /// A list of location IDs that should be used to ship shipping drives to for jobs created against the current location. If @@ -31,7 +31,7 @@ public partial class LocationProperties : /// may contain other locations. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public string[] AlternateLocation { get => this._alternateLocation; set => this._alternateLocation = value; } + public System.Collections.Generic.List AlternateLocation { get => this._alternateLocation; set => this._alternateLocation = value; } /// Backing field for property. private string _city; @@ -98,11 +98,11 @@ public partial class LocationProperties : public string StreetAddress2 { get => this._streetAddress2; set => this._streetAddress2 = value; } /// Backing field for property. - private string[] _supportedCarrier; + private System.Collections.Generic.List _supportedCarrier; /// A list of carriers that are supported at this location. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public string[] SupportedCarrier { get => this._supportedCarrier; set => this._supportedCarrier = value; } + public System.Collections.Generic.List SupportedCarrier { get => this._supportedCarrier; set => this._supportedCarrier = value; } /// Creates an new instance. public LocationProperties() @@ -120,6 +120,9 @@ public partial interface ILocationProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Additional shipping information for customer, specific to datacenter to which customer should send their disks.", SerializedName = @"additionalShippingInformation", PossibleTypes = new [] { typeof(string) })] @@ -132,14 +135,20 @@ public partial interface ILocationProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of location IDs that should be used to ship shipping drives to for jobs created against the current location. If the current location is active, it will be part of the list. If it is temporarily closed due to maintenance, this list may contain other locations. ", SerializedName = @"alternateLocations", PossibleTypes = new [] { typeof(string) })] - string[] AlternateLocation { get; set; } + System.Collections.Generic.List AlternateLocation { get; set; } /// The city name to use when shipping the drives to the Azure data center. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The city name to use when shipping the drives to the Azure data center. ", SerializedName = @"city", PossibleTypes = new [] { typeof(string) })] @@ -150,6 +159,9 @@ public partial interface ILocationProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The country or region to use when shipping the drives to the Azure data center. ", SerializedName = @"countryOrRegion", PossibleTypes = new [] { typeof(string) })] @@ -158,6 +170,9 @@ public partial interface ILocationProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The phone number for the Azure data center. ", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] @@ -166,6 +181,9 @@ public partial interface ILocationProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The postal code to use when shipping the drives to the Azure data center. ", SerializedName = @"postalCode", PossibleTypes = new [] { typeof(string) })] @@ -174,6 +192,9 @@ public partial interface ILocationProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The recipient name to use when shipping the drives to the Azure data center. ", SerializedName = @"recipientName", PossibleTypes = new [] { typeof(string) })] @@ -184,6 +205,9 @@ public partial interface ILocationProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The state or province to use when shipping the drives to the Azure data center. ", SerializedName = @"stateOrProvince", PossibleTypes = new [] { typeof(string) })] @@ -194,6 +218,9 @@ public partial interface ILocationProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The first line of the street address to use when shipping the drives to the Azure data center. ", SerializedName = @"streetAddress1", PossibleTypes = new [] { typeof(string) })] @@ -204,6 +231,9 @@ public partial interface ILocationProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The second line of the street address to use when shipping the drives to the Azure data center. ", SerializedName = @"streetAddress2", PossibleTypes = new [] { typeof(string) })] @@ -212,10 +242,13 @@ public partial interface ILocationProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A list of carriers that are supported at this location. ", SerializedName = @"supportedCarriers", PossibleTypes = new [] { typeof(string) })] - string[] SupportedCarrier { get; set; } + System.Collections.Generic.List SupportedCarrier { get; set; } } /// location properties @@ -231,7 +264,7 @@ internal partial interface ILocationPropertiesInternal /// the current location is active, it will be part of the list. If it is temporarily closed due to maintenance, this list /// may contain other locations. /// - string[] AlternateLocation { get; set; } + System.Collections.Generic.List AlternateLocation { get; set; } /// The city name to use when shipping the drives to the Azure data center. string City { get; set; } /// @@ -257,7 +290,7 @@ internal partial interface ILocationPropertiesInternal /// string StreetAddress2 { get; set; } /// A list of carriers that are supported at this location. - string[] SupportedCarrier { get; set; } + System.Collections.Generic.List SupportedCarrier { get; set; } } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationProperties.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationProperties.json.cs similarity index 90% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationProperties.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationProperties.json.cs index d9fc4c4fb7c3..a60e9954fabf 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationProperties.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LocationProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new LocationProperties(json) : null; } @@ -77,17 +77,17 @@ internal LocationProperties(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runt { return; } - {_recipientName = If( json?.PropertyT("recipientName"), out var __jsonRecipientName) ? (string)__jsonRecipientName : (string)RecipientName;} - {_streetAddress1 = If( json?.PropertyT("streetAddress1"), out var __jsonStreetAddress1) ? (string)__jsonStreetAddress1 : (string)StreetAddress1;} - {_streetAddress2 = If( json?.PropertyT("streetAddress2"), out var __jsonStreetAddress2) ? (string)__jsonStreetAddress2 : (string)StreetAddress2;} - {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)City;} - {_stateOrProvince = If( json?.PropertyT("stateOrProvince"), out var __jsonStateOrProvince) ? (string)__jsonStateOrProvince : (string)StateOrProvince;} - {_postalCode = If( json?.PropertyT("postalCode"), out var __jsonPostalCode) ? (string)__jsonPostalCode : (string)PostalCode;} - {_countryOrRegion = If( json?.PropertyT("countryOrRegion"), out var __jsonCountryOrRegion) ? (string)__jsonCountryOrRegion : (string)CountryOrRegion;} - {_phone = If( json?.PropertyT("phone"), out var __jsonPhone) ? (string)__jsonPhone : (string)Phone;} - {_additionalShippingInformation = If( json?.PropertyT("additionalShippingInformation"), out var __jsonAdditionalShippingInformation) ? (string)__jsonAdditionalShippingInformation : (string)AdditionalShippingInformation;} - {_supportedCarrier = If( json?.PropertyT("supportedCarriers"), out var __jsonSupportedCarriers) ? If( __jsonSupportedCarriers as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SupportedCarrier;} - {_alternateLocation = If( json?.PropertyT("alternateLocations"), out var __jsonAlternateLocations) ? If( __jsonAlternateLocations as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : AlternateLocation;} + {_recipientName = If( json?.PropertyT("recipientName"), out var __jsonRecipientName) ? (string)__jsonRecipientName : (string)_recipientName;} + {_streetAddress1 = If( json?.PropertyT("streetAddress1"), out var __jsonStreetAddress1) ? (string)__jsonStreetAddress1 : (string)_streetAddress1;} + {_streetAddress2 = If( json?.PropertyT("streetAddress2"), out var __jsonStreetAddress2) ? (string)__jsonStreetAddress2 : (string)_streetAddress2;} + {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)_city;} + {_stateOrProvince = If( json?.PropertyT("stateOrProvince"), out var __jsonStateOrProvince) ? (string)__jsonStateOrProvince : (string)_stateOrProvince;} + {_postalCode = If( json?.PropertyT("postalCode"), out var __jsonPostalCode) ? (string)__jsonPostalCode : (string)_postalCode;} + {_countryOrRegion = If( json?.PropertyT("countryOrRegion"), out var __jsonCountryOrRegion) ? (string)__jsonCountryOrRegion : (string)_countryOrRegion;} + {_phone = If( json?.PropertyT("phone"), out var __jsonPhone) ? (string)__jsonPhone : (string)_phone;} + {_additionalShippingInformation = If( json?.PropertyT("additionalShippingInformation"), out var __jsonAdditionalShippingInformation) ? (string)__jsonAdditionalShippingInformation : (string)_additionalShippingInformation;} + {_supportedCarrier = If( json?.PropertyT("supportedCarriers"), out var __jsonSupportedCarriers) ? If( __jsonSupportedCarriers as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : _supportedCarrier;} + {_alternateLocation = If( json?.PropertyT("alternateLocations"), out var __jsonAlternateLocations) ? If( __jsonAlternateLocations as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __q) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : _alternateLocation;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationsResponse.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationsResponse.PowerShell.cs similarity index 73% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationsResponse.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationsResponse.PowerShell.cs index 033d9310ec04..7cc0167b7e15 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationsResponse.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationsResponse.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class LocationsResponse partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new LocationsResponse(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new LocationsResponse(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,13 +111,13 @@ internal LocationsResponse(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.LocationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.LocationTypeConverter.ConvertFrom)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -124,7 +132,7 @@ internal LocationsResponse(global::System.Management.Automation.PSObject content // actually deserialize if (content.Contains("Value")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponseInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.LocationTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponseInternal)this).Value = (System.Collections.Generic.List) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponseInternal)this).Value, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.LocationTypeConverter.ConvertFrom)); } AfterDeserializePSObject(content); } @@ -133,6 +141,18 @@ internal LocationsResponse(global::System.Management.Automation.PSObject content /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Locations response [System.ComponentModel.TypeConverter(typeof(LocationsResponseTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationsResponse.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationsResponse.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationsResponse.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationsResponse.TypeConverter.cs index 87105fb07dde..57d9cb9b4291 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationsResponse.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationsResponse.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponse ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponse ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponse).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponse).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationsResponse.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationsResponse.cs similarity index 65% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationsResponse.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationsResponse.cs index 5417528cdff4..1797cbaf1d0c 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationsResponse.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationsResponse.cs @@ -3,22 +3,22 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Locations response public partial class LocationsResponse : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponse, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponseInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponse, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponseInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation[] _value; + private System.Collections.Generic.List _value; /// locations [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation[] Value { get => this._value; set => this._value = value; } + public System.Collections.Generic.List Value { get => this._value; set => this._value = value; } /// Creates an new instance. public LocationsResponse() @@ -34,10 +34,13 @@ public partial interface ILocationsResponse : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"locations", SerializedName = @"value", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation[] Value { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation) })] + System.Collections.Generic.List Value { get; set; } } /// Locations response @@ -45,7 +48,7 @@ internal partial interface ILocationsResponseInternal { /// locations - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation[] Value { get; set; } + System.Collections.Generic.List Value { get; set; } } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationsResponse.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationsResponse.json.cs similarity index 91% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationsResponse.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationsResponse.json.cs index c232152f7b96..02f6b0643b58 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/LocationsResponse.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/LocationsResponse.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class LocationsResponse partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponse. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponse. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponse. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponse. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new LocationsResponse(json) : null; } @@ -77,7 +77,7 @@ internal LocationsResponse(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runti { return; } - {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.Location.FromJson(__u) )) ))() : null : Value;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Location.FromJson(__u) )) ))() : null : _value;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Operation.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Operation.PowerShell.cs similarity index 65% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Operation.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/Operation.PowerShell.cs index 509b1dec3ac2..baa4f9693f70 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Operation.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Operation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class Operation partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new Operation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new Operation(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,33 +111,33 @@ internal Operation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,27 +152,27 @@ internal Operation(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Display")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.OperationDisplayTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.OperationDisplayTypeConverter.ConvertFrom); } if (content.Contains("Name")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).Name, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).Name, global::System.Convert.ToString); } if (content.Contains("DisplayProvider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); } if (content.Contains("DisplayResource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); } if (content.Contains("DisplayOperation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); } if (content.Contains("DisplayDescription")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -173,6 +181,18 @@ internal Operation(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Describes a supported operation by the Storage Import/Export job API. [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Operation.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Operation.TypeConverter.cs similarity index 98% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Operation.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/Operation.TypeConverter.cs index 6ad8351bf952..57f9ca95ded8 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Operation.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Operation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Operation.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Operation.cs similarity index 74% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Operation.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/Operation.cs index 56a90aaa750c..aed967c37cff 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Operation.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Operation.cs @@ -3,41 +3,41 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Describes a supported operation by the Storage Import/Export job API. public partial class Operation : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal { /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay _display; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay _display; /// operation display properties [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.OperationDisplay()); set => this._display = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.OperationDisplay()); set => this._display = value; } /// Short description of the operation. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)Display).Description = value ?? null; } + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)Display).Description = value ?? null; } /// The display name of the operation. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)Display).Operation = value ?? null; } + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)Display).Operation = value ?? null; } /// The resource provider name to which the operation belongs. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)Display).Provider = value ?? null; } + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)Display).Provider = value ?? null; } /// The name of the resource to which the operation belongs. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)Display).Resource = value ?? null; } + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)Display).Resource = value ?? null; } /// Internal Acessors for Display - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.OperationDisplay()); set { {_display = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.OperationDisplay()); set { {_display = value;} } } /// Backing field for property. private string _name; @@ -60,6 +60,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Short description of the operation.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -68,6 +71,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The display name of the operation.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -76,6 +82,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource provider name to which the operation belongs.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -84,6 +93,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the resource to which the operation belongs.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] @@ -92,6 +104,9 @@ public partial interface IOperation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Name of the operation.", SerializedName = @"name", PossibleTypes = new [] { typeof(string) })] @@ -103,7 +118,7 @@ internal partial interface IOperationInternal { /// operation display properties - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay Display { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay Display { get; set; } /// Short description of the operation. string DisplayDescription { get; set; } /// The display name of the operation. diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Operation.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Operation.json.cs similarity index 94% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Operation.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/Operation.json.cs index 2353cd02fc2a..75c5f3d60510 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/Operation.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Operation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class Operation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new Operation(json) : null; } @@ -77,8 +77,8 @@ internal Operation(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json. { return; } - {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.OperationDisplay.FromJson(__jsonDisplay) : Display;} - {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.OperationDisplay.FromJson(__jsonDisplay) : _display;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)_name;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/OperationDisplay.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs similarity index 69% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/OperationDisplay.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs index 2fb64ea8e03d..2fad23795d79 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/OperationDisplay.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/OperationDisplay.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class OperationDisplay partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new OperationDisplay(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new OperationDisplay(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,25 +111,25 @@ internal OperationDisplay(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -136,19 +144,19 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("Provider")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); } if (content.Contains("Resource")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); } if (content.Contains("Operation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); } if (content.Contains("Description")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -157,6 +165,18 @@ internal OperationDisplay(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// operation display properties [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/OperationDisplay.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/OperationDisplay.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs index 446b3b61c76b..a22a23c404e6 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/OperationDisplay.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/OperationDisplay.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/OperationDisplay.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/OperationDisplay.cs similarity index 91% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/OperationDisplay.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/OperationDisplay.cs index 40b9dc3886ba..225ff8a5557d 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/OperationDisplay.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/OperationDisplay.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// operation display properties public partial class OperationDisplay : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplayInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplayInternal { /// Backing field for property. @@ -55,6 +55,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Short description of the operation.", SerializedName = @"description", PossibleTypes = new [] { typeof(string) })] @@ -63,6 +66,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The display name of the operation.", SerializedName = @"operation", PossibleTypes = new [] { typeof(string) })] @@ -71,6 +77,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource provider name to which the operation belongs.", SerializedName = @"provider", PossibleTypes = new [] { typeof(string) })] @@ -79,6 +88,9 @@ public partial interface IOperationDisplay : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the resource to which the operation belongs.", SerializedName = @"resource", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/OperationDisplay.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/OperationDisplay.json.cs similarity index 94% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/OperationDisplay.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/OperationDisplay.json.cs index c231ae13f32b..6fa34561af88 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/OperationDisplay.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/OperationDisplay.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class OperationDisplay partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; } @@ -77,10 +77,10 @@ internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtim { return; } - {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} - {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} - {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} - {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)_provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)_resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)_operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)_description;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PackageInformation.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PackageInformation.PowerShell.cs similarity index 69% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PackageInformation.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/PackageInformation.PowerShell.cs index 1c9139a237d1..d0256b80d680 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PackageInformation.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PackageInformation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -57,27 +57,35 @@ public partial class PackageInformation partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PackageInformation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PackageInformation(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,25 +113,25 @@ internal PackageInformation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("CarrierName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).CarrierName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).CarrierName, global::System.Convert.ToString); } if (content.Contains("TrackingNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).TrackingNumber = (string) content.GetValueForProperty("TrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).TrackingNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).TrackingNumber = (string) content.GetValueForProperty("TrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).TrackingNumber, global::System.Convert.ToString); } if (content.Contains("DriveCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).DriveCount = (long) content.GetValueForProperty("DriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).DriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).DriveCount = (long) content.GetValueForProperty("DriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).DriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("ShipDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).ShipDate = (string) content.GetValueForProperty("ShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).ShipDate, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).ShipDate = (string) content.GetValueForProperty("ShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).ShipDate, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -138,19 +146,19 @@ internal PackageInformation(global::System.Management.Automation.PSObject conten // actually deserialize if (content.Contains("CarrierName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).CarrierName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).CarrierName, global::System.Convert.ToString); } if (content.Contains("TrackingNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).TrackingNumber = (string) content.GetValueForProperty("TrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).TrackingNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).TrackingNumber = (string) content.GetValueForProperty("TrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).TrackingNumber, global::System.Convert.ToString); } if (content.Contains("DriveCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).DriveCount = (long) content.GetValueForProperty("DriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).DriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).DriveCount = (long) content.GetValueForProperty("DriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).DriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("ShipDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).ShipDate = (string) content.GetValueForProperty("ShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal)this).ShipDate, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).ShipDate = (string) content.GetValueForProperty("ShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal)this).ShipDate, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -159,6 +167,18 @@ internal PackageInformation(global::System.Management.Automation.PSObject conten /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Contains information about the package being shipped by the customer to the Microsoft data center. [System.ComponentModel.TypeConverter(typeof(PackageInformationTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PackageInformation.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PackageInformation.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PackageInformation.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/PackageInformation.TypeConverter.cs index 6e29eab389c5..543323fdbab7 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PackageInformation.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PackageInformation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PackageInformation.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PackageInformation.cs similarity index 91% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PackageInformation.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/PackageInformation.cs index 8e76cde5d7c1..f0e361f5aac0 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PackageInformation.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PackageInformation.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 /// Contains information about the package being shipped by the customer to the Microsoft data center. /// public partial class PackageInformation : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformationInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformationInternal { /// Backing field for property. @@ -57,6 +57,9 @@ public partial interface IPackageInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the carrier that is used to ship the import or export drives.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -65,6 +68,9 @@ public partial interface IPackageInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of drives included in the package.", SerializedName = @"driveCount", PossibleTypes = new [] { typeof(long) })] @@ -73,6 +79,9 @@ public partial interface IPackageInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The date when the package is shipped.", SerializedName = @"shipDate", PossibleTypes = new [] { typeof(string) })] @@ -81,6 +90,9 @@ public partial interface IPackageInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tracking number of the package.", SerializedName = @"trackingNumber", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PackageInformation.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PackageInformation.json.cs similarity index 94% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PackageInformation.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/PackageInformation.json.cs index 7547d0aae619..51bcc08c1456 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PackageInformation.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PackageInformation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class PackageInformation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new PackageInformation(json) : null; } @@ -79,10 +79,10 @@ internal PackageInformation(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runt { return; } - {_carrierName = If( json?.PropertyT("carrierName"), out var __jsonCarrierName) ? (string)__jsonCarrierName : (string)CarrierName;} - {_trackingNumber = If( json?.PropertyT("trackingNumber"), out var __jsonTrackingNumber) ? (string)__jsonTrackingNumber : (string)TrackingNumber;} - {_driveCount = If( json?.PropertyT("driveCount"), out var __jsonDriveCount) ? (long)__jsonDriveCount : DriveCount;} - {_shipDate = If( json?.PropertyT("shipDate"), out var __jsonShipDate) ? (string)__jsonShipDate : (string)ShipDate;} + {_carrierName = If( json?.PropertyT("carrierName"), out var __jsonCarrierName) ? (string)__jsonCarrierName : (string)_carrierName;} + {_trackingNumber = If( json?.PropertyT("trackingNumber"), out var __jsonTrackingNumber) ? (string)__jsonTrackingNumber : (string)_trackingNumber;} + {_driveCount = If( json?.PropertyT("driveCount"), out var __jsonDriveCount) ? (long)__jsonDriveCount : _driveCount;} + {_shipDate = If( json?.PropertyT("shipDate"), out var __jsonShipDate) ? (string)__jsonShipDate : (string)_shipDate;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParameters.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParameters.PowerShell.cs new file mode 100644 index 000000000000..c7dbfcfee918 --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParameters.PowerShell.cs @@ -0,0 +1,604 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + + /// Put Job parameters + [System.ComponentModel.TypeConverter(typeof(PutJobParametersTypeConverter))] + public partial class PutJobParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PutJobParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PutJobParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PutJobParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PutJobParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddressTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnShipping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShippingTypeConverter.ConvertFrom); + } + if (content.Contains("ShippingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformation = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation) content.GetValueForProperty("ShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformation, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ShippingInformationTypeConverter.ConvertFrom); + } + if (content.Contains("Export")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Export = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport) content.GetValueForProperty("Export",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Export, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation) content.GetValueForProperty("ReturnPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.EncryptionKeyDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).JobType, global::System.Convert.ToString); + } + if (content.Contains("DiagnosticsPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DiagnosticsPath = (string) content.GetValueForProperty("DiagnosticsPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DiagnosticsPath, global::System.Convert.ToString); + } + if (content.Contains("LogLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).LogLevel, global::System.Convert.ToString); + } + if (content.Contains("BackupDriveManifest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).State, global::System.Convert.ToString); + } + if (content.Contains("CancelRequested")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncompleteBlobListUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).IncompleteBlobListUri = (string) content.GetValueForProperty("IncompleteBlobListUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).IncompleteBlobListUri, global::System.Convert.ToString); + } + if (content.Contains("DriveList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DriveList = (System.Collections.Generic.List) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DriveList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressCity, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressPhone, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressEmail, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationRecipientName = (string) content.GetValueForProperty("ShippingInformationRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationStreetAddress1 = (string) content.GetValueForProperty("ShippingInformationStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationStreetAddress2 = (string) content.GetValueForProperty("ShippingInformationStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationCity = (string) content.GetValueForProperty("ShippingInformationCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationCity, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationPostalCode = (string) content.GetValueForProperty("ShippingInformationPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationPhone = (string) content.GetValueForProperty("ShippingInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationPhone, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationAdditionalInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationAdditionalInformation = (string) content.GetValueForProperty("ShippingInformationAdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationAdditionalInformation, global::System.Convert.ToString); + } + if (content.Contains("ExportBlobList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ExportBlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList) content.GetValueForProperty("ExportBlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ExportBlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportBlobListTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnAddressStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierAccountNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationStateOrProvince = (string) content.GetValueForProperty("ShippingInformationStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationCountryOrRegion = (string) content.GetValueForProperty("ShippingInformationCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DeliveryPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageCarrierName = (string) content.GetValueForProperty("ReturnPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageTrackingNumber = (string) content.GetValueForProperty("ReturnPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageDriveCount = (long?) content.GetValueForProperty("ReturnPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ReturnPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageShipDate = (string) content.GetValueForProperty("ReturnPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageShipDate, global::System.Convert.ToString); + } + if (content.Contains("ExportBlobListBlobPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ExportBlobListBlobPath = (string) content.GetValueForProperty("ExportBlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ExportBlobListBlobPath, global::System.Convert.ToString); + } + if (content.Contains("BlobPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).BlobPath = (System.Collections.Generic.List) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EncryptionKeyKekType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKeyKekType = (string) content.GetValueForProperty("EncryptionKeyKekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKeyKekType, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyKekUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKeyKekUrl = (string) content.GetValueForProperty("EncryptionKeyKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKeyKekUrl, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyKekVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKeyKekVaultResourceId = (string) content.GetValueForProperty("EncryptionKeyKekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKeyKekVaultResourceId, global::System.Convert.ToString); + } + if (content.Contains("BlobListBlobPathPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).BlobListBlobPathPrefix = (System.Collections.Generic.List) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PutJobParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PutJobParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddressTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnShipping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShippingTypeConverter.ConvertFrom); + } + if (content.Contains("ShippingInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformation = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation) content.GetValueForProperty("ShippingInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformation, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ShippingInformationTypeConverter.ConvertFrom); + } + if (content.Contains("Export")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Export = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport) content.GetValueForProperty("Export",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).Export, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation) content.GetValueForProperty("ReturnPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("EncryptionKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKey = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails) content.GetValueForProperty("EncryptionKey",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKey, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.EncryptionKeyDetailsTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).StorageAccountId = (string) content.GetValueForProperty("StorageAccountId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).StorageAccountId, global::System.Convert.ToString); + } + if (content.Contains("JobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).JobType = (string) content.GetValueForProperty("JobType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).JobType, global::System.Convert.ToString); + } + if (content.Contains("DiagnosticsPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DiagnosticsPath = (string) content.GetValueForProperty("DiagnosticsPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DiagnosticsPath, global::System.Convert.ToString); + } + if (content.Contains("LogLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).LogLevel, global::System.Convert.ToString); + } + if (content.Contains("BackupDriveManifest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).State, global::System.Convert.ToString); + } + if (content.Contains("CancelRequested")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PercentComplete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).PercentComplete = (long?) content.GetValueForProperty("PercentComplete",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).PercentComplete, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("IncompleteBlobListUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).IncompleteBlobListUri = (string) content.GetValueForProperty("IncompleteBlobListUri",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).IncompleteBlobListUri, global::System.Convert.ToString); + } + if (content.Contains("DriveList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DriveList = (System.Collections.Generic.List) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DriveList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ProvisioningState = (string) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ProvisioningState, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressCity, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressPhone, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressEmail, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationRecipientName = (string) content.GetValueForProperty("ShippingInformationRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationStreetAddress1 = (string) content.GetValueForProperty("ShippingInformationStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationStreetAddress2 = (string) content.GetValueForProperty("ShippingInformationStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationCity = (string) content.GetValueForProperty("ShippingInformationCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationCity, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationPostalCode = (string) content.GetValueForProperty("ShippingInformationPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationPhone = (string) content.GetValueForProperty("ShippingInformationPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationPhone, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationAdditionalInformation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationAdditionalInformation = (string) content.GetValueForProperty("ShippingInformationAdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationAdditionalInformation, global::System.Convert.ToString); + } + if (content.Contains("ExportBlobList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ExportBlobList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList) content.GetValueForProperty("ExportBlobList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ExportBlobList, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ExportBlobListTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnAddressStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierAccountNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationStateOrProvince = (string) content.GetValueForProperty("ShippingInformationStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ShippingInformationCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationCountryOrRegion = (string) content.GetValueForProperty("ShippingInformationCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ShippingInformationCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DeliveryPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageCarrierName = (string) content.GetValueForProperty("ReturnPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageTrackingNumber = (string) content.GetValueForProperty("ReturnPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("ReturnPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageDriveCount = (long?) content.GetValueForProperty("ReturnPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("ReturnPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageShipDate = (string) content.GetValueForProperty("ReturnPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ReturnPackageShipDate, global::System.Convert.ToString); + } + if (content.Contains("ExportBlobListBlobPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ExportBlobListBlobPath = (string) content.GetValueForProperty("ExportBlobListBlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).ExportBlobListBlobPath, global::System.Convert.ToString); + } + if (content.Contains("BlobPath")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).BlobPath = (System.Collections.Generic.List) content.GetValueForProperty("BlobPath",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).BlobPath, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + if (content.Contains("EncryptionKeyKekType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKeyKekType = (string) content.GetValueForProperty("EncryptionKeyKekType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKeyKekType, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyKekUrl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKeyKekUrl = (string) content.GetValueForProperty("EncryptionKeyKekUrl",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKeyKekUrl, global::System.Convert.ToString); + } + if (content.Contains("EncryptionKeyKekVaultResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKeyKekVaultResourceId = (string) content.GetValueForProperty("EncryptionKeyKekVaultResourceId",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).EncryptionKeyKekVaultResourceId, global::System.Convert.ToString); + } + if (content.Contains("BlobListBlobPathPrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).BlobListBlobPathPrefix = (System.Collections.Generic.List) content.GetValueForProperty("BlobListBlobPathPrefix",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal)this).BlobListBlobPathPrefix, __y => TypeConverterExtensions.SelectToList(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + } + /// Put Job parameters + [System.ComponentModel.TypeConverter(typeof(PutJobParametersTypeConverter))] + public partial interface IPutJobParameters + + { + + } +} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParameters.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParameters.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParameters.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParameters.TypeConverter.cs index 8c5041f1f29d..cbfd5e3957d3 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParameters.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParameters.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParameters.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParameters.cs similarity index 69% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParameters.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParameters.cs index 65a74ce79681..ac07a14a69d6 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParameters.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParameters.cs @@ -3,92 +3,92 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Put Job parameters public partial class PutJobParameters : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParameters, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal { /// /// Default value is false. Indicates whether the manifest files on the drives should be copied to block blobs. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public bool? BackupDriveManifest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).BackupDriveManifest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).BackupDriveManifest = value ?? default(bool); } + public bool? BackupDriveManifest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).BackupDriveManifest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).BackupDriveManifest = value ?? default(bool); } /// A collection of blob-prefix strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string[] BlobListBlobPathPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).BlobListBlobPathPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).BlobListBlobPathPrefix = value ?? null /* arrayOf */; } + public System.Collections.Generic.List BlobListBlobPathPrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).BlobListBlobPathPrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).BlobListBlobPathPrefix = value ?? null /* arrayOf */; } /// A collection of blob-path strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string[] BlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).BlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).BlobPath = value ?? null /* arrayOf */; } + public System.Collections.Generic.List BlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).BlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).BlobPath = value ?? null /* arrayOf */; } /// Indicates whether a request has been submitted to cancel the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public bool? CancelRequested { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).CancelRequested; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).CancelRequested = value ?? default(bool); } + public bool? CancelRequested { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).CancelRequested; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).CancelRequested = value ?? default(bool); } /// The name of the carrier that is used to ship the import or export drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageCarrierName = value ?? null; } + public string DeliveryPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageCarrierName = value ?? null; } /// The number of drives included in the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public long? DeliveryPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageDriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageDriveCount = value ?? default(long); } + public long? DeliveryPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageDriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageDriveCount = value ?? default(long); } /// The date when the package is shipped. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageShipDate = value ?? null; } + public string DeliveryPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageShipDate = value ?? null; } /// The tracking number of the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageTrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackageTrackingNumber = value ?? null; } + public string DeliveryPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageTrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackageTrackingNumber = value ?? null; } /// /// The virtual blob directory to which the copy logs and backups of drive manifest files (if enabled) will be stored. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DiagnosticsPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DiagnosticsPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DiagnosticsPath = value ?? null; } + public string DiagnosticsPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DiagnosticsPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DiagnosticsPath = value ?? null; } /// /// List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is not specified /// for export jobs. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DriveList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DriveList = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DriveList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DriveList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DriveList = value ?? null /* arrayOf */; } /// The type of kek encryption key [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType? EncryptionKeyKekType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKeyKekType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKeyKekType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType)""); } + public string EncryptionKeyKekType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKeyKekType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKeyKekType = value ?? null; } /// Specifies the url for kek encryption key. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string EncryptionKeyKekUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKeyKekUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKeyKekUrl = value ?? null; } + public string EncryptionKeyKekUrl { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKeyKekUrl; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKeyKekUrl = value ?? null; } /// Specifies the keyvault resource id for kek encryption key. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string EncryptionKeyKekVaultResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKeyKekVaultResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKeyKekVaultResourceId = value ?? null; } + public string EncryptionKeyKekVaultResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKeyKekVaultResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKeyKekVaultResourceId = value ?? null; } /// /// The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning /// with the container name. If the blob is in root container, the URI must begin with $root. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ExportBlobListBlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ExportBlobListBlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ExportBlobListBlobPath = value ?? null; } + public string ExportBlobListBlobPath { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ExportBlobListBlobPath; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ExportBlobListBlobPath = value ?? null; } /// /// A blob path that points to a block blob containing a list of blob names that were not exported due to insufficient drive /// space. If all blobs were exported successfully, then this element is not included in the response. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string IncompleteBlobListUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).IncompleteBlobListUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).IncompleteBlobListUri = value ?? null; } + public string IncompleteBlobListUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).IncompleteBlobListUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).IncompleteBlobListUri = value ?? null; } /// The type of job [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string JobType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).JobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).JobType = value ?? null; } + public string JobType { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).JobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).JobType = value ?? null; } /// Backing field for property. private string _location; @@ -101,171 +101,171 @@ public partial class PutJobParameters : /// Default value is Error. Indicates whether error logging or verbose logging will be enabled. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string LogLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).LogLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).LogLevel = value ?? null; } + public string LogLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).LogLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).LogLevel = value ?? null; } /// Internal Acessors for DeliveryPackage - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal.DeliveryPackage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).DeliveryPackage = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal.DeliveryPackage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).DeliveryPackage = value; } /// Internal Acessors for EncryptionKey - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal.EncryptionKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).EncryptionKey = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal.EncryptionKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).EncryptionKey = value; } /// Internal Acessors for Export - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal.Export { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).Export; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).Export = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal.Export { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).Export; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).Export = value; } /// Internal Acessors for ExportBlobList - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal.ExportBlobList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ExportBlobList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ExportBlobList = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal.ExportBlobList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ExportBlobList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ExportBlobList = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobDetails()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobDetails()); set { {_property = value;} } } /// Internal Acessors for ReturnAddress - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal.ReturnAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddress = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal.ReturnAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddress = value; } /// Internal Acessors for ReturnPackage - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal.ReturnPackage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackage = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal.ReturnPackage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackage = value; } /// Internal Acessors for ReturnShipping - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal.ReturnShipping { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnShipping; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnShipping = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal.ReturnShipping { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnShipping; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnShipping = value; } /// Internal Acessors for ShippingInformation - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal.ShippingInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformation = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal.ShippingInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformation = value; } /// Internal Acessors for ShippingInformationAdditionalInformation - string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersInternal.ShippingInformationAdditionalInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationAdditionalInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationAdditionalInformation = value; } + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersInternal.ShippingInformationAdditionalInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationAdditionalInformation; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationAdditionalInformation = value; } /// Overall percentage completed for the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public long? PercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).PercentComplete; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).PercentComplete = value ?? default(long); } + public long? PercentComplete { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).PercentComplete; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).PercentComplete = value ?? default(long); } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails _property; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails _property; /// Specifies the job properties [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobDetails()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobDetails()); set => this._property = value; } /// Specifies the provisioning state of the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ProvisioningState = value ?? null; } + public string ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ProvisioningState = value ?? null; } /// The city name to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressCity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressCity = value ?? null; } + public string ReturnAddressCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressCity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressCity = value ?? null; } /// The country or region to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressCountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressCountryOrRegion = value ?? null; } + public string ReturnAddressCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressCountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressCountryOrRegion = value ?? null; } /// Email address of the recipient of the returned drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressEmail = value ?? null; } + public string ReturnAddressEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressEmail = value ?? null; } /// Phone number of the recipient of the returned drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressPhone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressPhone = value ?? null; } + public string ReturnAddressPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressPhone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressPhone = value ?? null; } /// The postal code to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressPostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressPostalCode = value ?? null; } + public string ReturnAddressPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressPostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressPostalCode = value ?? null; } /// /// The name of the recipient who will receive the hard drives when they are returned. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressRecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressRecipientName = value ?? null; } + public string ReturnAddressRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressRecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressRecipientName = value ?? null; } /// The state or province to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressStateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressStateOrProvince = value ?? null; } + public string ReturnAddressStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressStateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressStateOrProvince = value ?? null; } /// The first line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressStreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressStreetAddress1 = value ?? null; } + public string ReturnAddressStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressStreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressStreetAddress1 = value ?? null; } /// The second line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressStreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnAddressStreetAddress2 = value ?? null; } + public string ReturnAddressStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressStreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnAddressStreetAddress2 = value ?? null; } /// The name of the carrier that is used to ship the import or export drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageCarrierName = value ?? null; } + public string ReturnPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageCarrierName = value ?? null; } /// The number of drives included in the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public long? ReturnPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageDriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageDriveCount = value ?? default(long); } + public long? ReturnPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageDriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageDriveCount = value ?? default(long); } /// The date when the package is shipped. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageShipDate = value ?? null; } + public string ReturnPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageShipDate = value ?? null; } /// The tracking number of the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageTrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnPackageTrackingNumber = value ?? null; } + public string ReturnPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageTrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnPackageTrackingNumber = value ?? null; } /// The customer's account number with the carrier. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnShippingCarrierAccountNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnShippingCarrierAccountNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnShippingCarrierAccountNumber = value ?? null; } + public string ReturnShippingCarrierAccountNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnShippingCarrierAccountNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnShippingCarrierAccountNumber = value ?? null; } /// The carrier's name. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnShippingCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnShippingCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ReturnShippingCarrierName = value ?? null; } + public string ReturnShippingCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnShippingCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ReturnShippingCarrierName = value ?? null; } /// /// Additional shipping information for customer, specific to datacenter to which customer should send their disks. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationAdditionalInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationAdditionalInformation; } + public string ShippingInformationAdditionalInformation { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationAdditionalInformation; } /// The city name to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationCity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationCity = value ?? null; } + public string ShippingInformationCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationCity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationCity = value ?? null; } /// The country or region to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationCountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationCountryOrRegion = value ?? null; } + public string ShippingInformationCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationCountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationCountryOrRegion = value ?? null; } /// Phone number of the recipient of the returned drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationPhone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationPhone = value ?? null; } + public string ShippingInformationPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationPhone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationPhone = value ?? null; } /// The postal code to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationPostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationPostalCode = value ?? null; } + public string ShippingInformationPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationPostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationPostalCode = value ?? null; } /// /// The name of the recipient who will receive the hard drives when they are returned. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationRecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationRecipientName = value ?? null; } + public string ShippingInformationRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationRecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationRecipientName = value ?? null; } /// The state or province to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationStateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationStateOrProvince = value ?? null; } + public string ShippingInformationStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationStateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationStateOrProvince = value ?? null; } /// The first line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationStreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationStreetAddress1 = value ?? null; } + public string ShippingInformationStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationStreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationStreetAddress1 = value ?? null; } /// The second line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ShippingInformationStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationStreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).ShippingInformationStreetAddress2 = value ?? null; } + public string ShippingInformationStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationStreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).ShippingInformationStreetAddress2 = value ?? null; } /// Current state of the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string State { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).State = value ?? null; } + public string State { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).State = value ?? null; } /// /// The resource identifier of the storage account where data will be imported to or exported from. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string StorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).StorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetailsInternal)Property).StorageAccountId = value ?? null; } + public string StorageAccountId { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).StorageAccountId; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetailsInternal)Property).StorageAccountId = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags _tag; /// Specifies the tags that will be assigned to the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PutJobParametersTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PutJobParametersTags()); set => this._tag = value; } /// Creates an new instance. public PutJobParameters() @@ -283,6 +283,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Default value is false. Indicates whether the manifest files on the drives should be copied to block blobs.", SerializedName = @"backupDriveManifest", PossibleTypes = new [] { typeof(bool) })] @@ -291,22 +294,31 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A collection of blob-prefix strings.", SerializedName = @"blobPathPrefix", PossibleTypes = new [] { typeof(string) })] - string[] BlobListBlobPathPrefix { get; set; } + System.Collections.Generic.List BlobListBlobPathPrefix { get; set; } /// A collection of blob-path strings. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A collection of blob-path strings.", SerializedName = @"blobPath", PossibleTypes = new [] { typeof(string) })] - string[] BlobPath { get; set; } + System.Collections.Generic.List BlobPath { get; set; } /// Indicates whether a request has been submitted to cancel the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether a request has been submitted to cancel the job.", SerializedName = @"cancelRequested", PossibleTypes = new [] { typeof(bool) })] @@ -315,6 +327,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the carrier that is used to ship the import or export drives.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -323,6 +338,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of drives included in the package.", SerializedName = @"driveCount", PossibleTypes = new [] { typeof(long) })] @@ -331,6 +349,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The date when the package is shipped.", SerializedName = @"shipDate", PossibleTypes = new [] { typeof(string) })] @@ -339,6 +360,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tracking number of the package.", SerializedName = @"trackingNumber", PossibleTypes = new [] { typeof(string) })] @@ -349,6 +373,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The virtual blob directory to which the copy logs and backups of drive manifest files (if enabled) will be stored.", SerializedName = @"diagnosticsPath", PossibleTypes = new [] { typeof(string) })] @@ -360,22 +387,32 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is not specified for export jobs.", SerializedName = @"driveList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus) })] + System.Collections.Generic.List DriveList { get; set; } /// The type of kek encryption key [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of kek encryption key", SerializedName = @"kekType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType? EncryptionKeyKekType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("MicrosoftManaged", "CustomerManaged")] + string EncryptionKeyKekType { get; set; } /// Specifies the url for kek encryption key. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the url for kek encryption key. ", SerializedName = @"kekUrl", PossibleTypes = new [] { typeof(string) })] @@ -384,6 +421,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the keyvault resource id for kek encryption key. ", SerializedName = @"kekVaultResourceID", PossibleTypes = new [] { typeof(string) })] @@ -395,6 +435,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning with the container name. If the blob is in root container, the URI must begin with $root. ", SerializedName = @"blobListBlobPath", PossibleTypes = new [] { typeof(string) })] @@ -406,6 +449,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"A blob path that points to a block blob containing a list of blob names that were not exported due to insufficient drive space. If all blobs were exported successfully, then this element is not included in the response.", SerializedName = @"incompleteBlobListUri", PossibleTypes = new [] { typeof(string) })] @@ -414,6 +460,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of job", SerializedName = @"jobType", PossibleTypes = new [] { typeof(string) })] @@ -422,6 +471,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the supported Azure location where the job should be created", SerializedName = @"location", PossibleTypes = new [] { typeof(string) })] @@ -432,6 +484,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Default value is Error. Indicates whether error logging or verbose logging will be enabled.", SerializedName = @"logLevel", PossibleTypes = new [] { typeof(string) })] @@ -440,6 +495,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Overall percentage completed for the job.", SerializedName = @"percentComplete", PossibleTypes = new [] { typeof(long) })] @@ -448,6 +506,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the provisioning state of the job.", SerializedName = @"provisioningState", PossibleTypes = new [] { typeof(string) })] @@ -456,6 +517,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The city name to use when returning the drives.", SerializedName = @"city", PossibleTypes = new [] { typeof(string) })] @@ -464,6 +528,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The country or region to use when returning the drives. ", SerializedName = @"countryOrRegion", PossibleTypes = new [] { typeof(string) })] @@ -472,6 +539,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email address of the recipient of the returned drives.", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -480,6 +550,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Phone number of the recipient of the returned drives.", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] @@ -488,6 +561,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The postal code to use when returning the drives.", SerializedName = @"postalCode", PossibleTypes = new [] { typeof(string) })] @@ -498,6 +574,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the recipient who will receive the hard drives when they are returned. ", SerializedName = @"recipientName", PossibleTypes = new [] { typeof(string) })] @@ -506,6 +585,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The state or province to use when returning the drives.", SerializedName = @"stateOrProvince", PossibleTypes = new [] { typeof(string) })] @@ -514,6 +596,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The first line of the street address to use when returning the drives. ", SerializedName = @"streetAddress1", PossibleTypes = new [] { typeof(string) })] @@ -522,6 +607,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The second line of the street address to use when returning the drives. ", SerializedName = @"streetAddress2", PossibleTypes = new [] { typeof(string) })] @@ -530,6 +618,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the carrier that is used to ship the import or export drives.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -538,6 +629,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of drives included in the package.", SerializedName = @"driveCount", PossibleTypes = new [] { typeof(long) })] @@ -546,6 +640,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The date when the package is shipped.", SerializedName = @"shipDate", PossibleTypes = new [] { typeof(string) })] @@ -554,6 +651,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tracking number of the package.", SerializedName = @"trackingNumber", PossibleTypes = new [] { typeof(string) })] @@ -562,6 +662,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The customer's account number with the carrier.", SerializedName = @"carrierAccountNumber", PossibleTypes = new [] { typeof(string) })] @@ -570,6 +673,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The carrier's name.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -580,6 +686,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Additional shipping information for customer, specific to datacenter to which customer should send their disks.", SerializedName = @"additionalInformation", PossibleTypes = new [] { typeof(string) })] @@ -588,6 +697,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The city name to use when returning the drives.", SerializedName = @"city", PossibleTypes = new [] { typeof(string) })] @@ -596,6 +708,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The country or region to use when returning the drives. ", SerializedName = @"countryOrRegion", PossibleTypes = new [] { typeof(string) })] @@ -604,6 +719,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Phone number of the recipient of the returned drives.", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] @@ -612,6 +730,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The postal code to use when returning the drives.", SerializedName = @"postalCode", PossibleTypes = new [] { typeof(string) })] @@ -622,6 +743,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the recipient who will receive the hard drives when they are returned. ", SerializedName = @"recipientName", PossibleTypes = new [] { typeof(string) })] @@ -630,6 +754,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The state or province to use when returning the drives.", SerializedName = @"stateOrProvince", PossibleTypes = new [] { typeof(string) })] @@ -638,6 +765,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The first line of the street address to use when returning the drives. ", SerializedName = @"streetAddress1", PossibleTypes = new [] { typeof(string) })] @@ -646,6 +776,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The second line of the street address to use when returning the drives. ", SerializedName = @"streetAddress2", PossibleTypes = new [] { typeof(string) })] @@ -654,6 +787,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Current state of the job.", SerializedName = @"state", PossibleTypes = new [] { typeof(string) })] @@ -664,6 +800,9 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The resource identifier of the storage account where data will be imported to or exported from.", SerializedName = @"storageAccountId", PossibleTypes = new [] { typeof(string) })] @@ -672,10 +811,13 @@ public partial interface IPutJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the tags that will be assigned to the job.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags Tag { get; set; } } /// Put Job parameters @@ -687,15 +829,15 @@ internal partial interface IPutJobParametersInternal /// bool? BackupDriveManifest { get; set; } /// A collection of blob-prefix strings. - string[] BlobListBlobPathPrefix { get; set; } + System.Collections.Generic.List BlobListBlobPathPrefix { get; set; } /// A collection of blob-path strings. - string[] BlobPath { get; set; } + System.Collections.Generic.List BlobPath { get; set; } /// Indicates whether a request has been submitted to cancel the job. bool? CancelRequested { get; set; } /// /// Contains information about the package being shipped by the customer to the Microsoft data center. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation DeliveryPackage { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation DeliveryPackage { get; set; } /// The name of the carrier that is used to ship the import or export drives. string DeliveryPackageCarrierName { get; set; } /// The number of drives included in the package. @@ -712,11 +854,12 @@ internal partial interface IPutJobParametersInternal /// List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is not specified /// for export jobs. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get; set; } + System.Collections.Generic.List DriveList { get; set; } /// Contains information about the encryption key. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IEncryptionKeyDetails EncryptionKey { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IEncryptionKeyDetails EncryptionKey { get; set; } /// The type of kek encryption key - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType? EncryptionKeyKekType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("MicrosoftManaged", "CustomerManaged")] + string EncryptionKeyKekType { get; set; } /// Specifies the url for kek encryption key. string EncryptionKeyKekUrl { get; set; } /// Specifies the keyvault resource id for kek encryption key. @@ -725,9 +868,9 @@ internal partial interface IPutJobParametersInternal /// A property containing information about the blobs to be exported for an export job. This property is included for export /// jobs only. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExport Export { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExport Export { get; set; } /// A list of the blobs to be exported. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IExportBlobList ExportBlobList { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IExportBlobList ExportBlobList { get; set; } /// /// The relative URI to the block blob that contains the list of blob paths or blob path prefixes as defined above, beginning /// with the container name. If the blob is in root container, the URI must begin with $root. @@ -749,11 +892,11 @@ internal partial interface IPutJobParametersInternal /// Overall percentage completed for the job. long? PercentComplete { get; set; } /// Specifies the job properties - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobDetails Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobDetails Property { get; set; } /// Specifies the provisioning state of the job. string ProvisioningState { get; set; } /// Specifies the return address information for the job. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress ReturnAddress { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress ReturnAddress { get; set; } /// The city name to use when returning the drives. string ReturnAddressCity { get; set; } /// The country or region to use when returning the drives. @@ -779,7 +922,7 @@ internal partial interface IPutJobParametersInternal /// The format is the same as the deliveryPackage property above. This property is not included if the drives have not yet /// been returned. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPackageInformation ReturnPackage { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPackageInformation ReturnPackage { get; set; } /// The name of the carrier that is used to ship the import or export drives. string ReturnPackageCarrierName { get; set; } /// The number of drives included in the package. @@ -789,7 +932,7 @@ internal partial interface IPutJobParametersInternal /// The tracking number of the package. string ReturnPackageTrackingNumber { get; set; } /// Specifies the return carrier and customer's account with the carrier. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping ReturnShipping { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping ReturnShipping { get; set; } /// The customer's account number with the carrier. string ReturnShippingCarrierAccountNumber { get; set; } /// The carrier's name. @@ -797,7 +940,7 @@ internal partial interface IPutJobParametersInternal /// /// Contains information about the Microsoft datacenter to which the drives should be shipped. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation ShippingInformation { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation ShippingInformation { get; set; } /// /// Additional shipping information for customer, specific to datacenter to which customer should send their disks. /// @@ -827,7 +970,7 @@ internal partial interface IPutJobParametersInternal /// string StorageAccountId { get; set; } /// Specifies the tags that will be assigned to the job. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParameters.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParameters.json.cs similarity index 93% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParameters.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParameters.json.cs index 7e223ce605dc..62e968b33a00 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParameters.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParameters.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PutJobParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new PutJobParameters(json) : null; } @@ -77,9 +77,9 @@ internal PutJobParameters(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtim { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.JobDetails.FromJson(__jsonProperties) : Property;} - {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PutJobParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.JobDetails.FromJson(__jsonProperties) : _property;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)_location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PutJobParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.PowerShell.cs similarity index 81% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.PowerShell.cs index d11bdc2ab53c..ea7a0dcf6621 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class PutJobParametersTags partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new PutJobParametersTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new PutJobParametersTags(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -107,7 +115,7 @@ internal PutJobParametersTags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -129,6 +137,18 @@ internal PutJobParametersTags(global::System.Management.Automation.PSObject cont /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Specifies the tags that will be assigned to the job. [System.ComponentModel.TypeConverter(typeof(PutJobParametersTagsTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.TypeConverter.cs index 983e304b6c0a..c0dfe09a5027 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.cs similarity index 85% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.cs index 8282e7c575f4..1d7eea14e218 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Specifies the tags that will be assigned to the job. public partial class PutJobParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTagsInternal { /// Creates an new instance. diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.dictionary.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.dictionary.cs similarity index 96% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.dictionary.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.dictionary.cs index f87841e99a40..075761ae4356 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.dictionary.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PutJobParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PutJobParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.json.cs similarity index 96% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.json.cs index 7af7c6d2e0a6..0ec0cd586251 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/PutJobParametersTags.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/PutJobParametersTags.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class PutJobParametersTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new PutJobParametersTags(json) : null; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnAddress.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnAddress.PowerShell.cs similarity index 61% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnAddress.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnAddress.PowerShell.cs index 4ce13f7b7407..da4ae3632ea2 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnAddress.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnAddress.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ReturnAddress partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReturnAddress(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReturnAddress(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,45 +111,45 @@ internal ReturnAddress(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("RecipientName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).RecipientName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).RecipientName, global::System.Convert.ToString); } if (content.Contains("StreetAddress1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).StreetAddress1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).StreetAddress1, global::System.Convert.ToString); } if (content.Contains("StreetAddress2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).StreetAddress2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).StreetAddress2, global::System.Convert.ToString); } if (content.Contains("City")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).City, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).City, global::System.Convert.ToString); } if (content.Contains("StateOrProvince")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).StateOrProvince, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).StateOrProvince, global::System.Convert.ToString); } if (content.Contains("PostalCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).PostalCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).PostalCode, global::System.Convert.ToString); } if (content.Contains("CountryOrRegion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).CountryOrRegion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).CountryOrRegion, global::System.Convert.ToString); } if (content.Contains("Phone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).Phone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).Phone, global::System.Convert.ToString); } if (content.Contains("Email")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).Email, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).Email, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -156,39 +164,39 @@ internal ReturnAddress(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("RecipientName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).RecipientName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).RecipientName, global::System.Convert.ToString); } if (content.Contains("StreetAddress1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).StreetAddress1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).StreetAddress1, global::System.Convert.ToString); } if (content.Contains("StreetAddress2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).StreetAddress2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).StreetAddress2, global::System.Convert.ToString); } if (content.Contains("City")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).City, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).City, global::System.Convert.ToString); } if (content.Contains("StateOrProvince")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).StateOrProvince, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).StateOrProvince, global::System.Convert.ToString); } if (content.Contains("PostalCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).PostalCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).PostalCode, global::System.Convert.ToString); } if (content.Contains("CountryOrRegion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).CountryOrRegion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).CountryOrRegion, global::System.Convert.ToString); } if (content.Contains("Phone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).Phone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).Phone, global::System.Convert.ToString); } if (content.Contains("Email")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)this).Email, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).Email = (string) content.GetValueForProperty("Email",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)this).Email, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -197,6 +205,18 @@ internal ReturnAddress(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Specifies the return address information for the job. [System.ComponentModel.TypeConverter(typeof(ReturnAddressTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnAddress.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnAddress.TypeConverter.cs similarity index 98% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnAddress.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnAddress.TypeConverter.cs index b70c480a2a7a..6c0b41fe7116 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnAddress.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnAddress.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnAddress.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnAddress.cs similarity index 93% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnAddress.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnAddress.cs index 96492ebd0469..16466c15e947 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnAddress.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnAddress.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Specifies the return address information for the job. public partial class ReturnAddress : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal { /// Backing field for property. @@ -92,6 +92,9 @@ public partial interface IReturnAddress : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The city name to use when returning the drives.", SerializedName = @"city", PossibleTypes = new [] { typeof(string) })] @@ -100,6 +103,9 @@ public partial interface IReturnAddress : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The country or region to use when returning the drives. ", SerializedName = @"countryOrRegion", PossibleTypes = new [] { typeof(string) })] @@ -108,6 +114,9 @@ public partial interface IReturnAddress : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email address of the recipient of the returned drives.", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -116,6 +125,9 @@ public partial interface IReturnAddress : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Phone number of the recipient of the returned drives.", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] @@ -124,6 +136,9 @@ public partial interface IReturnAddress : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The postal code to use when returning the drives.", SerializedName = @"postalCode", PossibleTypes = new [] { typeof(string) })] @@ -134,6 +149,9 @@ public partial interface IReturnAddress : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the recipient who will receive the hard drives when they are returned. ", SerializedName = @"recipientName", PossibleTypes = new [] { typeof(string) })] @@ -142,6 +160,9 @@ public partial interface IReturnAddress : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The state or province to use when returning the drives.", SerializedName = @"stateOrProvince", PossibleTypes = new [] { typeof(string) })] @@ -150,6 +171,9 @@ public partial interface IReturnAddress : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The first line of the street address to use when returning the drives. ", SerializedName = @"streetAddress1", PossibleTypes = new [] { typeof(string) })] @@ -158,6 +182,9 @@ public partial interface IReturnAddress : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The second line of the street address to use when returning the drives. ", SerializedName = @"streetAddress2", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnAddress.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnAddress.json.cs similarity index 94% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnAddress.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnAddress.json.cs index 9242c90897f0..270b7cd384fe 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnAddress.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnAddress.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReturnAddress partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new ReturnAddress(json) : null; } @@ -77,15 +77,15 @@ internal ReturnAddress(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.J { return; } - {_recipientName = If( json?.PropertyT("recipientName"), out var __jsonRecipientName) ? (string)__jsonRecipientName : (string)RecipientName;} - {_streetAddress1 = If( json?.PropertyT("streetAddress1"), out var __jsonStreetAddress1) ? (string)__jsonStreetAddress1 : (string)StreetAddress1;} - {_streetAddress2 = If( json?.PropertyT("streetAddress2"), out var __jsonStreetAddress2) ? (string)__jsonStreetAddress2 : (string)StreetAddress2;} - {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)City;} - {_stateOrProvince = If( json?.PropertyT("stateOrProvince"), out var __jsonStateOrProvince) ? (string)__jsonStateOrProvince : (string)StateOrProvince;} - {_postalCode = If( json?.PropertyT("postalCode"), out var __jsonPostalCode) ? (string)__jsonPostalCode : (string)PostalCode;} - {_countryOrRegion = If( json?.PropertyT("countryOrRegion"), out var __jsonCountryOrRegion) ? (string)__jsonCountryOrRegion : (string)CountryOrRegion;} - {_phone = If( json?.PropertyT("phone"), out var __jsonPhone) ? (string)__jsonPhone : (string)Phone;} - {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)Email;} + {_recipientName = If( json?.PropertyT("recipientName"), out var __jsonRecipientName) ? (string)__jsonRecipientName : (string)_recipientName;} + {_streetAddress1 = If( json?.PropertyT("streetAddress1"), out var __jsonStreetAddress1) ? (string)__jsonStreetAddress1 : (string)_streetAddress1;} + {_streetAddress2 = If( json?.PropertyT("streetAddress2"), out var __jsonStreetAddress2) ? (string)__jsonStreetAddress2 : (string)_streetAddress2;} + {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)_city;} + {_stateOrProvince = If( json?.PropertyT("stateOrProvince"), out var __jsonStateOrProvince) ? (string)__jsonStateOrProvince : (string)_stateOrProvince;} + {_postalCode = If( json?.PropertyT("postalCode"), out var __jsonPostalCode) ? (string)__jsonPostalCode : (string)_postalCode;} + {_countryOrRegion = If( json?.PropertyT("countryOrRegion"), out var __jsonCountryOrRegion) ? (string)__jsonCountryOrRegion : (string)_countryOrRegion;} + {_phone = If( json?.PropertyT("phone"), out var __jsonPhone) ? (string)__jsonPhone : (string)_phone;} + {_email = If( json?.PropertyT("email"), out var __jsonEmail) ? (string)__jsonEmail : (string)_email;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnShipping.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnShipping.PowerShell.cs similarity index 74% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnShipping.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnShipping.PowerShell.cs index 23c469543a7f..8c0762a7b385 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnShipping.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnShipping.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class ReturnShipping partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ReturnShipping(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ReturnShipping(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,17 +111,17 @@ internal ReturnShipping(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("CarrierName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)this).CarrierName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)this).CarrierName, global::System.Convert.ToString); } if (content.Contains("CarrierAccountNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)this).CarrierAccountNumber = (string) content.GetValueForProperty("CarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)this).CarrierAccountNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)this).CarrierAccountNumber = (string) content.GetValueForProperty("CarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)this).CarrierAccountNumber, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -128,11 +136,11 @@ internal ReturnShipping(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("CarrierName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)this).CarrierName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)this).CarrierName = (string) content.GetValueForProperty("CarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)this).CarrierName, global::System.Convert.ToString); } if (content.Contains("CarrierAccountNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)this).CarrierAccountNumber = (string) content.GetValueForProperty("CarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)this).CarrierAccountNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)this).CarrierAccountNumber = (string) content.GetValueForProperty("CarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)this).CarrierAccountNumber, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -141,6 +149,18 @@ internal ReturnShipping(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Specifies the return carrier and customer's account with the carrier. [System.ComponentModel.TypeConverter(typeof(ReturnShippingTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnShipping.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnShipping.TypeConverter.cs similarity index 98% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnShipping.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnShipping.TypeConverter.cs index 12d69867889c..c53f85502a74 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnShipping.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnShipping.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnShipping.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnShipping.cs similarity index 90% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnShipping.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnShipping.cs index 49873e16dbdc..1955f179e5ed 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnShipping.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnShipping.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Specifies the return carrier and customer's account with the carrier. public partial class ReturnShipping : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal { /// Backing field for property. @@ -41,6 +41,9 @@ public partial interface IReturnShipping : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The customer's account number with the carrier.", SerializedName = @"carrierAccountNumber", PossibleTypes = new [] { typeof(string) })] @@ -49,6 +52,9 @@ public partial interface IReturnShipping : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = true, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The carrier's name.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnShipping.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnShipping.json.cs similarity index 95% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnShipping.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnShipping.json.cs index 669cbe08736f..40c43a03643c 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ReturnShipping.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ReturnShipping.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class ReturnShipping partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new ReturnShipping(json) : null; } @@ -77,8 +77,8 @@ internal ReturnShipping(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime. { return; } - {_carrierName = If( json?.PropertyT("carrierName"), out var __jsonCarrierName) ? (string)__jsonCarrierName : (string)CarrierName;} - {_carrierAccountNumber = If( json?.PropertyT("carrierAccountNumber"), out var __jsonCarrierAccountNumber) ? (string)__jsonCarrierAccountNumber : (string)CarrierAccountNumber;} + {_carrierName = If( json?.PropertyT("carrierName"), out var __jsonCarrierName) ? (string)__jsonCarrierName : (string)_carrierName;} + {_carrierAccountNumber = If( json?.PropertyT("carrierAccountNumber"), out var __jsonCarrierAccountNumber) ? (string)__jsonCarrierAccountNumber : (string)_carrierAccountNumber;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ShippingInformation.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ShippingInformation.PowerShell.cs similarity index 60% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ShippingInformation.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ShippingInformation.PowerShell.cs index 03cd6180fbb1..7e12643810da 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ShippingInformation.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ShippingInformation.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -57,27 +57,35 @@ public partial class ShippingInformation partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new ShippingInformation(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new ShippingInformation(content); } @@ -87,10 +95,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -105,45 +113,45 @@ internal ShippingInformation(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("RecipientName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).RecipientName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).RecipientName, global::System.Convert.ToString); } if (content.Contains("StreetAddress1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).StreetAddress1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).StreetAddress1, global::System.Convert.ToString); } if (content.Contains("StreetAddress2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).StreetAddress2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).StreetAddress2, global::System.Convert.ToString); } if (content.Contains("City")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).City, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).City, global::System.Convert.ToString); } if (content.Contains("StateOrProvince")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).StateOrProvince, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).StateOrProvince, global::System.Convert.ToString); } if (content.Contains("PostalCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).PostalCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).PostalCode, global::System.Convert.ToString); } if (content.Contains("CountryOrRegion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).CountryOrRegion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).CountryOrRegion, global::System.Convert.ToString); } if (content.Contains("Phone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).Phone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).Phone, global::System.Convert.ToString); } if (content.Contains("AdditionalInformation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).AdditionalInformation = (string) content.GetValueForProperty("AdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).AdditionalInformation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).AdditionalInformation = (string) content.GetValueForProperty("AdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).AdditionalInformation, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -158,39 +166,39 @@ internal ShippingInformation(global::System.Management.Automation.PSObject conte // actually deserialize if (content.Contains("RecipientName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).RecipientName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).RecipientName = (string) content.GetValueForProperty("RecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).RecipientName, global::System.Convert.ToString); } if (content.Contains("StreetAddress1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).StreetAddress1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).StreetAddress1 = (string) content.GetValueForProperty("StreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).StreetAddress1, global::System.Convert.ToString); } if (content.Contains("StreetAddress2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).StreetAddress2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).StreetAddress2 = (string) content.GetValueForProperty("StreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).StreetAddress2, global::System.Convert.ToString); } if (content.Contains("City")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).City, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).City = (string) content.GetValueForProperty("City",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).City, global::System.Convert.ToString); } if (content.Contains("StateOrProvince")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).StateOrProvince, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).StateOrProvince = (string) content.GetValueForProperty("StateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).StateOrProvince, global::System.Convert.ToString); } if (content.Contains("PostalCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).PostalCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).PostalCode = (string) content.GetValueForProperty("PostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).PostalCode, global::System.Convert.ToString); } if (content.Contains("CountryOrRegion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).CountryOrRegion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).CountryOrRegion = (string) content.GetValueForProperty("CountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).CountryOrRegion, global::System.Convert.ToString); } if (content.Contains("Phone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).Phone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).Phone = (string) content.GetValueForProperty("Phone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).Phone, global::System.Convert.ToString); } if (content.Contains("AdditionalInformation")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).AdditionalInformation = (string) content.GetValueForProperty("AdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal)this).AdditionalInformation, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).AdditionalInformation = (string) content.GetValueForProperty("AdditionalInformation",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal)this).AdditionalInformation, global::System.Convert.ToString); } AfterDeserializePSObject(content); } @@ -199,6 +207,18 @@ internal ShippingInformation(global::System.Management.Automation.PSObject conte /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Contains information about the Microsoft datacenter to which the drives should be shipped. [System.ComponentModel.TypeConverter(typeof(ShippingInformationTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ShippingInformation.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ShippingInformation.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ShippingInformation.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ShippingInformation.TypeConverter.cs index e3bd5ea7b19e..a87da8a3c35b 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ShippingInformation.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ShippingInformation.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ShippingInformation.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ShippingInformation.cs similarity index 92% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ShippingInformation.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ShippingInformation.cs index 77699ea57747..2b8ee22eec47 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ShippingInformation.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ShippingInformation.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -11,8 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 /// Contains information about the Microsoft datacenter to which the drives should be shipped. /// public partial class ShippingInformation : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal { /// Backing field for property. @@ -39,7 +39,7 @@ public partial class ShippingInformation : public string CountryOrRegion { get => this._countryOrRegion; set => this._countryOrRegion = value; } /// Internal Acessors for AdditionalInformation - string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformationInternal.AdditionalInformation { get => this._additionalInformation; set { {_additionalInformation = value;} } } + string Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformationInternal.AdditionalInformation { get => this._additionalInformation; set { {_additionalInformation = value;} } } /// Backing field for property. private string _phone; @@ -101,6 +101,9 @@ public partial interface IShippingInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = true, + Read = true, + Create = false, + Update = false, Description = @"Additional shipping information for customer, specific to datacenter to which customer should send their disks.", SerializedName = @"additionalInformation", PossibleTypes = new [] { typeof(string) })] @@ -109,6 +112,9 @@ public partial interface IShippingInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The city name to use when returning the drives.", SerializedName = @"city", PossibleTypes = new [] { typeof(string) })] @@ -117,6 +123,9 @@ public partial interface IShippingInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The country or region to use when returning the drives. ", SerializedName = @"countryOrRegion", PossibleTypes = new [] { typeof(string) })] @@ -125,6 +134,9 @@ public partial interface IShippingInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Phone number of the recipient of the returned drives.", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] @@ -133,6 +145,9 @@ public partial interface IShippingInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The postal code to use when returning the drives.", SerializedName = @"postalCode", PossibleTypes = new [] { typeof(string) })] @@ -143,6 +158,9 @@ public partial interface IShippingInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the recipient who will receive the hard drives when they are returned. ", SerializedName = @"recipientName", PossibleTypes = new [] { typeof(string) })] @@ -151,6 +169,9 @@ public partial interface IShippingInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The state or province to use when returning the drives.", SerializedName = @"stateOrProvince", PossibleTypes = new [] { typeof(string) })] @@ -159,6 +180,9 @@ public partial interface IShippingInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The first line of the street address to use when returning the drives. ", SerializedName = @"streetAddress1", PossibleTypes = new [] { typeof(string) })] @@ -167,6 +191,9 @@ public partial interface IShippingInformation : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The second line of the street address to use when returning the drives. ", SerializedName = @"streetAddress2", PossibleTypes = new [] { typeof(string) })] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ShippingInformation.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ShippingInformation.json.cs similarity index 93% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ShippingInformation.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/ShippingInformation.json.cs index 427107c65177..7f2dcdb112f2 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/ShippingInformation.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/ShippingInformation.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -56,13 +56,13 @@ public partial class ShippingInformation partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IShippingInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IShippingInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new ShippingInformation(json) : null; } @@ -79,15 +79,15 @@ internal ShippingInformation(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Run { return; } - {_recipientName = If( json?.PropertyT("recipientName"), out var __jsonRecipientName) ? (string)__jsonRecipientName : (string)RecipientName;} - {_streetAddress1 = If( json?.PropertyT("streetAddress1"), out var __jsonStreetAddress1) ? (string)__jsonStreetAddress1 : (string)StreetAddress1;} - {_streetAddress2 = If( json?.PropertyT("streetAddress2"), out var __jsonStreetAddress2) ? (string)__jsonStreetAddress2 : (string)StreetAddress2;} - {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)City;} - {_stateOrProvince = If( json?.PropertyT("stateOrProvince"), out var __jsonStateOrProvince) ? (string)__jsonStateOrProvince : (string)StateOrProvince;} - {_postalCode = If( json?.PropertyT("postalCode"), out var __jsonPostalCode) ? (string)__jsonPostalCode : (string)PostalCode;} - {_countryOrRegion = If( json?.PropertyT("countryOrRegion"), out var __jsonCountryOrRegion) ? (string)__jsonCountryOrRegion : (string)CountryOrRegion;} - {_phone = If( json?.PropertyT("phone"), out var __jsonPhone) ? (string)__jsonPhone : (string)Phone;} - {_additionalInformation = If( json?.PropertyT("additionalInformation"), out var __jsonAdditionalInformation) ? (string)__jsonAdditionalInformation : (string)AdditionalInformation;} + {_recipientName = If( json?.PropertyT("recipientName"), out var __jsonRecipientName) ? (string)__jsonRecipientName : (string)_recipientName;} + {_streetAddress1 = If( json?.PropertyT("streetAddress1"), out var __jsonStreetAddress1) ? (string)__jsonStreetAddress1 : (string)_streetAddress1;} + {_streetAddress2 = If( json?.PropertyT("streetAddress2"), out var __jsonStreetAddress2) ? (string)__jsonStreetAddress2 : (string)_streetAddress2;} + {_city = If( json?.PropertyT("city"), out var __jsonCity) ? (string)__jsonCity : (string)_city;} + {_stateOrProvince = If( json?.PropertyT("stateOrProvince"), out var __jsonStateOrProvince) ? (string)__jsonStateOrProvince : (string)_stateOrProvince;} + {_postalCode = If( json?.PropertyT("postalCode"), out var __jsonPostalCode) ? (string)__jsonPostalCode : (string)_postalCode;} + {_countryOrRegion = If( json?.PropertyT("countryOrRegion"), out var __jsonCountryOrRegion) ? (string)__jsonCountryOrRegion : (string)_countryOrRegion;} + {_phone = If( json?.PropertyT("phone"), out var __jsonPhone) ? (string)__jsonPhone : (string)_phone;} + {_additionalInformation = If( json?.PropertyT("additionalInformation"), out var __jsonAdditionalInformation) ? (string)__jsonAdditionalInformation : (string)_additionalInformation;} AfterFromJson(json); } @@ -118,7 +118,7 @@ public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode ToJ AddIf( null != (((object)this._postalCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString(this._postalCode.ToString()) : null, "postalCode" ,container.Add ); AddIf( null != (((object)this._countryOrRegion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString(this._countryOrRegion.ToString()) : null, "countryOrRegion" ,container.Add ); AddIf( null != (((object)this._phone)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString(this._phone.ToString()) : null, "phone" ,container.Add ); - if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeReadOnly)) + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeRead)) { AddIf( null != (((object)this._additionalInformation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonString(this._additionalInformation.ToString()) : null, "additionalInformation" ,container.Add ); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/SystemData.PowerShell.cs similarity index 63% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/SystemData.PowerShell.cs index dd8b8f2d0474..643d5289e586 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api20/SystemData.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/SystemData.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class SystemData partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new SystemData(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new SystemData(content); } @@ -85,10 +93,10 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISyst /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -103,33 +111,33 @@ internal SystemData(global::System.Collections.IDictionary content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. @@ -144,27 +152,27 @@ internal SystemData(global::System.Management.Automation.PSObject content) // actually deserialize if (content.Contains("CreatedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); } if (content.Contains("CreatedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).CreatedByType = (string) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).CreatedByType, global::System.Convert.ToString); } if (content.Contains("CreatedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } if (content.Contains("LastModifiedBy")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); } if (content.Contains("LastModifiedByType")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType.CreateFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).LastModifiedByType = (string) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).LastModifiedByType, global::System.Convert.ToString); } if (content.Contains("LastModifiedAt")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); } AfterDeserializePSObject(content); } @@ -173,6 +181,18 @@ internal SystemData(global::System.Management.Automation.PSObject content) /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } } /// Metadata pertaining to creation and last modification of the resource. [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/SystemData.TypeConverter.cs similarity index 98% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/SystemData.TypeConverter.cs index 7cde7c34575c..4e96dad2aadb 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api20/SystemData.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/SystemData.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -105,14 +105,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api20/SystemData.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/SystemData.cs similarity index 80% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api20/SystemData.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/SystemData.cs index 810a37585c71..5f0345c4a174 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api20/SystemData.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/SystemData.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Metadata pertaining to creation and last modification of the resource. public partial class SystemData : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemDataInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemDataInternal { /// Backing field for property. @@ -28,11 +28,11 @@ public partial class SystemData : public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? _createdByType; + private string _createdByType; /// The type of identity that created the resource. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? CreatedByType { get => this._createdByType; set => this._createdByType = value; } + public string CreatedByType { get => this._createdByType; set => this._createdByType = value; } /// Backing field for property. private global::System.DateTime? _lastModifiedAt; @@ -49,11 +49,11 @@ public partial class SystemData : public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? _lastModifiedByType; + private string _lastModifiedByType; /// The type of identity that last modified the resource. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } + public string LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } /// Creates an new instance. public SystemData() @@ -69,6 +69,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The timestamp of resource creation (UTC).", SerializedName = @"createdAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -77,6 +80,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity that created the resource.", SerializedName = @"createdBy", PossibleTypes = new [] { typeof(string) })] @@ -85,14 +91,21 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity that created the resource.", SerializedName = @"createdByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? CreatedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The timestamp of resource last modification (UTC)", SerializedName = @"lastModifiedAt", PossibleTypes = new [] { typeof(global::System.DateTime) })] @@ -101,6 +114,9 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The identity that last modified the resource.", SerializedName = @"lastModifiedBy", PossibleTypes = new [] { typeof(string) })] @@ -109,10 +125,14 @@ public partial interface ISystemData : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The type of identity that last modified the resource.", SerializedName = @"lastModifiedByType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? LastModifiedByType { get; set; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } /// Metadata pertaining to creation and last modification of the resource. @@ -124,13 +144,15 @@ internal partial interface ISystemDataInternal /// The identity that created the resource. string CreatedBy { get; set; } /// The type of identity that created the resource. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? CreatedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string CreatedByType { get; set; } /// The timestamp of resource last modification (UTC) global::System.DateTime? LastModifiedAt { get; set; } /// The identity that last modified the resource. string LastModifiedBy { get; set; } /// The type of identity that last modified the resource. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType? LastModifiedByType { get; set; } + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("User", "Application", "ManagedIdentity", "Key")] + string LastModifiedByType { get; set; } } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api20/SystemData.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/SystemData.json.cs similarity index 95% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api20/SystemData.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/SystemData.json.cs index 2a62bc766697..61f6f2e76e4e 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api20/SystemData.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/SystemData.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class SystemData partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api20.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new SystemData(json) : null; } @@ -77,12 +77,12 @@ internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json { return; } - {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} - {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType;} - {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt;} - {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy;} - {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType;} - {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt;} + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)_createdBy;} + {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)_createdByType;} + {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : _createdAt : _createdAt;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)_lastModifiedBy;} + {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)_lastModifiedByType;} + {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : _lastModifiedAt : _lastModifiedAt;} AfterFromJson(json); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParameters.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParameters.PowerShell.cs new file mode 100644 index 000000000000..ea6ea2130406 --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParameters.PowerShell.cs @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + + /// Update Job parameters + [System.ComponentModel.TypeConverter(typeof(UpdateJobParametersTypeConverter))] + public partial class UpdateJobParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UpdateJobParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UpdateJobParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UpdateJobParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParametersPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddressTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnShipping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShippingTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("CancelRequested")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).State, global::System.Convert.ToString); + } + if (content.Contains("LogLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).LogLevel, global::System.Convert.ToString); + } + if (content.Contains("BackupDriveManifest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DriveList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DriveList = (System.Collections.Generic.List) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DriveList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("ReturnAddressRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressCity, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressPhone, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressEmail, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierAccountNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DeliveryPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UpdateJobParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParametersPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnAddress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddressTypeConverter.ConvertFrom); + } + if (content.Contains("ReturnShipping")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShippingTypeConverter.ConvertFrom); + } + if (content.Contains("DeliveryPackage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformationTypeConverter.ConvertFrom); + } + if (content.Contains("CancelRequested")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).State, global::System.Convert.ToString); + } + if (content.Contains("LogLevel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).LogLevel, global::System.Convert.ToString); + } + if (content.Contains("BackupDriveManifest")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DriveList")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DriveList = (System.Collections.Generic.List) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DriveList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatusTypeConverter.ConvertFrom)); + } + if (content.Contains("ReturnAddressRecipientName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStreetAddress2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressCity, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPostalCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressPhone")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressPhone, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressEmail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressEmail, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressStateOrProvince")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); + } + if (content.Contains("ReturnAddressCountryOrRegion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); + } + if (content.Contains("ReturnShippingCarrierAccountNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageCarrierName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageTrackingNumber")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); + } + if (content.Contains("DeliveryPackageDriveCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("DeliveryPackageShipDate")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Update Job parameters + [System.ComponentModel.TypeConverter(typeof(UpdateJobParametersTypeConverter))] + public partial interface IUpdateJobParameters + + { + + } +} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParameters.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParameters.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParameters.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParameters.TypeConverter.cs index de924e9d4c43..399dd33fa1a6 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParameters.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParameters.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParameters.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParameters.cs similarity index 67% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParameters.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParameters.cs index 6809b843e436..34bafef3279f 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParameters.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParameters.cs @@ -3,116 +3,116 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Update Job parameters public partial class UpdateJobParameters : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal { /// /// Indicates whether the manifest files on the drives should be copied to block blobs. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public bool? BackupDriveManifest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).BackupDriveManifest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).BackupDriveManifest = value ?? default(bool); } + public bool? BackupDriveManifest { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).BackupDriveManifest; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).BackupDriveManifest = value ?? default(bool); } /// /// If specified, the value must be true. The service will attempt to cancel the job. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public bool? CancelRequested { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).CancelRequested; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).CancelRequested = value ?? default(bool); } + public bool? CancelRequested { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).CancelRequested; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).CancelRequested = value ?? default(bool); } /// The name of the carrier that is used to ship the import or export drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageCarrierName = value ?? null; } + public string DeliveryPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageCarrierName = value ?? null; } /// The number of drives included in the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public long? DeliveryPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageDriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageDriveCount = value ?? default(long); } + public long? DeliveryPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageDriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageDriveCount = value ?? default(long); } /// The date when the package is shipped. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageShipDate = value ?? null; } + public string DeliveryPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageShipDate = value ?? null; } /// The tracking number of the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageTrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageTrackingNumber = value ?? null; } + public string DeliveryPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageTrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackageTrackingNumber = value ?? null; } /// List of drives that comprise the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).DriveList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).DriveList = value ?? null /* arrayOf */; } + public System.Collections.Generic.List DriveList { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).DriveList; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).DriveList = value ?? null /* arrayOf */; } /// Indicates whether error logging or verbose logging is enabled. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string LogLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).LogLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).LogLevel = value ?? null; } + public string LogLevel { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).LogLevel; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).LogLevel = value ?? null; } /// Internal Acessors for DeliveryPackage - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal.DeliveryPackage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackage = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal.DeliveryPackage { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackage; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).DeliveryPackage = value; } /// Internal Acessors for Property - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParametersProperties()); set { {_property = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParametersProperties()); set { {_property = value;} } } /// Internal Acessors for ReturnAddress - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal.ReturnAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddress = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal.ReturnAddress { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddress; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddress = value; } /// Internal Acessors for ReturnShipping - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal.ReturnShipping { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnShipping; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnShipping = value; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersInternal.ReturnShipping { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnShipping; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnShipping = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties _property; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties _property; /// Specifies the properties of a UpdateJob. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParametersProperties()); set => this._property = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParametersProperties()); set => this._property = value; } /// The city name to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressCity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressCity = value ?? null; } + public string ReturnAddressCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressCity; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressCity = value ?? null; } /// The country or region to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressCountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressCountryOrRegion = value ?? null; } + public string ReturnAddressCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressCountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressCountryOrRegion = value ?? null; } /// Email address of the recipient of the returned drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressEmail = value ?? null; } + public string ReturnAddressEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressEmail; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressEmail = value ?? null; } /// Phone number of the recipient of the returned drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressPhone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressPhone = value ?? null; } + public string ReturnAddressPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressPhone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressPhone = value ?? null; } /// The postal code to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressPostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressPostalCode = value ?? null; } + public string ReturnAddressPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressPostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressPostalCode = value ?? null; } /// /// The name of the recipient who will receive the hard drives when they are returned. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressRecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressRecipientName = value ?? null; } + public string ReturnAddressRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressRecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressRecipientName = value ?? null; } /// The state or province to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressStateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressStateOrProvince = value ?? null; } + public string ReturnAddressStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressStateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressStateOrProvince = value ?? null; } /// The first line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressStreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressStreetAddress1 = value ?? null; } + public string ReturnAddressStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressStreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressStreetAddress1 = value ?? null; } /// The second line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressStreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressStreetAddress2 = value ?? null; } + public string ReturnAddressStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressStreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnAddressStreetAddress2 = value ?? null; } /// The customer's account number with the carrier. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnShippingCarrierAccountNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnShippingCarrierAccountNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnShippingCarrierAccountNumber = value ?? null; } + public string ReturnShippingCarrierAccountNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnShippingCarrierAccountNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnShippingCarrierAccountNumber = value ?? null; } /// The carrier's name. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnShippingCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnShippingCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).ReturnShippingCarrierName = value ?? null; } + public string ReturnShippingCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnShippingCarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).ReturnShippingCarrierName = value ?? null; } /// /// If specified, the value must be Shipping, which tells the Import/Export service that the package for the job has been @@ -120,14 +120,14 @@ public partial class UpdateJobParameters : /// otherwise the request will fail. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string State { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal)Property).State = value ?? null; } + public string State { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)Property).State = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags _tag; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags _tag; /// Specifies the tags that will be assigned to the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParametersTags()); set => this._tag = value; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParametersTags()); set => this._tag = value; } /// Creates an new instance. public UpdateJobParameters() @@ -145,6 +145,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the manifest files on the drives should be copied to block blobs.", SerializedName = @"backupDriveManifest", PossibleTypes = new [] { typeof(bool) })] @@ -155,6 +158,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If specified, the value must be true. The service will attempt to cancel the job. ", SerializedName = @"cancelRequested", PossibleTypes = new [] { typeof(bool) })] @@ -163,6 +169,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the carrier that is used to ship the import or export drives.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -171,6 +180,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of drives included in the package.", SerializedName = @"driveCount", PossibleTypes = new [] { typeof(long) })] @@ -179,6 +191,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The date when the package is shipped.", SerializedName = @"shipDate", PossibleTypes = new [] { typeof(string) })] @@ -187,6 +202,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tracking number of the package.", SerializedName = @"trackingNumber", PossibleTypes = new [] { typeof(string) })] @@ -195,14 +213,20 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of drives that comprise the job.", SerializedName = @"driveList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus) })] + System.Collections.Generic.List DriveList { get; set; } /// Indicates whether error logging or verbose logging is enabled. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether error logging or verbose logging is enabled.", SerializedName = @"logLevel", PossibleTypes = new [] { typeof(string) })] @@ -211,6 +235,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The city name to use when returning the drives.", SerializedName = @"city", PossibleTypes = new [] { typeof(string) })] @@ -219,6 +246,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The country or region to use when returning the drives. ", SerializedName = @"countryOrRegion", PossibleTypes = new [] { typeof(string) })] @@ -227,6 +257,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email address of the recipient of the returned drives.", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -235,6 +268,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Phone number of the recipient of the returned drives.", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] @@ -243,6 +279,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The postal code to use when returning the drives.", SerializedName = @"postalCode", PossibleTypes = new [] { typeof(string) })] @@ -253,6 +292,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the recipient who will receive the hard drives when they are returned. ", SerializedName = @"recipientName", PossibleTypes = new [] { typeof(string) })] @@ -261,6 +303,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The state or province to use when returning the drives.", SerializedName = @"stateOrProvince", PossibleTypes = new [] { typeof(string) })] @@ -269,6 +314,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The first line of the street address to use when returning the drives. ", SerializedName = @"streetAddress1", PossibleTypes = new [] { typeof(string) })] @@ -277,6 +325,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The second line of the street address to use when returning the drives. ", SerializedName = @"streetAddress2", PossibleTypes = new [] { typeof(string) })] @@ -285,6 +336,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The customer's account number with the carrier.", SerializedName = @"carrierAccountNumber", PossibleTypes = new [] { typeof(string) })] @@ -293,6 +347,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The carrier's name.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -305,6 +362,9 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If specified, the value must be Shipping, which tells the Import/Export service that the package for the job has been shipped. The ReturnAddress and DeliveryPackage properties must have been set either in this request or in a previous request, otherwise the request will fail. ", SerializedName = @"state", PossibleTypes = new [] { typeof(string) })] @@ -313,10 +373,13 @@ public partial interface IUpdateJobParameters : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Specifies the tags that will be assigned to the job.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags Tag { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags Tag { get; set; } } /// Update Job parameters @@ -334,7 +397,7 @@ internal partial interface IUpdateJobParametersInternal /// /// Contains information about the package being shipped by the customer to the Microsoft data center. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation DeliveryPackage { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation DeliveryPackage { get; set; } /// The name of the carrier that is used to ship the import or export drives. string DeliveryPackageCarrierName { get; set; } /// The number of drives included in the package. @@ -344,13 +407,13 @@ internal partial interface IUpdateJobParametersInternal /// The tracking number of the package. string DeliveryPackageTrackingNumber { get; set; } /// List of drives that comprise the job. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get; set; } + System.Collections.Generic.List DriveList { get; set; } /// Indicates whether error logging or verbose logging is enabled. string LogLevel { get; set; } /// Specifies the properties of a UpdateJob. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties Property { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties Property { get; set; } /// Specifies the return address information for the job. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress ReturnAddress { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress ReturnAddress { get; set; } /// The city name to use when returning the drives. string ReturnAddressCity { get; set; } /// The country or region to use when returning the drives. @@ -372,7 +435,7 @@ internal partial interface IUpdateJobParametersInternal /// The second line of the street address to use when returning the drives. string ReturnAddressStreetAddress2 { get; set; } /// Specifies the return carrier and customer's account with the carrier. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping ReturnShipping { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping ReturnShipping { get; set; } /// The customer's account number with the carrier. string ReturnShippingCarrierAccountNumber { get; set; } /// The carrier's name. @@ -384,7 +447,7 @@ internal partial interface IUpdateJobParametersInternal /// string State { get; set; } /// Specifies the tags that will be assigned to the job. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags Tag { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags Tag { get; set; } } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParameters.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParameters.json.cs similarity index 93% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParameters.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParameters.json.cs index 52fde2283922..de2e2a833d56 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParameters.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParameters.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class UpdateJobParameters partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new UpdateJobParameters(json) : null; } @@ -102,8 +102,8 @@ internal UpdateJobParameters(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Run { return; } - {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParametersProperties.FromJson(__jsonProperties) : Property;} - {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParametersTags.FromJson(__jsonTags) : Tag;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParametersProperties.FromJson(__jsonProperties) : _property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParametersTags.FromJson(__jsonTags) : _tag;} AfterFromJson(json); } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParameters.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersProperties.PowerShell.cs similarity index 60% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParameters.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersProperties.PowerShell.cs index 5e20b076b067..849c139d5a0d 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParameters.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersProperties.PowerShell.cs @@ -3,13 +3,13 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; - /// Update Job parameters - [System.ComponentModel.TypeConverter(typeof(UpdateJobParametersTypeConverter))] - public partial class UpdateJobParameters + /// Specifies the properties of a UpdateJob. + [System.ComponentModel.TypeConverter(typeof(UpdateJobParametersPropertiesTypeConverter))] + public partial class UpdateJobParametersProperties { /// @@ -55,49 +55,69 @@ public partial class UpdateJobParameters partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) { - return new UpdateJobParameters(content); + return new UpdateJobParametersProperties(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { - return new UpdateJobParameters(content); + return new UpdateJobParametersProperties(content); } /// - /// Creates a new instance of , deserializing the content from a json string. + /// Creates a new instance of , deserializing the content from a json string. /// /// a string containing a JSON serialized instance of this model. - /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. - internal UpdateJobParameters(global::System.Collections.IDictionary content) + internal UpdateJobParametersProperties(global::System.Collections.IDictionary content) { bool returnNow = false; BeforeDeserializeDictionary(content, ref returnNow); @@ -106,115 +126,107 @@ internal UpdateJobParameters(global::System.Collections.IDictionary content) return; } // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParametersPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParametersTagsTypeConverter.ConvertFrom); - } if (content.Contains("ReturnAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddressTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddressTypeConverter.ConvertFrom); } if (content.Contains("ReturnShipping")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShippingTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShippingTypeConverter.ConvertFrom); } if (content.Contains("DeliveryPackage")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformationTypeConverter.ConvertFrom); } if (content.Contains("CancelRequested")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).State, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).State, global::System.Convert.ToString); } if (content.Contains("LogLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).LogLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).LogLevel, global::System.Convert.ToString); } if (content.Contains("BackupDriveManifest")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("DriveList")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DriveList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DriveList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatusTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DriveList = (System.Collections.Generic.List) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DriveList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatusTypeConverter.ConvertFrom)); } if (content.Contains("ReturnAddressRecipientName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); } if (content.Contains("ReturnAddressStreetAddress1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); } if (content.Contains("ReturnAddressStreetAddress2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); } if (content.Contains("ReturnAddressCity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressCity, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCity, global::System.Convert.ToString); } if (content.Contains("ReturnAddressPostalCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); } if (content.Contains("ReturnAddressPhone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressPhone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPhone, global::System.Convert.ToString); } if (content.Contains("ReturnAddressEmail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressEmail, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressEmail, global::System.Convert.ToString); } if (content.Contains("ReturnShippingCarrierName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); } if (content.Contains("ReturnAddressStateOrProvince")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); } if (content.Contains("ReturnAddressCountryOrRegion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); } if (content.Contains("ReturnShippingCarrierAccountNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); } if (content.Contains("DeliveryPackageCarrierName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); } if (content.Contains("DeliveryPackageTrackingNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); } if (content.Contains("DeliveryPackageDriveCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("DeliveryPackageShipDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); } AfterDeserializeDictionary(content); } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. - internal UpdateJobParameters(global::System.Management.Automation.PSObject content) + internal UpdateJobParametersProperties(global::System.Management.Automation.PSObject content) { bool returnNow = false; BeforeDeserializePSObject(content, ref returnNow); @@ -223,112 +235,104 @@ internal UpdateJobParameters(global::System.Management.Automation.PSObject conte return; } // actually deserialize - if (content.Contains("Property")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParametersPropertiesTypeConverter.ConvertFrom); - } - if (content.Contains("Tag")) - { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParametersTagsTypeConverter.ConvertFrom); - } if (content.Contains("ReturnAddress")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddressTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddress = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress) content.GetValueForProperty("ReturnAddress",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddress, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddressTypeConverter.ConvertFrom); } if (content.Contains("ReturnShipping")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShippingTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnShipping = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping) content.GetValueForProperty("ReturnShipping",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnShipping, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShippingTypeConverter.ConvertFrom); } if (content.Contains("DeliveryPackage")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformationTypeConverter.ConvertFrom); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackage = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation) content.GetValueForProperty("DeliveryPackage",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackage, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformationTypeConverter.ConvertFrom); } if (content.Contains("CancelRequested")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).CancelRequested = (bool?) content.GetValueForProperty("CancelRequested",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).CancelRequested, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("State")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).State, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).State = (string) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).State, global::System.Convert.ToString); } if (content.Contains("LogLevel")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).LogLevel, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).LogLevel = (string) content.GetValueForProperty("LogLevel",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).LogLevel, global::System.Convert.ToString); } if (content.Contains("BackupDriveManifest")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).BackupDriveManifest = (bool?) content.GetValueForProperty("BackupDriveManifest",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).BackupDriveManifest, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); } if (content.Contains("DriveList")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DriveList = (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[]) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DriveList, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatusTypeConverter.ConvertFrom)); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DriveList = (System.Collections.Generic.List) content.GetValueForProperty("DriveList",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DriveList, __y => TypeConverterExtensions.SelectToList(__y, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatusTypeConverter.ConvertFrom)); } if (content.Contains("ReturnAddressRecipientName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressRecipientName = (string) content.GetValueForProperty("ReturnAddressRecipientName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressRecipientName, global::System.Convert.ToString); } if (content.Contains("ReturnAddressStreetAddress1")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress1 = (string) content.GetValueForProperty("ReturnAddressStreetAddress1",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress1, global::System.Convert.ToString); } if (content.Contains("ReturnAddressStreetAddress2")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress2 = (string) content.GetValueForProperty("ReturnAddressStreetAddress2",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStreetAddress2, global::System.Convert.ToString); } if (content.Contains("ReturnAddressCity")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressCity, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCity = (string) content.GetValueForProperty("ReturnAddressCity",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCity, global::System.Convert.ToString); } if (content.Contains("ReturnAddressPostalCode")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPostalCode = (string) content.GetValueForProperty("ReturnAddressPostalCode",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPostalCode, global::System.Convert.ToString); } if (content.Contains("ReturnAddressPhone")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressPhone, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPhone = (string) content.GetValueForProperty("ReturnAddressPhone",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressPhone, global::System.Convert.ToString); } if (content.Contains("ReturnAddressEmail")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressEmail, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressEmail = (string) content.GetValueForProperty("ReturnAddressEmail",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressEmail, global::System.Convert.ToString); } if (content.Contains("ReturnShippingCarrierName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierName = (string) content.GetValueForProperty("ReturnShippingCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierName, global::System.Convert.ToString); } if (content.Contains("ReturnAddressStateOrProvince")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStateOrProvince = (string) content.GetValueForProperty("ReturnAddressStateOrProvince",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressStateOrProvince, global::System.Convert.ToString); } if (content.Contains("ReturnAddressCountryOrRegion")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCountryOrRegion = (string) content.GetValueForProperty("ReturnAddressCountryOrRegion",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnAddressCountryOrRegion, global::System.Convert.ToString); } if (content.Contains("ReturnShippingCarrierAccountNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierAccountNumber = (string) content.GetValueForProperty("ReturnShippingCarrierAccountNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).ReturnShippingCarrierAccountNumber, global::System.Convert.ToString); } if (content.Contains("DeliveryPackageCarrierName")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageCarrierName = (string) content.GetValueForProperty("DeliveryPackageCarrierName",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageCarrierName, global::System.Convert.ToString); } if (content.Contains("DeliveryPackageTrackingNumber")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageTrackingNumber = (string) content.GetValueForProperty("DeliveryPackageTrackingNumber",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageTrackingNumber, global::System.Convert.ToString); } if (content.Contains("DeliveryPackageDriveCount")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageDriveCount = (long?) content.GetValueForProperty("DeliveryPackageDriveCount",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageDriveCount, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); } if (content.Contains("DeliveryPackageShipDate")) { - ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageShipDate = (string) content.GetValueForProperty("DeliveryPackageShipDate",((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal)this).DeliveryPackageShipDate, global::System.Convert.ToString); } AfterDeserializePSObject(content); } } - /// Update Job parameters - [System.ComponentModel.TypeConverter(typeof(UpdateJobParametersTypeConverter))] - public partial interface IUpdateJobParameters + /// Specifies the properties of a UpdateJob. + [System.ComponentModel.TypeConverter(typeof(UpdateJobParametersPropertiesTypeConverter))] + public partial interface IUpdateJobParametersProperties { diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersProperties.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersProperties.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersProperties.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersProperties.TypeConverter.cs index 4e9ae94263d5..96c2b8c74950 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersProperties.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersProperties.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersProperties.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersProperties.cs similarity index 73% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersProperties.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersProperties.cs index adf18f30c860..201f1964c665 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersProperties.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersProperties.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Specifies the properties of a UpdateJob. public partial class UpdateJobParametersProperties : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal { /// Backing field for property. @@ -32,36 +32,36 @@ public partial class UpdateJobParametersProperties : public bool? CancelRequested { get => this._cancelRequested; set => this._cancelRequested = value; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation _deliveryPackage; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation _deliveryPackage; /// /// Contains information about the package being shipped by the customer to the Microsoft data center. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation DeliveryPackage { get => (this._deliveryPackage = this._deliveryPackage ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformation()); set => this._deliveryPackage = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation DeliveryPackage { get => (this._deliveryPackage = this._deliveryPackage ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformation()); set => this._deliveryPackage = value; } /// The name of the carrier that is used to ship the import or export drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).CarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).CarrierName = value ?? null; } + public string DeliveryPackageCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).CarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).CarrierName = value ?? null; } /// The number of drives included in the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public long? DeliveryPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).DriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).DriveCount = value ?? default(long); } + public long? DeliveryPackageDriveCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).DriveCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).DriveCount = value ?? default(long); } /// The date when the package is shipped. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).ShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).ShipDate = value ?? null; } + public string DeliveryPackageShipDate { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).ShipDate; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).ShipDate = value ?? null; } /// The tracking number of the package. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string DeliveryPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).TrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformationInternal)DeliveryPackage).TrackingNumber = value ?? null; } + public string DeliveryPackageTrackingNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).TrackingNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformationInternal)DeliveryPackage).TrackingNumber = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] _driveList; + private System.Collections.Generic.List _driveList; /// List of drives that comprise the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get => this._driveList; set => this._driveList = value; } + public System.Collections.Generic.List DriveList { get => this._driveList; set => this._driveList = value; } /// Backing field for property. private string _logLevel; @@ -71,73 +71,73 @@ public partial class UpdateJobParametersProperties : public string LogLevel { get => this._logLevel; set => this._logLevel = value; } /// Internal Acessors for DeliveryPackage - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal.DeliveryPackage { get => (this._deliveryPackage = this._deliveryPackage ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformation()); set { {_deliveryPackage = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal.DeliveryPackage { get => (this._deliveryPackage = this._deliveryPackage ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformation()); set { {_deliveryPackage = value;} } } /// Internal Acessors for ReturnAddress - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal.ReturnAddress { get => (this._returnAddress = this._returnAddress ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddress()); set { {_returnAddress = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal.ReturnAddress { get => (this._returnAddress = this._returnAddress ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddress()); set { {_returnAddress = value;} } } /// Internal Acessors for ReturnShipping - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersPropertiesInternal.ReturnShipping { get => (this._returnShipping = this._returnShipping ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShipping()); set { {_returnShipping = value;} } } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersPropertiesInternal.ReturnShipping { get => (this._returnShipping = this._returnShipping ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShipping()); set { {_returnShipping = value;} } } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress _returnAddress; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress _returnAddress; /// Specifies the return address information for the job. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress ReturnAddress { get => (this._returnAddress = this._returnAddress ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddress()); set => this._returnAddress = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress ReturnAddress { get => (this._returnAddress = this._returnAddress ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddress()); set => this._returnAddress = value; } /// The city name to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).City; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).City = value ?? null; } + public string ReturnAddressCity { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).City; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).City = value ?? null; } /// The country or region to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).CountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).CountryOrRegion = value ?? null; } + public string ReturnAddressCountryOrRegion { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).CountryOrRegion; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).CountryOrRegion = value ?? null; } /// Email address of the recipient of the returned drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).Email = value ?? null; } + public string ReturnAddressEmail { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).Email; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).Email = value ?? null; } /// Phone number of the recipient of the returned drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).Phone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).Phone = value ?? null; } + public string ReturnAddressPhone { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).Phone; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).Phone = value ?? null; } /// The postal code to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).PostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).PostalCode = value ?? null; } + public string ReturnAddressPostalCode { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).PostalCode; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).PostalCode = value ?? null; } /// /// The name of the recipient who will receive the hard drives when they are returned. /// [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).RecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).RecipientName = value ?? null; } + public string ReturnAddressRecipientName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).RecipientName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).RecipientName = value ?? null; } /// The state or province to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).StateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).StateOrProvince = value ?? null; } + public string ReturnAddressStateOrProvince { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).StateOrProvince; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).StateOrProvince = value ?? null; } /// The first line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).StreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).StreetAddress1 = value ?? null; } + public string ReturnAddressStreetAddress1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).StreetAddress1; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).StreetAddress1 = value ?? null; } /// The second line of the street address to use when returning the drives. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnAddressStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).StreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddressInternal)ReturnAddress).StreetAddress2 = value ?? null; } + public string ReturnAddressStreetAddress2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).StreetAddress2; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddressInternal)ReturnAddress).StreetAddress2 = value ?? null; } /// Backing field for property. - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping _returnShipping; + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping _returnShipping; /// Specifies the return carrier and customer's account with the carrier. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Owned)] - internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping ReturnShipping { get => (this._returnShipping = this._returnShipping ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShipping()); set => this._returnShipping = value; } + internal Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping ReturnShipping { get => (this._returnShipping = this._returnShipping ?? new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShipping()); set => this._returnShipping = value; } /// The customer's account number with the carrier. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnShippingCarrierAccountNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)ReturnShipping).CarrierAccountNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)ReturnShipping).CarrierAccountNumber = value ?? null; } + public string ReturnShippingCarrierAccountNumber { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)ReturnShipping).CarrierAccountNumber; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)ReturnShipping).CarrierAccountNumber = value ?? null; } /// The carrier's name. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Origin(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PropertyOrigin.Inlined)] - public string ReturnShippingCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)ReturnShipping).CarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShippingInternal)ReturnShipping).CarrierName = value ?? null; } + public string ReturnShippingCarrierName { get => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)ReturnShipping).CarrierName; set => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShippingInternal)ReturnShipping).CarrierName = value ?? null; } /// Backing field for property. private string _state; @@ -166,6 +166,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether the manifest files on the drives should be copied to block blobs.", SerializedName = @"backupDriveManifest", PossibleTypes = new [] { typeof(bool) })] @@ -176,6 +179,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If specified, the value must be true. The service will attempt to cancel the job. ", SerializedName = @"cancelRequested", PossibleTypes = new [] { typeof(bool) })] @@ -184,6 +190,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the carrier that is used to ship the import or export drives.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -192,6 +201,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The number of drives included in the package.", SerializedName = @"driveCount", PossibleTypes = new [] { typeof(long) })] @@ -200,6 +212,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The date when the package is shipped.", SerializedName = @"shipDate", PossibleTypes = new [] { typeof(string) })] @@ -208,6 +223,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The tracking number of the package.", SerializedName = @"trackingNumber", PossibleTypes = new [] { typeof(string) })] @@ -216,14 +234,20 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"List of drives that comprise the job.", SerializedName = @"driveList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus) })] - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get; set; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus) })] + System.Collections.Generic.List DriveList { get; set; } /// Indicates whether error logging or verbose logging is enabled. [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Indicates whether error logging or verbose logging is enabled.", SerializedName = @"logLevel", PossibleTypes = new [] { typeof(string) })] @@ -232,6 +256,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The city name to use when returning the drives.", SerializedName = @"city", PossibleTypes = new [] { typeof(string) })] @@ -240,6 +267,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The country or region to use when returning the drives. ", SerializedName = @"countryOrRegion", PossibleTypes = new [] { typeof(string) })] @@ -248,6 +278,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Email address of the recipient of the returned drives.", SerializedName = @"email", PossibleTypes = new [] { typeof(string) })] @@ -256,6 +289,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"Phone number of the recipient of the returned drives.", SerializedName = @"phone", PossibleTypes = new [] { typeof(string) })] @@ -264,6 +300,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The postal code to use when returning the drives.", SerializedName = @"postalCode", PossibleTypes = new [] { typeof(string) })] @@ -274,6 +313,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The name of the recipient who will receive the hard drives when they are returned. ", SerializedName = @"recipientName", PossibleTypes = new [] { typeof(string) })] @@ -282,6 +324,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The state or province to use when returning the drives.", SerializedName = @"stateOrProvince", PossibleTypes = new [] { typeof(string) })] @@ -290,6 +335,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The first line of the street address to use when returning the drives. ", SerializedName = @"streetAddress1", PossibleTypes = new [] { typeof(string) })] @@ -298,6 +346,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The second line of the street address to use when returning the drives. ", SerializedName = @"streetAddress2", PossibleTypes = new [] { typeof(string) })] @@ -306,6 +357,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The customer's account number with the carrier.", SerializedName = @"carrierAccountNumber", PossibleTypes = new [] { typeof(string) })] @@ -314,6 +368,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"The carrier's name.", SerializedName = @"carrierName", PossibleTypes = new [] { typeof(string) })] @@ -326,6 +383,9 @@ public partial interface IUpdateJobParametersProperties : [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( Required = false, ReadOnly = false, + Read = true, + Create = true, + Update = true, Description = @"If specified, the value must be Shipping, which tells the Import/Export service that the package for the job has been shipped. The ReturnAddress and DeliveryPackage properties must have been set either in this request or in a previous request, otherwise the request will fail. ", SerializedName = @"state", PossibleTypes = new [] { typeof(string) })] @@ -347,7 +407,7 @@ internal partial interface IUpdateJobParametersPropertiesInternal /// /// Contains information about the package being shipped by the customer to the Microsoft data center. /// - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDeliveryPackageInformation DeliveryPackage { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDeliveryPackageInformation DeliveryPackage { get; set; } /// The name of the carrier that is used to ship the import or export drives. string DeliveryPackageCarrierName { get; set; } /// The number of drives included in the package. @@ -357,11 +417,11 @@ internal partial interface IUpdateJobParametersPropertiesInternal /// The tracking number of the package. string DeliveryPackageTrackingNumber { get; set; } /// List of drives that comprise the job. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get; set; } + System.Collections.Generic.List DriveList { get; set; } /// Indicates whether error logging or verbose logging is enabled. string LogLevel { get; set; } /// Specifies the return address information for the job. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnAddress ReturnAddress { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnAddress ReturnAddress { get; set; } /// The city name to use when returning the drives. string ReturnAddressCity { get; set; } /// The country or region to use when returning the drives. @@ -383,7 +443,7 @@ internal partial interface IUpdateJobParametersPropertiesInternal /// The second line of the street address to use when returning the drives. string ReturnAddressStreetAddress2 { get; set; } /// Specifies the return carrier and customer's account with the carrier. - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IReturnShipping ReturnShipping { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IReturnShipping ReturnShipping { get; set; } /// The customer's account number with the carrier. string ReturnShippingCarrierAccountNumber { get; set; } /// The carrier's name. diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersProperties.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersProperties.json.cs similarity index 88% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersProperties.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersProperties.json.cs index 13c57cd79654..c20ca75ee907 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersProperties.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersProperties.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class UpdateJobParametersProperties partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new UpdateJobParametersProperties(json) : null; } @@ -116,14 +116,14 @@ internal UpdateJobParametersProperties(Microsoft.Azure.PowerShell.Cmdlets.Import { return; } - {_returnAddress = If( json?.PropertyT("returnAddress"), out var __jsonReturnAddress) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnAddress.FromJson(__jsonReturnAddress) : ReturnAddress;} - {_returnShipping = If( json?.PropertyT("returnShipping"), out var __jsonReturnShipping) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ReturnShipping.FromJson(__jsonReturnShipping) : ReturnShipping;} - {_deliveryPackage = If( json?.PropertyT("deliveryPackage"), out var __jsonDeliveryPackage) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DeliveryPackageInformation.FromJson(__jsonDeliveryPackage) : DeliveryPackage;} - {_cancelRequested = If( json?.PropertyT("cancelRequested"), out var __jsonCancelRequested) ? (bool?)__jsonCancelRequested : CancelRequested;} - {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} - {_logLevel = If( json?.PropertyT("logLevel"), out var __jsonLogLevel) ? (string)__jsonLogLevel : (string)LogLevel;} - {_backupDriveManifest = If( json?.PropertyT("backupDriveManifest"), out var __jsonBackupDriveManifest) ? (bool?)__jsonBackupDriveManifest : BackupDriveManifest;} - {_driveList = If( json?.PropertyT("driveList"), out var __jsonDriveList) ? If( __jsonDriveList as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.DriveStatus.FromJson(__u) )) ))() : null : DriveList;} + {_returnAddress = If( json?.PropertyT("returnAddress"), out var __jsonReturnAddress) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnAddress.FromJson(__jsonReturnAddress) : _returnAddress;} + {_returnShipping = If( json?.PropertyT("returnShipping"), out var __jsonReturnShipping) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ReturnShipping.FromJson(__jsonReturnShipping) : _returnShipping;} + {_deliveryPackage = If( json?.PropertyT("deliveryPackage"), out var __jsonDeliveryPackage) ? Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DeliveryPackageInformation.FromJson(__jsonDeliveryPackage) : _deliveryPackage;} + {_cancelRequested = If( json?.PropertyT("cancelRequested"), out var __jsonCancelRequested) ? (bool?)__jsonCancelRequested : _cancelRequested;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)_state;} + {_logLevel = If( json?.PropertyT("logLevel"), out var __jsonLogLevel) ? (string)__jsonLogLevel : (string)_logLevel;} + {_backupDriveManifest = If( json?.PropertyT("backupDriveManifest"), out var __jsonBackupDriveManifest) ? (bool?)__jsonBackupDriveManifest : _backupDriveManifest;} + {_driveList = If( json?.PropertyT("driveList"), out var __jsonDriveList) ? If( __jsonDriveList as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonArray, out var __v) ? new global::System.Func>(()=> global::System.Linq.Enumerable.ToList(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus) (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.DriveStatus.FromJson(__u) )) ))() : null : _driveList;} AfterFromJson(json); } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.PowerShell.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.PowerShell.cs similarity index 81% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.PowerShell.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.PowerShell.cs index eefbd862b7bb..94f74eeadf63 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.PowerShell.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.PowerShell.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -55,27 +55,35 @@ public partial class UpdateJobParametersTags partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); /// - /// Deserializes a into an instance of OverrideToString will be called if it is implemented. Implement this method in a partial class to enable this behavior + /// + /// /// instance serialized to a string, normally it is a Json + /// /// set returnNow to true if you provide a customized OverrideToString function + + partial void OverrideToString(ref string stringResult, ref bool returnNow); + + /// + /// Deserializes a into an instance of . /// /// The global::System.Collections.IDictionary content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) { return new UpdateJobParametersTags(content); } /// - /// Deserializes a into an instance of into an instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. /// - /// an instance of . + /// an instance of . /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) { return new UpdateJobParametersTags(content); } @@ -85,15 +93,27 @@ public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.I /// /// a string containing a JSON serialized instance of this model. /// an instance of the model class. - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode.Parse(jsonText)); /// Serializes this instance to a json string. /// a containing this model serialized to JSON text. public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeAll)?.ToString(); + public override string ToString() + { + var returnNow = false; + var result = global::System.String.Empty; + OverrideToString(ref result, ref returnNow); + if (returnNow) + { + return result; + } + return ToJsonString(); + } + /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Collections.IDictionary content that should be used. @@ -112,7 +132,7 @@ internal UpdateJobParametersTags(global::System.Collections.IDictionary content) } /// - /// Deserializes a into a new instance of into a new instance of . /// /// The global::System.Management.Automation.PSObject content that should be used. diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.TypeConverter.cs similarity index 97% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.TypeConverter.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.TypeConverter.cs index f48754bd3830..1a6f65ef415f 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.TypeConverter.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.TypeConverter.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; @@ -106,14 +106,14 @@ public static bool CanConvertFrom(dynamic sourceValue) /// /// an instance of , or null if there is no suitable conversion. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags ConvertFrom(dynamic sourceValue) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags ConvertFrom(dynamic sourceValue) { if (null == sourceValue) { return null; } global::System.Type type = sourceValue.GetType(); - if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags).IsAssignableFrom(type)) + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags).IsAssignableFrom(type)) { return sourceValue; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.cs similarity index 84% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.cs index 3b650bc7de32..35b19cfde543 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.cs @@ -3,14 +3,14 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; /// Specifies the tags that will be assigned to the job. public partial class UpdateJobParametersTags : - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTagsInternal + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTagsInternal { /// Creates an new instance. diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.dictionary.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.dictionary.cs similarity index 96% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.dictionary.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.dictionary.cs index d43097890e5e..d4c01d1be2a3 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.dictionary.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.dictionary.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -70,6 +70,6 @@ public void CopyFrom(global::System.Management.Automation.PSObject source) /// - public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParametersTags source) => source.__additionalProperties; + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParametersTags source) => source.__additionalProperties; } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.json.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.json.cs similarity index 96% rename from generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.json.cs rename to generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.json.cs index 5f64d4617f5b..b05ef7d2da54 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Models/Api202101/UpdateJobParametersTags.json.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/api/Models/UpdateJobParametersTags.json.cs @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101 +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; @@ -54,13 +54,13 @@ public partial class UpdateJobParametersTags partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject container, ref bool returnNow); /// - /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags. + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags. /// /// a to deserialize from. /// - /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags. + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags. /// - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) + public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonNode node) { return node is Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Json.JsonObject json ? new UpdateJobParametersTags(json) : null; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/CreatedByType.Completer.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Support/CreatedByType.Completer.cs deleted file mode 100644 index e2dacabbee95..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/CreatedByType.Completer.cs +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support -{ - - /// The type of identity that created the resource. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByTypeTypeConverter))] - public partial struct CreatedByType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Application".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Application'", "Application", global::System.Management.Automation.CompletionResultType.ParameterValue, "Application"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ManagedIdentity'", "ManagedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagedIdentity"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Key".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Key'", "Key", global::System.Management.Automation.CompletionResultType.ParameterValue, "Key"); - } - } - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs deleted file mode 100644 index eb43939a8348..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/CreatedByType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support -{ - - /// The type of identity that created the resource. - public partial class CreatedByTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CreatedByType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/CreatedByType.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Support/CreatedByType.cs deleted file mode 100644 index 7e39191c0b7f..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/CreatedByType.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support -{ - - /// The type of identity that created the resource. - public partial struct CreatedByType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType Application = @"Application"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType Key = @"Key"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType User = @"User"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to CreatedByType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new CreatedByType(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private CreatedByType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type CreatedByType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type CreatedByType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is CreatedByType && Equals((CreatedByType)obj); - } - - /// Returns hashCode for enum CreatedByType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for CreatedByType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to CreatedByType - /// the value to convert to an instance of . - - public static implicit operator CreatedByType(string value) - { - return new CreatedByType(value); - } - - /// Implicit operator to convert CreatedByType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType e) - { - return e._value; - } - - /// Overriding != operator for enum CreatedByType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum CreatedByType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.CreatedByType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/DriveState.Completer.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Support/DriveState.Completer.cs deleted file mode 100644 index 1fe6c9d1b5d8..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/DriveState.Completer.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support -{ - - /// The drive's current state. - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveStateTypeConverter))] - public partial struct DriveState : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Specified".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Specified'", "Specified", global::System.Management.Automation.CompletionResultType.ParameterValue, "Specified"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Received".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Received'", "Received", global::System.Management.Automation.CompletionResultType.ParameterValue, "Received"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "NeverReceived".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'NeverReceived'", "NeverReceived", global::System.Management.Automation.CompletionResultType.ParameterValue, "NeverReceived"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Transferring".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Transferring'", "Transferring", global::System.Management.Automation.CompletionResultType.ParameterValue, "Transferring"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "CompletedMoreInfo".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'CompletedMoreInfo'", "CompletedMoreInfo", global::System.Management.Automation.CompletionResultType.ParameterValue, "CompletedMoreInfo"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "ShippedBack".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'ShippedBack'", "ShippedBack", global::System.Management.Automation.CompletionResultType.ParameterValue, "ShippedBack"); - } - } - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/DriveState.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Support/DriveState.TypeConverter.cs deleted file mode 100644 index 1e0a8400d736..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/DriveState.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support -{ - - /// The drive's current state. - public partial class DriveStateTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DriveState.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/DriveState.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Support/DriveState.cs deleted file mode 100644 index bae0886343a8..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/DriveState.cs +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support -{ - - /// The drive's current state. - public partial struct DriveState : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState Completed = @"Completed"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState CompletedMoreInfo = @"CompletedMoreInfo"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState NeverReceived = @"NeverReceived"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState Received = @"Received"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState ShippedBack = @"ShippedBack"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState Specified = @"Specified"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState Transferring = @"Transferring"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to DriveState - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new DriveState(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private DriveState(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type DriveState - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type DriveState (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is DriveState && Equals((DriveState)obj); - } - - /// Returns hashCode for enum DriveState - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for DriveState - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to DriveState - /// the value to convert to an instance of . - - public static implicit operator DriveState(string value) - { - return new DriveState(value); - } - - /// Implicit operator to convert DriveState to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState e) - { - return e._value; - } - - /// Overriding != operator for enum DriveState - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState e1, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum DriveState - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState e1, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.DriveState e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/EncryptionKekType.Completer.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Support/EncryptionKekType.Completer.cs deleted file mode 100644 index 1c4015a9e1ae..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/EncryptionKekType.Completer.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support -{ - - /// The type of kek encryption key - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekTypeTypeConverter))] - public partial struct EncryptionKekType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "MicrosoftManaged".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'MicrosoftManaged'", "MicrosoftManaged", global::System.Management.Automation.CompletionResultType.ParameterValue, "MicrosoftManaged"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "CustomerManaged".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'CustomerManaged'", "CustomerManaged", global::System.Management.Automation.CompletionResultType.ParameterValue, "CustomerManaged"); - } - } - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/EncryptionKekType.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Support/EncryptionKekType.TypeConverter.cs deleted file mode 100644 index 7e80af5b7990..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/EncryptionKekType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support -{ - - /// The type of kek encryption key - public partial class EncryptionKekTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => EncryptionKekType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/EncryptionKekType.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Support/EncryptionKekType.cs deleted file mode 100644 index 7cb06b7a4a9b..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/EncryptionKekType.cs +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support -{ - - /// The type of kek encryption key - public partial struct EncryptionKekType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType CustomerManaged = @"CustomerManaged"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType MicrosoftManaged = @"MicrosoftManaged"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to EncryptionKekType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new EncryptionKekType(global::System.Convert.ToString(value)); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private EncryptionKekType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Compares values of enum type EncryptionKekType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type EncryptionKekType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is EncryptionKekType && Equals((EncryptionKekType)obj); - } - - /// Returns hashCode for enum EncryptionKekType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Returns string representation for EncryptionKekType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to EncryptionKekType - /// the value to convert to an instance of . - - public static implicit operator EncryptionKekType(string value) - { - return new EncryptionKekType(value); - } - - /// Implicit operator to convert EncryptionKekType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType e) - { - return e._value; - } - - /// Overriding != operator for enum EncryptionKekType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType e1, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum EncryptionKekType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType e1, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/IdentityType.Completer.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Support/IdentityType.Completer.cs deleted file mode 100644 index 8bd747d638bd..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/IdentityType.Completer.cs +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support -{ - - /// The type of identity - [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityTypeTypeConverter))] - public partial struct IdentityType : - System.Management.Automation.IArgumentCompleter - { - - /// - /// Implementations of this function are called by PowerShell to complete arguments. - /// - /// The name of the command that needs argument completion. - /// The name of the parameter that needs argument completion. - /// The (possibly empty) word being completed. - /// The command ast in case it is needed for completion. - /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot - /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. - /// - /// A collection of completion results, most like with ResultType set to ParameterValue. - /// - public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) - { - if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'SystemAssigned'", "SystemAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemAssigned"); - } - if (global::System.String.IsNullOrEmpty(wordToComplete) || "UserAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) - { - yield return new global::System.Management.Automation.CompletionResult("'UserAssigned'", "UserAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "UserAssigned"); - } - } - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/IdentityType.TypeConverter.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Support/IdentityType.TypeConverter.cs deleted file mode 100644 index 53510de02fc4..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/IdentityType.TypeConverter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support -{ - - /// The type of identity - public partial class IdentityTypeTypeConverter : - global::System.Management.Automation.PSTypeConverter - { - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; - - /// - /// Determines if the converter can convert the parameter to the parameter. - /// - /// the to convert from - /// the to convert to - /// - /// true if the converter can convert the parameter to the parameter, otherwise false. - /// - public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; - - /// - /// Converts the parameter to the parameter using and - /// - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// - /// an instance of , or null if there is no suitable conversion. - /// - public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => IdentityType.CreateFrom(sourceValue); - - /// NotImplemented -- this will return null - /// the to convert from - /// the to convert to - /// not used by this TypeConverter. - /// when set to true, will ignore the case when converting. - /// will always return null. - public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/IdentityType.cs b/generated/ImportExport/ImportExport.Autorest/generated/api/Support/IdentityType.cs deleted file mode 100644 index be5ceb49dac8..000000000000 --- a/generated/ImportExport/ImportExport.Autorest/generated/api/Support/IdentityType.cs +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support -{ - - /// The type of identity - public partial struct IdentityType : - System.IEquatable - { - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType None = @"None"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType SystemAssigned = @"SystemAssigned"; - - public static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType UserAssigned = @"UserAssigned"; - - /// the value for an instance of the Enum. - private string _value { get; set; } - - /// Conversion from arbitrary object to IdentityType - /// the value to convert to an instance of . - internal static object CreateFrom(object value) - { - return new IdentityType(global::System.Convert.ToString(value)); - } - - /// Compares values of enum type IdentityType - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType e) - { - return _value.Equals(e._value); - } - - /// Compares values of enum type IdentityType (override for Object) - /// the value to compare against this instance. - /// true if the two instances are equal to the same value - public override bool Equals(object obj) - { - return obj is IdentityType && Equals((IdentityType)obj); - } - - /// Returns hashCode for enum IdentityType - /// The hashCode of the value - public override int GetHashCode() - { - return this._value.GetHashCode(); - } - - /// Creates an instance of the Enum class. - /// the value to create an instance for. - private IdentityType(string underlyingValue) - { - this._value = underlyingValue; - } - - /// Returns string representation for IdentityType - /// A string for this value. - public override string ToString() - { - return this._value; - } - - /// Implicit operator to convert string to IdentityType - /// the value to convert to an instance of . - - public static implicit operator IdentityType(string value) - { - return new IdentityType(value); - } - - /// Implicit operator to convert IdentityType to string - /// the value to convert to an instance of . - - public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType e) - { - return e._value; - } - - /// Overriding != operator for enum IdentityType - /// the value to compare against - /// the value to compare against - /// true if the two instances are not equal to the same value - public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType e2) - { - return !e2.Equals(e1); - } - - /// Overriding == operator for enum IdentityType - /// the value to compare against - /// the value to compare against - /// true if the two instances are equal to the same value - public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.IdentityType e2) - { - return e2.Equals(e1); - } - } -} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportBitLockerKey_List.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportBitLockerKey_List.cs index 18681c338f32..b403ac56fb83 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportBitLockerKey_List.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportBitLockerKey_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; /// Returns the BitLocker Keys for all drives in the specified job. @@ -14,12 +16,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzImportExportBitLockerKey_List", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey))] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"Returns the BitLocker Keys for all drives in the specified job.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}/listBitLockerKeys", ApiVersion = "2021-01-01")] public partial class GetAzImportExportBitLockerKey_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -35,6 +38,18 @@ public partial class GetAzImportExportBitLockerKey_List : global::System.Managem /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -54,6 +69,9 @@ public partial class GetAzImportExportBitLockerKey_List : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -67,6 +85,9 @@ public partial class GetAzImportExportBitLockerKey_List : global::System.Managem [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -107,7 +128,7 @@ public partial class GetAzImportExportBitLockerKey_List : global::System.Managem /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -155,7 +176,8 @@ public partial class GetAzImportExportBitLockerKey_List : global::System.Managem [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -164,24 +186,24 @@ public partial class GetAzImportExportBitLockerKey_List : global::System.Managem /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -204,6 +226,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -225,7 +252,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzImportExportBitLockerKey_List() { @@ -276,8 +303,33 @@ public GetAzImportExportBitLockerKey_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -333,7 +385,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -348,13 +400,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.BitLockerKeysList(JobName, SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, onOk, onDefault, this, Pipeline); + await this.Client.BitLockerKeysList(SubscriptionId, ResourceGroupName, JobName, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { JobName=JobName,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,JobName=JobName,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -392,12 +444,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -414,15 +466,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { JobName=JobName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { JobName=JobName, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -432,12 +484,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IGetBitLockerKeysResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -449,9 +501,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IGetBitLockerKeysResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / - WriteObject((await response).Value, true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportLocation_Get.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportLocation_Get.cs index c21f2a5e4b42..27860dacd97c 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportLocation_Get.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportLocation_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets /// [OpenAPI] Get=>GET:"/providers/Microsoft.ImportExport/locations/{locationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzImportExportLocation_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation))] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"Returns the details about a location to which you can ship the disks associated with an import or export job. A location is an Azure region.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/providers/Microsoft.ImportExport/locations/{locationName}", ApiVersion = "2021-01-01")] public partial class GetAzImportExportLocation_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,6 +40,18 @@ public partial class GetAzImportExportLocation_Get : global::System.Management.A /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -56,6 +71,9 @@ public partial class GetAzImportExportLocation_Get : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -69,6 +87,9 @@ public partial class GetAzImportExportLocation_Get : global::System.Management.A [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -110,7 +131,7 @@ public partial class GetAzImportExportLocation_Get : global::System.Management.A /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -133,24 +154,24 @@ public partial class GetAzImportExportLocation_Get : global::System.Management.A /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -173,6 +194,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -194,7 +220,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzImportExportLocation_Get() { @@ -245,8 +271,33 @@ public GetAzImportExportLocation_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -299,7 +350,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -317,7 +368,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -355,12 +406,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -377,15 +428,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -395,12 +446,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -412,8 +463,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportLocation_GetViaIdentity.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportLocation_GetViaIdentity.cs index f7cd37468f34..1fd5a5350f6e 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportLocation_GetViaIdentity.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportLocation_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets /// [OpenAPI] Get=>GET:"/providers/Microsoft.ImportExport/locations/{locationName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzImportExportLocation_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation))] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"Returns the details about a location to which you can ship the disks associated with an import or export job. A location is an Azure region.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/providers/Microsoft.ImportExport/locations/{locationName}", ApiVersion = "2021-01-01")] public partial class GetAzImportExportLocation_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,6 +40,18 @@ public partial class GetAzImportExportLocation_GetViaIdentity : global::System.M /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -56,6 +71,9 @@ public partial class GetAzImportExportLocation_GetViaIdentity : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -69,6 +87,9 @@ public partial class GetAzImportExportLocation_GetViaIdentity : global::System.M [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -103,7 +124,7 @@ public partial class GetAzImportExportLocation_GetViaIdentity : global::System.M /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -126,24 +147,24 @@ public partial class GetAzImportExportLocation_GetViaIdentity : global::System.M /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -166,6 +187,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -187,7 +213,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzImportExportLocation_GetViaIdentity() { @@ -238,8 +264,33 @@ public GetAzImportExportLocation_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -292,7 +343,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -322,7 +373,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -360,12 +411,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -382,15 +433,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -400,12 +451,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -417,8 +468,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportLocation_List.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportLocation_List.cs index ae138afe9d22..0d79bd357cf5 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportLocation_List.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExportLocation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets /// [OpenAPI] List=>GET:"/providers/Microsoft.ImportExport/locations" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzImportExportLocation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocation))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocation))] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"Returns a list of locations to which you can ship the disks associated with an import or export job. A location is a Microsoft data center region.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/providers/Microsoft.ImportExport/locations", ApiVersion = "2021-01-01")] public partial class GetAzImportExportLocation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,6 +40,18 @@ public partial class GetAzImportExportLocation_List : global::System.Management. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -56,6 +71,9 @@ public partial class GetAzImportExportLocation_List : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -69,6 +87,9 @@ public partial class GetAzImportExportLocation_List : global::System.Management. [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -95,7 +116,7 @@ public partial class GetAzImportExportLocation_List : global::System.Management. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -118,24 +139,24 @@ public partial class GetAzImportExportLocation_List : global::System.Management. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -158,6 +179,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -179,7 +205,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzImportExportLocation_List() { @@ -230,8 +256,33 @@ public GetAzImportExportLocation_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -284,7 +335,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -302,7 +353,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -340,12 +391,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -362,15 +413,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -380,12 +431,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.ILocationsResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -397,9 +448,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.ILocationsResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / - WriteObject((await response).Value, true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_Get.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_Get.cs index e006da77ba98..80dfc248621f 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_Get.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_Get.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; /// Gets information about an existing job. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzImportExport_Get")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"Gets information about an existing job.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}", ApiVersion = "2021-01-01")] public partial class GetAzImportExport_Get : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,18 @@ public partial class GetAzImportExport_Get : global::System.Management.Automatio /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -53,6 +68,9 @@ public partial class GetAzImportExport_Get : global::System.Management.Automatio [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -66,6 +84,9 @@ public partial class GetAzImportExport_Get : global::System.Management.Automatio [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -107,7 +128,7 @@ public partial class GetAzImportExport_Get : global::System.Management.Automatio /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -155,7 +176,8 @@ public partial class GetAzImportExport_Get : global::System.Management.Automatio [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -164,24 +186,24 @@ public partial class GetAzImportExport_Get : global::System.Management.Automatio /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -204,6 +226,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -225,7 +252,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzImportExport_Get() { @@ -276,8 +303,33 @@ public GetAzImportExport_Get() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -330,7 +382,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -345,13 +397,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.JobsGet(Name, SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, onOk, onDefault, this, Pipeline); + await this.Client.JobsGet(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -389,12 +441,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -411,15 +463,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -429,12 +481,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -446,8 +498,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_GetViaIdentity.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_GetViaIdentity.cs index 4e3571c8d2d8..76286626e72c 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_GetViaIdentity.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_GetViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; /// Gets information about an existing job. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzImportExport_GetViaIdentity")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"Gets information about an existing job.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}", ApiVersion = "2021-01-01")] public partial class GetAzImportExport_GetViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,6 +37,18 @@ public partial class GetAzImportExport_GetViaIdentity : global::System.Managemen /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -53,6 +68,9 @@ public partial class GetAzImportExport_GetViaIdentity : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -66,6 +84,9 @@ public partial class GetAzImportExport_GetViaIdentity : global::System.Managemen [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -100,7 +121,7 @@ public partial class GetAzImportExport_GetViaIdentity : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -123,24 +144,24 @@ public partial class GetAzImportExport_GetViaIdentity : global::System.Managemen /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -163,6 +184,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -184,7 +210,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzImportExport_GetViaIdentity() { @@ -235,8 +261,33 @@ public GetAzImportExport_GetViaIdentity() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -289,7 +340,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -309,10 +360,6 @@ protected override void ProcessRecord() else { // try to call with PATH parameters from Input Object - if (null == InputObject.JobName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.JobName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } if (null == InputObject.SubscriptionId) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); @@ -321,13 +368,17 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.JobsGet(InputObject.JobName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, onOk, onDefault, this, Pipeline); + if (null == InputObject.JobName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.JobName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.JobsGet(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.JobName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -365,12 +416,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -387,15 +438,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -405,12 +456,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -422,8 +473,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_List.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_List.cs index 6f53c472e759..fce59a1d67b0 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_List.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; /// Returns all active and completed jobs in a subscription. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets /// [OpenAPI] ListBySubscription=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.ImportExport/jobs" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzImportExport_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"Returns all active and completed jobs in a subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/providers/Microsoft.ImportExport/jobs", ApiVersion = "2021-01-01")] public partial class GetAzImportExport_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,12 +37,24 @@ public partial class GetAzImportExport_List : global::System.Management.Automati /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -59,6 +74,9 @@ public partial class GetAzImportExport_List : global::System.Management.Automati [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -72,6 +90,9 @@ public partial class GetAzImportExport_List : global::System.Management.Automati [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -112,7 +133,7 @@ public partial class GetAzImportExport_List : global::System.Management.Automati /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -144,7 +165,8 @@ public partial class GetAzImportExport_List : global::System.Management.Automati [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -169,24 +191,24 @@ public partial class GetAzImportExport_List : global::System.Management.Automati /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -209,6 +231,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -230,7 +257,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzImportExport_List() { @@ -281,8 +308,33 @@ public GetAzImportExport_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -335,7 +387,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -350,13 +402,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.JobsListBySubscription(this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(long?), this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, onOk, onDefault, this, Pipeline); + await this.Client.JobsListBySubscription(SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(long?), this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(long?),Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,SubscriptionId=SubscriptionId,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(long?),Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -394,12 +446,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -416,15 +468,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(long?), Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SubscriptionId=SubscriptionId, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(long?), Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SubscriptionId=SubscriptionId, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -434,12 +486,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -451,15 +503,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_List1.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_List1.cs index c904463829d4..6f771a9ad844 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_List1.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzImportExport_List1.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; /// Returns all active and completed jobs in a resource group. @@ -13,12 +15,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzImportExport_List1")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse))] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"Returns all active and completed jobs in a resource group.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs", ApiVersion = "2021-01-01")] public partial class GetAzImportExport_List1 : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,12 +37,24 @@ public partial class GetAzImportExport_List1 : global::System.Management.Automat /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + /// A flag to tell whether it is the first onOK call. private bool _isFirst = true; /// Link to retrieve next page. private string _nextLink; + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -59,6 +74,9 @@ public partial class GetAzImportExport_List1 : global::System.Management.Automat [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -72,6 +90,9 @@ public partial class GetAzImportExport_List1 : global::System.Management.Automat [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// Backing field for property. private string _filter; @@ -112,7 +133,7 @@ public partial class GetAzImportExport_List1 : global::System.Management.Automat /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -160,7 +181,8 @@ public partial class GetAzImportExport_List1 : global::System.Management.Automat [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -185,24 +207,24 @@ public partial class GetAzImportExport_List1 : global::System.Management.Automat /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -225,6 +247,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -246,7 +273,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzImportExport_List1() { @@ -297,8 +324,33 @@ public GetAzImportExport_List1() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -351,7 +403,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -366,13 +418,13 @@ protected override void ProcessRecord() foreach( var SubscriptionId in this.SubscriptionId ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.JobsListByResourceGroup(this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(long?), this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, onOk, onDefault, this, Pipeline); + await this.Client.JobsListByResourceGroup(SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(long?), onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(long?),Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(long?),AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -410,12 +462,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -432,15 +484,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(long?), Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Top=this.InvocationInformation.BoundParameters.ContainsKey("Top") ? Top : default(long?), Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -450,12 +502,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListJobsResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -467,15 +519,38 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListJobsResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / nextLink - var result = await response; - WriteObject(result.Value,true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } _nextLink = result.NextLink; if (_isFirst) { _isFirst = false; - while (_nextLink != null) + while (!String.IsNullOrEmpty(_nextLink)) { if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) { diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzOperation_List.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzOperation_List.cs index 988535913f1a..314568eee660 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzOperation_List.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/GetAzOperation_List.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; /// @@ -16,12 +18,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets /// [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.InternalExport] [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzOperation_List")] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation))] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation))] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"Returns the list of operations supported by the import/export resource provider.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/providers/Microsoft.ImportExport/operations", ApiVersion = "2021-01-01")] public partial class GetAzOperation_List : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -37,6 +40,18 @@ public partial class GetAzOperation_List : global::System.Management.Automation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -56,6 +71,9 @@ public partial class GetAzOperation_List : global::System.Management.Automation. [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -69,6 +87,9 @@ public partial class GetAzOperation_List : global::System.Management.Automation. [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -95,7 +116,7 @@ public partial class GetAzOperation_List : global::System.Management.Automation. /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -118,24 +139,24 @@ public partial class GetAzOperation_List : global::System.Management.Automation. /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -158,6 +179,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -179,7 +205,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public GetAzOperation_List() { @@ -230,8 +256,33 @@ public GetAzOperation_List() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -284,7 +335,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -302,7 +353,7 @@ protected override void ProcessRecord() } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -340,12 +391,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -362,15 +413,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -380,12 +431,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IListOperationsResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -397,9 +448,33 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IListOperationsResponse + var result = (await response); // response should be returning an array of some kind. +Pageable // pageable / value / - WriteObject((await response).Value, true); + if (null != result.Value) + { + if (0 == _responseSize && 1 == result.Value.Count) + { + _firstResponse = result.Value[0]; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + var values = new System.Collections.Generic.List(); + foreach( var value in result.Value ) + { + values.Add(value.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(values, true); + _responseSize = 2; + } + } } } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/NewAzImportExport_CreateExpanded.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/NewAzImportExport_CreateExpanded.cs index 1c19d29c5747..5c31be6d887b 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/NewAzImportExport_CreateExpanded.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/NewAzImportExport_CreateExpanded.cs @@ -6,19 +6,22 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; - /// Creates a new job or updates an existing job in the specified subscription. + /// create a new job or create an existing job in the specified subscription. /// /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzImportExport_CreateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"Creates a new job or updates an existing job in the specified subscription.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"create a new job or create an existing job in the specified subscription.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}", ApiVersion = "2021-01-01")] public partial class NewAzImportExport_CreateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -30,13 +33,25 @@ public partial class NewAzImportExport_CreateExpanded : global::System.Managemen private string __processRecordId; /// Put Job parameters - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParameters _body = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.PutJobParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParameters _body = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.PutJobParameters(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -74,7 +89,7 @@ public partial class NewAzImportExport_CreateExpanded : global::System.Managemen Description = @"A collection of blob-path strings.", SerializedName = @"blobPath", PossibleTypes = new [] { typeof(string) })] - public string[] BlobListBlobPath { get => _body.BlobPath ?? null /* arrayOf */; set => _body.BlobPath = value; } + public string[] BlobListBlobPath { get => _body.BlobPath?.ToArray() ?? null /* fixedArrayOf */; set => _body.BlobPath = (value != null ? new System.Collections.Generic.List(value) : null); } /// A collection of blob-prefix strings. [global::System.Management.Automation.AllowEmptyCollection] @@ -86,7 +101,7 @@ public partial class NewAzImportExport_CreateExpanded : global::System.Managemen Description = @"A collection of blob-prefix strings.", SerializedName = @"blobPathPrefix", PossibleTypes = new [] { typeof(string) })] - public string[] BlobListBlobPathPrefix { get => _body.BlobListBlobPathPrefix ?? null /* arrayOf */; set => _body.BlobListBlobPathPrefix = value; } + public string[] BlobListBlobPathPrefix { get => _body.BlobListBlobPathPrefix?.ToArray() ?? null /* fixedArrayOf */; set => _body.BlobListBlobPathPrefix = (value != null ? new System.Collections.Generic.List(value) : null); } /// Wait for .NET debugger to attach [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] @@ -104,6 +119,9 @@ public partial class NewAzImportExport_CreateExpanded : global::System.Managemen PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter CancelRequested { get => _body.CancelRequested ?? default(global::System.Management.Automation.SwitchParameter); set => _body.CancelRequested = value; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -200,8 +218,8 @@ public partial class NewAzImportExport_CreateExpanded : global::System.Managemen ReadOnly = false, Description = @"List of up to ten drives that comprise the job. The drive list is a required element for an import job; it is not specified for export jobs.", SerializedName = @"driveList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus) })] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get => _body.DriveList ?? null /* arrayOf */; set => _body.DriveList = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus) })] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus[] DriveList { get => _body.DriveList?.ToArray() ?? null /* fixedArrayOf */; set => _body.DriveList = (value != null ? new System.Collections.Generic.List(value) : null); } /// The type of kek encryption key [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of kek encryption key")] @@ -211,9 +229,9 @@ public partial class NewAzImportExport_CreateExpanded : global::System.Managemen ReadOnly = false, Description = @"The type of kek encryption key", SerializedName = @"kekType", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType) })] - [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType))] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType EncryptionKeyKekType { get => _body.EncryptionKeyKekType ?? ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support.EncryptionKekType)""); set => _body.EncryptionKeyKekType = value; } + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.PSArgumentCompleterAttribute("MicrosoftManaged", "CustomerManaged")] + public string EncryptionKeyKekType { get => _body.EncryptionKeyKekType ?? null; set => _body.EncryptionKeyKekType = value; } /// Specifies the url for kek encryption key. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the url for kek encryption key. ")] @@ -251,6 +269,9 @@ public partial class NewAzImportExport_CreateExpanded : global::System.Managemen PossibleTypes = new [] { typeof(string) })] public string ExportBlobListBlobPath { get => _body.ExportBlobListBlobPath ?? null; set => _body.ExportBlobListBlobPath = value; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -352,7 +373,7 @@ public partial class NewAzImportExport_CreateExpanded : global::System.Managemen /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// Specifies the provisioning state of the job. [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the provisioning state of the job.")] @@ -692,7 +713,8 @@ public partial class NewAzImportExport_CreateExpanded : global::System.Managemen [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -705,44 +727,44 @@ public partial class NewAzImportExport_CreateExpanded : global::System.Managemen ReadOnly = false, Description = @"Specifies the tags that will be assigned to the job.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IPutJobParametersTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IPutJobParametersTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse /// from the remote call /// /// Determines if the rest of the onCreated method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -765,6 +787,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -829,8 +856,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -840,7 +892,7 @@ protected override void EndProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public NewAzImportExport_CreateExpanded() { @@ -894,7 +946,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -907,12 +959,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.JobsCreate(Name, SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, this.InvocationInformation.BoundParameters.ContainsKey("ClientTenantId") ? ClientTenantId : null, _body, onOk, onCreated, onDefault, this, Pipeline); + await this.Client.JobsCreate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, this.InvocationInformation.BoundParameters.ContainsKey("ClientTenantId") ? ClientTenantId : null, _body, onOk, onCreated, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeCreate); await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null,ClientTenantId=this.InvocationInformation.BoundParameters.ContainsKey("ClientTenantId") ? ClientTenantId : null,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null,ClientTenantId=this.InvocationInformation.BoundParameters.ContainsKey("ClientTenantId") ? ClientTenantId : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -948,12 +1000,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 201 (Created). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -965,8 +1017,26 @@ protected override void StopProcessing() return ; } // onCreated - response for 201 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } @@ -974,12 +1044,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -996,15 +1066,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, ClientTenantId=this.InvocationInformation.BoundParameters.ContainsKey("ClientTenantId") ? ClientTenantId : null, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, ClientTenantId=this.InvocationInformation.BoundParameters.ContainsKey("ClientTenantId") ? ClientTenantId : null, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -1014,12 +1084,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -1031,8 +1101,26 @@ protected override void StopProcessing() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/NewAzImportExport_CreateViaJsonFilePath.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/NewAzImportExport_CreateViaJsonFilePath.cs new file mode 100644 index 000000000000..58827c3ccfbb --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/NewAzImportExport_CreateViaJsonFilePath.cs @@ -0,0 +1,608 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; + using System; + + /// create a new job or create an existing job in the specified subscription. + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzImportExport_CreateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"create a new job or create an existing job in the specified subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}", ApiVersion = "2021-01-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.NotSuggestDefaultParameterSet] + public partial class NewAzImportExport_CreateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _acceptLanguage; + + /// Specifies the preferred language for the response. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the preferred language for the response.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the preferred language for the response.", + SerializedName = @"Accept-Language", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Header)] + public string AcceptLanguage { get => this._acceptLanguage; set => this._acceptLanguage = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clientTenantId; + + /// The tenant ID of the client making the request. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of the client making the request.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of the client making the request.", + SerializedName = @"x-ms-client-tenant-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Header)] + public string ClientTenantId { get => this._clientTenantId; set => this._clientTenantId = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Create operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the import/export job. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the import/export job.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the import/export job.", + SerializedName = @"jobName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("JobName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The resource group name uniquely identifies the resource group within the user subscription. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name uniquely identifies the resource group within the user subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name uniquely identifies the resource group within the user subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription ID for the Azure user. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription ID for the Azure user.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID for the Azure user.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzImportExport_CreateViaJsonFilePath() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'JobsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.JobsCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, this.InvocationInformation.BoundParameters.ContainsKey("ClientTenantId") ? ClientTenantId : null, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null,ClientTenantId=this.InvocationInformation.BoundParameters.ContainsKey("ClientTenantId") ? ClientTenantId : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/NewAzImportExport_CreateViaJsonString.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/NewAzImportExport_CreateViaJsonString.cs new file mode 100644 index 000000000000..16b66868b423 --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/NewAzImportExport_CreateViaJsonString.cs @@ -0,0 +1,606 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; + using System; + + /// create a new job or create an existing job in the specified subscription. + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzImportExport_CreateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"create a new job or create an existing job in the specified subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}", ApiVersion = "2021-01-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.NotSuggestDefaultParameterSet] + public partial class NewAzImportExport_CreateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _acceptLanguage; + + /// Specifies the preferred language for the response. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the preferred language for the response.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the preferred language for the response.", + SerializedName = @"Accept-Language", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Header)] + public string AcceptLanguage { get => this._acceptLanguage; set => this._acceptLanguage = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _clientTenantId; + + /// The tenant ID of the client making the request. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The tenant ID of the client making the request.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The tenant ID of the client making the request.", + SerializedName = @"x-ms-client-tenant-id", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Header)] + public string ClientTenantId { get => this._clientTenantId; set => this._clientTenantId = value; } + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Create operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Create operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Create operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the import/export job. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the import/export job.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the import/export job.", + SerializedName = @"jobName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("JobName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The resource group name uniquely identifies the resource group within the user subscription. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name uniquely identifies the resource group within the user subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name uniquely identifies the resource group within the user subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription ID for the Azure user. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription ID for the Azure user.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID for the Azure user.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public NewAzImportExport_CreateViaJsonString() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'JobsCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.JobsCreateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, this.InvocationInformation.BoundParameters.ContainsKey("ClientTenantId") ? ClientTenantId : null, _jsonString, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null,ClientTenantId=this.InvocationInformation.BoundParameters.ContainsKey("ClientTenantId") ? ClientTenantId : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/RemoveAzImportExport_Delete.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/RemoveAzImportExport_Delete.cs index 9860ad45bbf8..cbabb11aeb4d 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/RemoveAzImportExport_Delete.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/RemoveAzImportExport_Delete.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; /// @@ -20,7 +22,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}", ApiVersion = "2021-01-01")] public partial class RemoveAzImportExport_Delete : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,6 +39,18 @@ public partial class RemoveAzImportExport_Delete : global::System.Management.Aut /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -55,6 +70,9 @@ public partial class RemoveAzImportExport_Delete : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -68,6 +86,9 @@ public partial class RemoveAzImportExport_Delete : global::System.Management.Aut [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -116,7 +137,7 @@ public partial class RemoveAzImportExport_Delete : global::System.Management.Aut /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -164,7 +185,8 @@ public partial class RemoveAzImportExport_Delete : global::System.Management.Aut [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -173,12 +195,12 @@ public partial class RemoveAzImportExport_Delete : global::System.Management.Aut /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -211,6 +233,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -275,8 +302,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -332,7 +384,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -345,12 +397,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.JobsDelete(Name, SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, onOk, onDefault, this, Pipeline); + await this.Client.JobsDelete(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, onOk, onDefault, this, Pipeline); await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -363,7 +415,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzImportExport_Delete() { @@ -396,12 +448,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -418,15 +470,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/RemoveAzImportExport_DeleteViaIdentity.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/RemoveAzImportExport_DeleteViaIdentity.cs index 0d61e08166dc..d91ffe805dfa 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/RemoveAzImportExport_DeleteViaIdentity.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/RemoveAzImportExport_DeleteViaIdentity.cs @@ -6,6 +6,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; /// @@ -20,7 +22,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}", ApiVersion = "2021-01-01")] public partial class RemoveAzImportExport_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -36,6 +39,18 @@ public partial class RemoveAzImportExport_DeleteViaIdentity : global::System.Man /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -55,6 +70,9 @@ public partial class RemoveAzImportExport_DeleteViaIdentity : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] public global::System.Management.Automation.SwitchParameter Break { get; set; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -68,6 +86,9 @@ public partial class RemoveAzImportExport_DeleteViaIdentity : global::System.Man [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] [global::System.Management.Automation.ValidateNotNull] @@ -109,7 +130,7 @@ public partial class RemoveAzImportExport_DeleteViaIdentity : global::System.Man /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -132,12 +153,12 @@ public partial class RemoveAzImportExport_DeleteViaIdentity : global::System.Man /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens @@ -170,6 +191,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -234,8 +260,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -291,7 +342,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -311,10 +362,6 @@ protected override void ProcessRecord() else { // try to call with PATH parameters from Input Object - if (null == InputObject.JobName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.JobName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } if (null == InputObject.SubscriptionId) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); @@ -323,13 +370,17 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.JobsDelete(InputObject.JobName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, onOk, onDefault, this, Pipeline); + if (null == InputObject.JobName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.JobName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.JobsDelete(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.JobName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, onOk, onDefault, this, Pipeline); } await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -342,7 +393,7 @@ protected override void ProcessRecord() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public RemoveAzImportExport_DeleteViaIdentity() { @@ -375,12 +426,12 @@ protected override void StopProcessing() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -397,15 +448,15 @@ protected override void StopProcessing() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateExpanded.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateExpanded.cs index be13ff97db16..d2f8a530a6f1 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateExpanded.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateExpanded.cs @@ -6,10 +6,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; /// - /// Updates specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives + /// update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives /// comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing /// job. /// @@ -17,12 +19,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzImportExport_UpdateExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"Updates specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}", ApiVersion = "2021-01-01")] public partial class UpdateAzImportExport_UpdateExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,13 +37,25 @@ public partial class UpdateAzImportExport_UpdateExpanded : global::System.Manage private string __processRecordId; /// Update Job parameters - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters _body = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters _body = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParameters(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -86,6 +101,9 @@ public partial class UpdateAzImportExport_UpdateExpanded : global::System.Manage PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter CancelRequested { get => _body.CancelRequested ?? default(global::System.Management.Automation.SwitchParameter); set => _body.CancelRequested = value; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -152,8 +170,11 @@ public partial class UpdateAzImportExport_UpdateExpanded : global::System.Manage ReadOnly = false, Description = @"List of drives that comprise the job.", SerializedName = @"driveList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus) })] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get => _body.DriveList ?? null /* arrayOf */; set => _body.DriveList = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus) })] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus[] DriveList { get => _body.DriveList?.ToArray() ?? null /* fixedArrayOf */; set => _body.DriveList = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -207,7 +228,7 @@ public partial class UpdateAzImportExport_UpdateExpanded : global::System.Manage /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -393,7 +414,8 @@ public partial class UpdateAzImportExport_UpdateExpanded : global::System.Manage [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.DefaultInfo( Name = @"", Description =@"", - Script = @"(Get-AzContext).Subscription.Id")] + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } @@ -406,32 +428,32 @@ public partial class UpdateAzImportExport_UpdateExpanded : global::System.Manage ReadOnly = false, Description = @"Specifies the tags that will be assigned to the job.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -454,6 +476,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -518,8 +545,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -575,7 +627,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -588,12 +640,12 @@ protected override void ProcessRecord() try { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - await this.Client.JobsUpdate(Name, SubscriptionId, ResourceGroupName, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, _body, onOk, onDefault, this, Pipeline); + await this.Client.JobsUpdate(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeUpdate); await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -613,7 +665,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzImportExport_UpdateExpanded() { @@ -639,12 +691,12 @@ public UpdateAzImportExport_UpdateExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -661,15 +713,15 @@ public UpdateAzImportExport_UpdateExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, SubscriptionId=SubscriptionId, ResourceGroupName=ResourceGroupName, AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -679,12 +731,12 @@ public UpdateAzImportExport_UpdateExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -696,8 +748,26 @@ public UpdateAzImportExport_UpdateExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateViaIdentityExpanded.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateViaIdentityExpanded.cs index f7257a5a8035..905b4843b4de 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateViaIdentityExpanded.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateViaIdentityExpanded.cs @@ -6,10 +6,12 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets { using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; using System; /// - /// Updates specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives + /// update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives /// comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing /// job. /// @@ -17,12 +19,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}" /// [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzImportExport_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] - [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse))] - [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"Updates specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job.")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job.")] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}", ApiVersion = "2021-01-01")] public partial class UpdateAzImportExport_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, - Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext { /// A unique id generatd for the this cmdlet when it is instantiated. private string __correlationId = System.Guid.NewGuid().ToString(); @@ -34,13 +37,25 @@ public partial class UpdateAzImportExport_UpdateViaIdentityExpanded : global::Sy private string __processRecordId; /// Update Job parameters - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParameters _body = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.UpdateJobParameters(); + private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParameters _body = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.UpdateJobParameters(); /// /// The for this operation. /// private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + /// Backing field for property. private string _acceptLanguage; @@ -86,6 +101,9 @@ public partial class UpdateAzImportExport_UpdateViaIdentityExpanded : global::Sy PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] public global::System.Management.Automation.SwitchParameter CancelRequested { get => _body.CancelRequested ?? default(global::System.Management.Automation.SwitchParameter); set => _body.CancelRequested = value; } + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + /// The reference to the client API class. public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; @@ -152,8 +170,11 @@ public partial class UpdateAzImportExport_UpdateViaIdentityExpanded : global::Sy ReadOnly = false, Description = @"List of drives that comprise the job.", SerializedName = @"driveList", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus) })] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveStatus[] DriveList { get => _body.DriveList ?? null /* arrayOf */; set => _body.DriveList = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus) })] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveStatus[] DriveList { get => _body.DriveList?.ToArray() ?? null /* fixedArrayOf */; set => _body.DriveList = (value != null ? new System.Collections.Generic.List(value) : null); } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } /// SendAsync Pipeline Steps to be appended to the front of the pipeline [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] @@ -200,7 +221,7 @@ public partial class UpdateAzImportExport_UpdateViaIdentityExpanded : global::Sy /// /// The instance of the that the remote call will use. /// - private Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } /// The URI for the proxy server to use [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] @@ -365,32 +386,32 @@ public partial class UpdateAzImportExport_UpdateViaIdentityExpanded : global::Sy ReadOnly = false, Description = @"Specifies the tags that will be assigned to the job.", SerializedName = @"tags", - PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags) })] - public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IUpdateJobParametersTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IUpdateJobParametersTags Tag { get => _body.Tag ?? null /* object */; set => _body.Tag = value; } /// /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what /// happens on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// Determines if the rest of the onDefault method should be processed, or if the method should /// return immediately (set to true to skip further processing ) - partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens /// on that response. Implement this method in a partial class to enable this behavior /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse /// from the remote call /// /// Determines if the rest of the onOk method should be processed, or if the method should return /// immediately (set to true to skip further processing ) - partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); /// /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) @@ -413,6 +434,11 @@ protected override void BeginProcessing() /// Performs clean-up after the command execution protected override void EndProcessing() { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); if (telemetryInfo != null) { @@ -477,8 +503,33 @@ protected override void EndProcessing() WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); return ; } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } } - await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); if (token.IsCancellationRequested) { return ; @@ -534,7 +585,7 @@ protected override void ProcessRecord() using( NoSynchronizationContext ) { await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } - Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); if (null != HttpPipelinePrepend) { Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); @@ -549,15 +600,11 @@ protected override void ProcessRecord() await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } if (InputObject?.Id != null) { - await this.Client.JobsUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, _body, onOk, onDefault, this, Pipeline); + await this.Client.JobsUpdateViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeUpdate); } else { // try to call with PATH parameters from Input Object - if (null == InputObject.JobName) - { - ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.JobName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); - } if (null == InputObject.SubscriptionId) { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); @@ -566,13 +613,17 @@ protected override void ProcessRecord() { ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); } - await this.Client.JobsUpdate(InputObject.JobName ?? null, InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, _body, onOk, onDefault, this, Pipeline); + if (null == InputObject.JobName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.JobName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.JobsUpdate(InputObject.SubscriptionId ?? null, InputObject.ResourceGroupName ?? null, InputObject.JobName ?? null, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, _body, onOk, onDefault, this, Pipeline, Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SerializationMode.IncludeUpdate); } await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } } catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) { - WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null,body=_body}) + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } }); @@ -592,7 +643,7 @@ protected override void StopProcessing() } /// - /// Intializes a new instance of the cmdlet class. + /// Initializes a new instance of the cmdlet class. /// public UpdateAzImportExport_UpdateViaIdentityExpanded() { @@ -618,12 +669,12 @@ public UpdateAzImportExport_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). /// /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IErrorResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -640,15 +691,15 @@ public UpdateAzImportExport_UpdateViaIdentityExpanded() if ((null == code || null == message)) { // Unrecognized Response. Create an error record based on what we have. - var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); - WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, body=_body }) + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } }); } else { - WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, body=_body }) + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) { ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } }); @@ -658,12 +709,12 @@ public UpdateAzImportExport_UpdateViaIdentityExpanded() /// a delegate that is called when the remote service returns 200 (OK). /// the raw response message as an global::System.Net.Http.HttpResponseMessage. - /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse /// from the remote call /// /// A that will be complete when handling of the method is completed. /// - private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) { using( NoSynchronizationContext ) { @@ -675,8 +726,26 @@ public UpdateAzImportExport_UpdateViaIdentityExpanded() return ; } // onOk - response for 200 / application/json - // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IJobResponse - WriteObject((await response)); + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } } } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateViaJsonFilePath.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateViaJsonFilePath.cs new file mode 100644 index 000000000000..bece716055bb --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateViaJsonFilePath.cs @@ -0,0 +1,544 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; + using System; + + /// + /// update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives + /// comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing + /// job. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzImportExport_UpdateViaJsonFilePath", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}", ApiVersion = "2021-01-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.NotSuggestDefaultParameterSet] + public partial class UpdateAzImportExport_UpdateViaJsonFilePath : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + public global::System.String _jsonString; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _acceptLanguage; + + /// Specifies the preferred language for the response. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the preferred language for the response.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the preferred language for the response.", + SerializedName = @"Accept-Language", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Header)] + public string AcceptLanguage { get => this._acceptLanguage; set => this._acceptLanguage = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonFilePath; + + /// Path of Json file supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Path of Json file supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Path of Json file supplied to the Update operation", + SerializedName = @"JsonFilePath", + PossibleTypes = new [] { typeof(string) })] + public string JsonFilePath { get => this._jsonFilePath; set { if (!System.IO.File.Exists(value)) { throw new Exception("Cannot find File " + value); } this._jsonString = System.IO.File.ReadAllText(value); this._jsonFilePath = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the import/export job. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the import/export job.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the import/export job.", + SerializedName = @"jobName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("JobName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The resource group name uniquely identifies the resource group within the user subscription. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name uniquely identifies the resource group within the user subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name uniquely identifies the resource group within the user subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription ID for the Azure user. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription ID for the Azure user.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID for the Azure user.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'JobsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.JobsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzImportExport_UpdateViaJsonFilePath() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateViaJsonString.cs b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateViaJsonString.cs new file mode 100644 index 000000000000..7a57f89ccadd --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/generated/cmdlets/UpdateAzImportExport_UpdateViaJsonString.cs @@ -0,0 +1,542 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell; + using Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets; + using System; + + /// + /// update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives + /// comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing + /// job. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzImportExport_UpdateViaJsonString", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Description(@"update specific properties of a job. You can call this operation to notify the Import/Export service that the hard drives comprising the import or export job have been shipped to the Microsoft data center. It can also be used to cancel an existing job.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Generated] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.HttpPath(Path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ImportExport/jobs/{jobName}", ApiVersion = "2021-01-01")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.NotSuggestDefaultParameterSet] + public partial class UpdateAzImportExport_UpdateViaJsonString : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener, + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A dictionary to carry over additional data for pipeline. + private global::System.Collections.Generic.Dictionary _extensibleParameters = new System.Collections.Generic.Dictionary(); + + /// A buffer to record first returned object in response. + private object _firstResponse = null; + + /// + /// A flag to tell whether it is the first returned object in a call. Zero means no response yet. One means 1 returned object. + /// Two means multiple returned objects in response. + /// + private int _responseSize = 0; + + /// Backing field for property. + private string _acceptLanguage; + + /// Specifies the preferred language for the response. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the preferred language for the response.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the preferred language for the response.", + SerializedName = @"Accept-Language", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Header)] + public string AcceptLanguage { get => this._acceptLanguage; set => this._acceptLanguage = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// Accessor for cancellationTokenSource. + public global::System.Threading.CancellationTokenSource CancellationTokenSource { get => _cancellationTokenSource ; set { _cancellationTokenSource = value; } } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.ClientAPI; + + /// + /// The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet + /// against a different subscription + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Accessor for extensibleParameters. + public global::System.Collections.Generic.IDictionary ExtensibleParameters { get => _extensibleParameters ; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _jsonString; + + /// Json string supplied to the Update operation + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Json string supplied to the Update operation")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Json string supplied to the Update operation", + SerializedName = @"JsonString", + PossibleTypes = new [] { typeof(string) })] + public string JsonString { get => this._jsonString; set => this._jsonString = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the import/export job. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the import/export job.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the import/export job.", + SerializedName = @"jobName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("JobName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + public Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The resource group name uniquely identifies the resource group within the user subscription. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The resource group name uniquely identifies the resource group within the user subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The resource group name uniquely identifies the resource group within the user subscription.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The subscription ID for the Azure user. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The subscription ID for the Azure user.")] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The subscription ID for the Azure user.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id", + SetCondition = @"")] + [global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Category(global::Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse); + } + var telemetryInfo = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.GetTelemetryInfo?.Invoke(__correlationId); + if (telemetryInfo != null) + { + telemetryInfo.TryGetValue("ShowSecretsWarning", out var showSecretsWarning); + telemetryInfo.TryGetValue("SanitizedProperties", out var sanitizedProperties); + telemetryInfo.TryGetValue("InvocationName", out var invocationName); + if (showSecretsWarning == "true") + { + if (string.IsNullOrEmpty(sanitizedProperties)) + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing secrets. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + else + { + WriteWarning($"The output of cmdlet {invocationName} may compromise security by showing the following secrets: {sanitizedProperties}. Learn more at https://go.microsoft.com/fwlink/?linkid=2258844"); + } + } + } + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.Progress: + { + var data = messageData(); + int progress = (int)data.Value; + string activityMessage, statusDescription; + global::System.Management.Automation.ProgressRecordType recordType; + if (progress < 100) + { + activityMessage = "In progress"; + statusDescription = "Checking operation status"; + recordType = System.Management.Automation.ProgressRecordType.Processing; + } + else + { + activityMessage = "Completed"; + statusDescription = "Completed"; + recordType = System.Management.Automation.ProgressRecordType.Completed; + } + WriteProgress(new global::System.Management.Automation.ProgressRecord(1, activityMessage, statusDescription) + { + PercentComplete = progress, + RecordType = recordType + }); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.Signal(id, token, messageData, (i, t, m) => ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(i, t, () => Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventDataConverter.ConvertFrom(m()) as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.EventData), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'JobsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName, this.ExtensibleParameters); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.JobsUpdateViaJsonString(SubscriptionId, ResourceGroupName, Name, this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null, _jsonString, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,ResourceGroupName=ResourceGroupName,Name=Name,AcceptLanguage=this.InvocationInformation.BoundParameters.ContainsKey("AcceptLanguage") ? AcceptLanguage : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Initializes a new instance of the cmdlet class. + /// + public UpdateAzImportExport_UpdateViaJsonString() + { + + } + + /// + new protected void WriteObject(object sendToPipeline) + { + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline); + } + + /// + /// + new protected void WriteObject(object sendToPipeline, bool enumerateCollection) + { + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Module.Instance.SanitizeOutput?.Invoke(sendToPipeline, __correlationId); + base.WriteObject(sendToPipeline, enumerateCollection); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IJobResponse + var result = (await response); + if (null != result) + { + if (0 == _responseSize) + { + _firstResponse = result; + _responseSize = 1; + } + else + { + if (1 ==_responseSize) + { + // Flush buffer + WriteObject(_firstResponse.AddMultipleTypeNameIntoPSObject()); + } + WriteObject(result.AddMultipleTypeNameIntoPSObject()); + _responseSize = 2; + } + } + } + } + } +} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs new file mode 100644 index 000000000000..80133da55415 --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/Attributes/ExternalDocsAttribute.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport +{ + using System; + using System.Collections.Generic; + using System.Text; + + [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = true)] + public class ExternalDocsAttribute : Attribute + { + + public string Description { get; } + + public string Url { get; } + + public ExternalDocsAttribute(string url) + { + Url = url; + } + + public ExternalDocsAttribute(string url, string description) + { + Url = url; + Description = description; + } + } +} diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs new file mode 100644 index 000000000000..e8e89fcd02fb --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/Attributes/PSArgumentCompleterAttribute.cs @@ -0,0 +1,52 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// 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. +// ---------------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport +{ + public class PSArgumentCompleterAttribute : ArgumentCompleterAttribute + { + internal string[] ResourceTypes; + + public PSArgumentCompleterAttribute(params string[] argumentList) : base(CreateScriptBlock(argumentList)) + { + ResourceTypes = argumentList; + } + + public static ScriptBlock CreateScriptBlock(string[] resourceTypes) + { + List outputResourceTypes = new List(); + foreach (string resourceType in resourceTypes) + { + if (resourceType.Contains(" ")) + { + outputResourceTypes.Add("\'\'" + resourceType + "\'\'"); + } + else + { + outputResourceTypes.Add(resourceType); + } + } + string scriptResourceTypeList = "'" + String.Join("' , '", outputResourceTypes) + "'"; + string script = "param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)\n" + + String.Format("$values = {0}\n", scriptResourceTypeList) + + "$values | Where-Object { $_ -Like \"$wordToComplete*\" -or $_ -Like \"'$wordToComplete*\" } | Sort-Object | ForEach-Object { [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_) }"; + ScriptBlock scriptBlock = ScriptBlock.Create(script); + return scriptBlock; + } + } +} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs index e7de897c50c1..e5b0d85aa8ca 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -20,11 +20,13 @@ public class ExportFormatPs1xml : PSCmdlet public string FilePath { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; private const string PropertiesExcludedForTableview = @"Id,Type"; private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private static string SelectedBySuffix = @"#Multiple"; + protected override void ProcessRecord() { try @@ -76,7 +78,7 @@ private static View CreateViewModel(ViewParameters viewParameters) Name = viewParameters.Type.FullName, ViewSelectedBy = new ViewSelectedBy { - TypeName = viewParameters.Type.FullName + TypeName = string.Concat(viewParameters.Type.FullName, SelectedBySuffix) }, TableControl = new TableControl { diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs index 832153ac7023..b0aca9e0106e 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -24,7 +24,7 @@ public class ExportModelSurface : PSCmdlet public bool UseExpandedFormat { get; set; } private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models"; - private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Support"; + private const string SupportNamespace = @"${$project.supportNamespace.fullName}"; protected override void ProcessRecord() { diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs index 7bf162c915ab..6f2ff288653e 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -70,9 +70,8 @@ protected override void ProcessRecord() var variantGroups = profileGroups.SelectMany(pg => pg.Variants .GroupBy(v => new { v.CmdletName, v.IsInternal }) .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), - Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) .ToArray(); - var license = new StringBuilder(); license.Append(@" # ---------------------------------------------------------------------------------- @@ -114,6 +113,7 @@ protected override void ProcessRecord() sb.Append("param("); sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) { var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs index 260f9107ec51..04adfa08b822 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -137,7 +137,7 @@ protected override void ProcessRecord() } else { - var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().ToPsList(); sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); } @@ -148,8 +148,10 @@ protected override void ProcessRecord() } else { - var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); - sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().ToPsList(); + if (!String.IsNullOrEmpty(aliasesList)) { + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } } // CmdletsToExport diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs index 50dccbf11b29..0ccf384e26a5 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -12,50 +12,96 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell { - [Cmdlet(VerbsData.Export, "TestStub")] - [DoNotExport] - public class ExportTestStub : PSCmdlet - { - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ModuleName { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string ExportsFolder { get; set; } - - [Parameter(Mandatory = true)] - [ValidateNotNullOrEmpty] - public string OutputFolder { get; set; } - - [Parameter] - public SwitchParameter IncludeGenerated { get; set; } - - protected override void ProcessRecord() + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet { - try - { - if (!Directory.Exists(ExportsFolder)) - { - throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); - } + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } - var exportDirectories = Directory.GetDirectories(ExportsFolder); - if (!exportDirectories.Any()) - { - exportDirectories = new[] { ExportsFolder }; - } - var utilFile = Path.Combine(OutputFolder, "utils.ps1"); - if (!File.Exists(utilFile)) + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() { - var sc = new StringBuilder(); - sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + /*var loadEnvFile = Path.Combine(OutputFolder, "loadEnv.ps1"); + if (!File.Exists(loadEnvFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@" +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json +}"); + File.WriteAllText(loadEnvFile, sc.ToString()); + }*/ + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { if ($allChars) { return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) } else { return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) } } +function Start-TestSleep { + [CmdletBinding(DefaultParameterSetName = 'SleepBySeconds')] + param( + [parameter(Mandatory = $true, Position = 0, ParameterSetName = 'SleepBySeconds')] + [ValidateRange(0.0, 2147483.0)] + [double] $Seconds, + + [parameter(Mandatory = $true, ParameterSetName = 'SleepByMilliseconds')] + [ValidateRange('NonNegative')] + [Alias('ms')] + [int] $Milliseconds + ) + + if ($TestMode -ne 'playback') { + switch ($PSCmdlet.ParameterSetName) { + 'SleepBySeconds' { + Start-Sleep -Seconds $Seconds + } + 'SleepByMilliseconds' { + Start-Sleep -Milliseconds $Milliseconds + } + } + } +} + $env = @{} if ($UsePreviousConfigForRecord) { $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json @@ -80,37 +126,40 @@ function cleanupEnv() { # Clean resources you create for testing } "); - File.WriteAllText(utilFile, sc.ToString()); - } - foreach (var exportDirectory in exportDirectories) - { - var outputFolder = OutputFolder; - if (exportDirectory != ExportsFolder) - { - outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); - Directory.CreateDirectory(outputFolder); - } - - var variantGroups = GetScriptCmdlets(exportDirectory) - .SelectMany(fi => fi.ToVariants()) - .Where(v => !v.IsDoNotExport) - .GroupBy(v => v.CmdletName) - .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) - .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); - - foreach (var variantGroup in variantGroups) - { - var sb = new StringBuilder(); - sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); - sb.AppendLine(@"{ + File.WriteAllText(utilFile, sc.ToString()); + } + + + + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' if (-Not (Test-Path -Path $loadEnvPath)) { $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' } . ($loadEnvPath)" -); - sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); - sb.AppendLine(@" $currentPath = $PSScriptRoot + ); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot while(-not $mockingPath) { $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File $currentPath = Split-Path -Path $currentPath -Parent @@ -120,29 +169,29 @@ function cleanupEnv() { "); - sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); - var variants = variantGroup.Variants - .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) - .ToList(); + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); - foreach (var variant in variants) + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) { - sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); - sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); - var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; - sb.AppendLine($"{Indent}}}{variantSeparator}"); + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; } - sb.AppendLine("}"); - - File.WriteAllText(variantGroup.FilePath, sb.ToString()); - } } - } - catch (Exception ee) - { - Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); - throw ee; - } } - } } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs index da75b0c57e92..156bfb7630ac 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -94,7 +94,7 @@ public static void WriteMarkdowns(IEnumerable variantGroups, PsMod sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); foreach (var relatedLink in markdownInfo.RelatedLinks) { - sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"[{relatedLink}]({relatedLink}){Environment.NewLine}{Environment.NewLine}"); } File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs index b56fd1affca2..8782f6aa97e5 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -31,7 +31,7 @@ internal class MarkdownHelpInfo public string[] Inputs { get; } public string[] Outputs { get; } public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } - public string[] RelatedLinks { get; } + public MarkdownRelatedLinkInfo[] RelatedLinks { get; } public bool SupportsShouldProcess { get; } public bool SupportsPaging { get; } @@ -67,7 +67,11 @@ public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; OnlineVersion = commentInfo.OnlineVersion; - RelatedLinks = commentInfo.RelatedLinks; + + var relatedLinkLists = new List(); + relatedLinkLists.AddRange(commentInfo.RelatedLinks?.Select(link => new MarkdownRelatedLinkInfo(link))); + relatedLinkLists.AddRange(variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Distinct()?.Select(link => new MarkdownRelatedLinkInfo(link.Url, link.Description))); + RelatedLinks = relatedLinkLists?.ToArray(); SupportsShouldProcess = variantGroup.SupportsShouldProcess; SupportsPaging = variantGroup.SupportsPaging; @@ -218,14 +222,45 @@ public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, Param } } + internal class MarkdownRelatedLinkInfo + { + public string Url { get; } + public string Description { get; } + + public MarkdownRelatedLinkInfo(string url) + { + Url = url; + } + + public MarkdownRelatedLinkInfo(string url, string description) + { + Url = url; + Description = description; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(Description)) + { + return Url; + } + else + { + return $@"[{Description}]({Url})"; + + } + + } + } + internal static class MarkdownTypesExtensions { public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks); public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos = { - new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), - new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here (remove the output block if the example doesn't have an output) }}}}", @"{{ Add description here }}"), }; public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs index d8db36475b3f..870c35bb974c 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -121,6 +121,21 @@ public override string ToString() => CompleterInfo != null : String.Empty; } + internal class PSArgumentCompleterOutput : ArgumentCompleterOutput + { + public PSArgumentCompleterInfo PSArgumentCompleterInfo { get; } + + public PSArgumentCompleterOutput(PSArgumentCompleterInfo completerInfo) : base(completerInfo) + { + PSArgumentCompleterInfo = completerInfo; + } + + + public override string ToString() => PSArgumentCompleterInfo != null + ? $"{Indent}[{typeof(PSArgumentCompleterAttribute)}({(PSArgumentCompleterInfo.IsTypeCompleter ? $"[{PSArgumentCompleterInfo.Type.Unwrap().ToPsType()}]" : $"{PSArgumentCompleterInfo.ResourceTypes?.Select(r => $"\"{r}\"")?.JoinIgnoreEmpty(", ")}")})]{Environment.NewLine}" + : String.Empty; + } + internal class DefaultInfoOutput { public bool HasDefaultInfo { get; } @@ -173,6 +188,7 @@ internal class BaseOutput public VariantGroup VariantGroup { get; } protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) { VariantGroup = variantGroup; @@ -200,6 +216,21 @@ public string GetProcessCustomAttributesAtRuntime() {Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.MessageAttributeHelper]::ProcessPreviewMessageAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; } + private string GetLoginVerification() + { + if (!VariantGroup.IsInternal && IsAzure && !VariantGroup.IsModelCmdlet) + { + return $@" +{Indent}{Indent}$context = Get-AzContext +{Indent}{Indent}if (-not $context -and -not $testPlayback) {{ +{Indent}{Indent}{Indent}Write-Error ""No Azure login detected. Please run 'Connect-AzAccount' to log in."" +{Indent}{Indent}{Indent}exit +{Indent}{Indent}}} +"; + } + return ""; + } + private string GetTelemetry() { if (!VariantGroup.IsInternal && IsAzure) @@ -232,10 +263,16 @@ public override string ToString() => $@"begin {{ {Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 {Indent}{Indent}}} {Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName -{GetTelemetry()} +{Indent}{Indent} +{Indent}{Indent}$testPlayback = $false +{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }} +{GetLoginVerification()}{GetTelemetry()} {GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} {GetProcessCustomAttributesAtRuntime()} {Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}if ($wrappedCmd -eq $null) {{ +{Indent}{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) +{Indent}{Indent}}} {Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} {Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) {Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) @@ -269,13 +306,16 @@ private string GetDefaultValuesStatements() var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); var parameterName = defaultInfo.ParameterGroup.ParameterName; sb.AppendLine(); + var setCondition = " "; + if (!String.IsNullOrEmpty(defaultInfo.SetCondition)) + { + setCondition = $" -and {defaultInfo.SetCondition}"; + } //Yabo: this is bad to hard code the subscription id, but autorest load input README.md reversely (entry readme -> required readme), there are no other way to //override default value set in required readme if ("SubscriptionId".Equals(parameterName)) { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); - sb.AppendLine($"{Indent}{Indent}{Indent}$testPlayback = $false"); - sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object {{ if ($_) {{ $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) }} }}"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}if ($testPlayback) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1')"); sb.AppendLine($"{Indent}{Indent}{Indent}}} else {{"); @@ -285,13 +325,15 @@ private string GetDefaultValuesStatements() } else { - sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}'){setCondition}) {{"); sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); sb.Append($"{Indent}{Indent}}}"); } + } return sb.ToString(); } + } internal class ProcessOutput : BaseOutput @@ -381,6 +423,8 @@ public override string ToString() var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var externalUrls = String.Join(Environment.NewLine, CommentInfo.ExternalUrls.Select(l => $".Link{Environment.NewLine}{l}")); + var externalUrlsText = !String.IsNullOrEmpty(externalUrls) ? $"{Environment.NewLine}{externalUrls}" : String.Empty; var examples = ""; foreach (var example in VariantGroup.HelpInfo.Examples) { @@ -393,7 +437,7 @@ public override string ToString() {CommentInfo.Description.ToDescriptionFormat(false)} {examples}{inputsText}{outputsText}{notesText} .Link -{CommentInfo.OnlineVersion}{relatedLinksText} +{CommentInfo.OnlineVersion}{relatedLinksText}{externalUrlsText} #> "; } @@ -587,7 +631,9 @@ public static string ToSyntaxTypeName(this Type type) public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); - public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => (completerInfo is PSArgumentCompleterInfo psArgumentCompleterInfo) ? psArgumentCompleterInfo.ToArgumentCompleterOutput() : new ArgumentCompleterOutput(completerInfo); + + public static PSArgumentCompleterOutput ToArgumentCompleterOutput(this PSArgumentCompleterInfo completerInfo) => new PSArgumentCompleterOutput(completerInfo); public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs index 2c972ef9ab47..29343bec6c2d 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -31,7 +31,7 @@ internal class VariantGroup { public string ModuleName { get; } - public string RootModuleName {get => @"";} + public string RootModuleName { get => @""; } public string CmdletName { get; } public string CmdletVerb { get; } public string CmdletNoun { get; } @@ -49,7 +49,7 @@ internal class VariantGroup public PsHelpInfo HelpInfo { get; } public bool IsGenerated { get; } public bool IsInternal { get; } - + public bool IsModelCmdlet { get; } public string OutputFolder { get; } public string FileName { get; } public string FilePath { get; } @@ -84,7 +84,7 @@ public VariantGroup(string moduleName, string cmdletName, Variant[] variants, st HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); IsInternal = isInternal; - + IsModelCmdlet = Variants.All(v => v.IsModelCmdlet); OutputFolder = outputFolder; FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; FilePath = Path.Combine(OutputFolder, FileName); @@ -101,12 +101,23 @@ private string DetermineDefaultParameterSetName() if (String.IsNullOrEmpty(defaultParameterSet)) { var variantParamCountGroups = Variants + .Where(v => !v.IsNotSuggestDefaultParameterSet) .Select(v => ( variant: v.VariantName, paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) .GroupBy(vpc => vpc.isSimple) .ToArray(); + if (variantParamCountGroups.Length == 0) + { + variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + } var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; @@ -134,7 +145,9 @@ internal class Variant public Parameter[] Parameters { get; } public Parameter[] CmdletOnlyParameters { get; } public bool IsInternal { get; } + public bool IsModelCmdlet { get; } public bool IsDoNotExport { get; } + public bool IsNotSuggestDefaultParameterSet { get; } public string[] Profiles { get; } public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) @@ -155,6 +168,8 @@ public Variant(string cmdletName, string variantName, CommandInfo info, CommandM Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); IsInternal = Attributes.OfType().Any(); IsDoNotExport = Attributes.OfType().Any(); + IsModelCmdlet = Attributes.OfType().Any(); + IsNotSuggestDefaultParameterSet = Attributes.OfType().Any(); CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); } @@ -210,6 +225,7 @@ public ParameterGroup(string parameterName, Parameter[] parameters, string[] all HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.PSArgumentCompleterAttribute).FirstOrDefault()?.ToPSArgumentCompleterInfo() ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); @@ -244,7 +260,6 @@ internal class Parameter public ParameterMetadata Metadata { get; } public PsParameterHelpInfo HelpInfo { get; } public Type ParameterType { get; } - public Attribute[] Attributes { get; } public ParameterCategory[] Categories { get; } public ParameterCategory OrderCategory { get; } @@ -254,6 +269,7 @@ internal class Parameter public bool SupportsWildcards { get; } public CompleterInfoAttribute CompleterInfoAttribute { get; } public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + public PSArgumentCompleterAttribute PSArgumentCompleterAttribute { get; } public bool ValueFromPipeline { get; } public bool ValueFromPipelineByPropertyName { get; } @@ -286,7 +302,8 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met } SupportsWildcards = Attributes.OfType().Any(); CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); - ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + PSArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(attr => !attr.GetType().Equals(typeof(PSArgumentCompleterAttribute))); ValueFromPipeline = ParameterAttribute.ValueFromPipeline; ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; @@ -295,10 +312,10 @@ public Parameter(string variantName, string parameterName, ParameterMetadata met IsMandatory = ParameterAttribute.Mandatory; var complexParameterName = ParameterName.ToUpperInvariant(); - var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var complexMessage = $"{Environment.NewLine}"; var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; // Remove the complex type message as it will be reinserted if this is a complex type - description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + description = description.NormalizeNewLines(); // Make an InfoAttribute for processing only if one isn't provided InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; // Set the description if the InfoAttribute does not have one since they are exported without a description @@ -318,7 +335,7 @@ internal class ComplexInterfaceInfo public bool Required { get; } public bool ReadOnly { get; } public string Description { get; } - + public ComplexInterfaceInfo[] NestedInfos { get; } public bool IsComplexInterface { get; } @@ -335,7 +352,7 @@ public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, var unwrappedType = Type.Unwrap(); var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); - NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[] { } : unwrappedType.GetInterfaces() .Concat(InfoAttribute.PossibleTypes) .SelectMany(pt => pt.GetProperties() @@ -366,6 +383,7 @@ internal class CommentInfo public string OnlineVersion { get; } public string[] RelatedLinks { get; } + public string[] ExternalUrls { get; } private const string HelpLinkPrefix = @"https://learn.microsoft.com/powershell/module/"; @@ -391,6 +409,9 @@ public CommentInfo(VariantGroup variantGroup) var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + + // Get external urls from attribute + ExternalUrls = variantGroup.Variants.SelectMany(v => v.Attributes).OfType()?.Select(e => e.Url)?.Distinct()?.ToArray(); } } @@ -420,11 +441,22 @@ public CompleterInfo(ArgumentCompleterAttribute completerAttribute) } } + internal class PSArgumentCompleterInfo : CompleterInfo + { + public string[] ResourceTypes { get; } + + public PSArgumentCompleterInfo(PSArgumentCompleterAttribute completerAttribute) : base(completerAttribute) + { + ResourceTypes = completerAttribute.ResourceTypes; + } + } + internal class DefaultInfo { public string Name { get; } public string Description { get; } public string Script { get; } + public string SetCondition { get; } public ParameterGroup ParameterGroup { get; } public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) @@ -432,6 +464,7 @@ public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterG Name = infoAttribute.Name; Description = infoAttribute.Description; Script = infoAttribute.Script; + SetCondition = infoAttribute.SetCondition; ParameterGroup = parameterGroup; } @@ -479,7 +512,8 @@ public static Parameter[] ToParameters(this Variant variant) parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); } var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); - if (variant.SupportsPaging) { + if (variant.SupportsPaging) + { // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; @@ -507,7 +541,7 @@ public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute inf public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); - + public static PSArgumentCompleterInfo ToPSArgumentCompleterInfo(this PSArgumentCompleterAttribute completerAttribute) => new PSArgumentCompleterInfo(completerAttribute); public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/PsAttributes.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/PsAttributes.cs index b6ac2982ee9d..98471a069493 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/PsAttributes.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/PsAttributes.cs @@ -22,6 +22,11 @@ public class DoNotExportAttribute : Attribute { } + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class ModelCmdletAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Class)] public class InternalExportAttribute : Attribute { @@ -55,6 +60,11 @@ public class HttpPathAttribute : Attribute public string ApiVersion { get; set; } } + [AttributeUsage(AttributeTargets.Class)] + public class NotSuggestDefaultParameterSetAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] public class CategoryAttribute : Attribute { @@ -109,6 +119,11 @@ public enum PropertyOrigin Inlined } + [AttributeUsage(AttributeTargets.Property)] + public class ConstantAttribute : Attribute + { + } + [AttributeUsage(AttributeTargets.Property)] public class FormatTableAttribute : Attribute { diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/PsExtensions.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/PsExtensions.cs index b81630c3cf19..c1d2062ea3ac 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/PsExtensions.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/PsExtensions.cs @@ -13,6 +13,13 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PowerShell { internal static class PsExtensions { + public static PSObject AddMultipleTypeNameIntoPSObject(this object obj, string multipleTag = "#Multiple") + { + var psObj = new PSObject(obj); + psObj.TypeNames.Insert(0, $"{psObj.TypeNames[0]}{multipleTag}"); + return psObj; + } + // https://stackoverflow.com/a/863944/294804 // https://stackoverflow.com/a/4452598/294804 // https://stackoverflow.com/a/28701974/294804 diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/PsHelpers.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/PsHelpers.cs index 3dccfcd70489..351afabef884 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/PsHelpers.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/BuildTime/PsHelpers.cs @@ -67,7 +67,7 @@ public static IEnumerable GetScriptHelpInfo(params string[] modulePath public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) { - var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" )); return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) @@ -88,7 +88,7 @@ public static Guid ReadGuidFromPsd1(string psd1Path) if (File.Exists(psd1Path)) { var currentGuid = File.ReadAllLines(psd1Path) - .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .FirstOrDefault(l => l.TrimStart().StartsWith(GuidStart.TrimStart()))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) .LastOrDefault()?.Replace("'", String.Empty); guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; } diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/Context.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/Context.cs new file mode 100644 index 000000000000..1fba4984a82c --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/Context.cs @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime +{ + + using System; + using System.Linq; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData = System.Func; + using static Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Extensions; + + /// + /// The IContext Interface defines the communication mechanism for input customization. + /// + /// + /// In the context, we will have client, pipeline, PSBoundParamters, default EventListener, Cancellation. + /// + public interface IContext + { + System.Management.Automation.InvocationInfo InvocationInformation { get; set; } + System.Threading.CancellationTokenSource CancellationTokenSource { get; set; } + System.Collections.Generic.IDictionary ExtensibleParameters { get; } + HttpPipeline Pipeline { get; set; } + Microsoft.Azure.PowerShell.Cmdlets.ImportExport.ImportExport Client { get; } + } +} diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/Events.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/Events.cs index e7c9cf81170e..03b4a07dba09 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/Events.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/Events.cs @@ -22,6 +22,6 @@ public static partial class Events public const string FollowingNextLink = nameof(FollowingNextLink); public const string DelayBeforePolling = nameof(DelayBeforePolling); public const string Polling = nameof(Polling); - + public const string Progress = nameof(Progress); } -} \ No newline at end of file +} diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/ISendAsync.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/ISendAsync.cs index 401aef5cb5d9..3ec373187827 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/ISendAsync.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/ISendAsync.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime using System.Threading.Tasks; using System.Collections; using System.Linq; + using System; + /// /// The interface for sending an HTTP request across the wire. @@ -70,6 +72,7 @@ public interface ISendAsyncTerminalFactory public partial class HttpPipeline : ISendAsync { + private const int DefaultMaxRetry = 3; private ISendAsync pipeline; private ISendAsyncTerminalFactory terminal; private List steps = new List(); @@ -92,6 +95,111 @@ public HttpPipeline(ISendAsyncTerminalFactory terminalStep) /// public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + private bool shouldRetry429(HttpResponseMessage response) + { + if (response.StatusCode == (System.Net.HttpStatusCode)429) + { + var retryAfter = response.Headers.RetryAfter; + if (retryAfter != null && retryAfter.Delta.HasValue) + { + return true; + } + } + return false; + } + /// + /// The step to handle 429 response with retry-after header. + /// + public async Task Retry429(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = int.MaxValue; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES_FOR_429")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES_FOR_429")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetry429(response) && count++ < retryCount) + { + request = await cloneRequest.CloneWithContent(); + var retryAfter = response.Headers.RetryAfter; + await Task.Delay(retryAfter.Delta.Value, callback.Token); + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code 429 after waiting {retryAfter.Delta.Value.TotalSeconds} seconds."); + response = await next.SendAsync(request, callback); + } + return response; + } + + private bool shouldRetryError(HttpResponseMessage response) + { + if (response.StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + if (response.StatusCode != System.Net.HttpStatusCode.NotImplemented && + response.StatusCode != System.Net.HttpStatusCode.HttpVersionNotSupported) + { + return true; + } + } + else if (response.StatusCode == System.Net.HttpStatusCode.RequestTimeout) + { + return true; + } + else if (response.StatusCode == (System.Net.HttpStatusCode)429 && response.Headers.RetryAfter == null) + { + return true; + } + return false; + } + + /// + /// Returns true if status code in HttpRequestExceptionWithStatus exception is greater + /// than or equal to 500 and not NotImplemented (501) or HttpVersionNotSupported (505). + /// Or it's 429 (TOO MANY REQUESTS) without Retry-After header. + /// + public async Task RetryError(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + int retryCount = DefaultMaxRetry; + + try + { + try + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("PS_HTTP_MAX_RETRIES")); + } + finally + { + retryCount = int.Parse(System.Environment.GetEnvironmentVariable("AZURE_PS_HTTP_MAX_RETRIES")); + } + } + catch (System.Exception) + { + //no action + } + var cloneRequest = await request.CloneWithContent(); + var response = await next.SendAsync(request, callback); + int count = 0; + while (shouldRetryError(response) && count++ < retryCount) + { + await callback.Signal("Debug", $"Start to retry {count} time(s) on status code {response.StatusCode}"); + request = await cloneRequest.CloneWithContent(); + response = await next.SendAsync(request, callback); + } + return response; + } + public ISendAsyncTerminalFactory TerminalFactory { get => terminal; @@ -117,6 +225,11 @@ public ISendAsync Pipeline // create the pipeline from scratch. var next = terminal.Create(); + if (Convert.ToBoolean(@"true")) + { + next = (new SendAsyncFactory(Retry429)).Create(next) ?? next; + next = (new SendAsyncFactory(RetryError)).Create(next) ?? next; + } foreach (var factory in steps) { // skip factories that return null. diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/InfoAttribute.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/InfoAttribute.cs index d9d11f4f0ce9..b5228c94cf7a 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/InfoAttribute.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/InfoAttribute.cs @@ -11,6 +11,9 @@ public class InfoAttribute : Attribute { public bool Required { get; set; } = false; public bool ReadOnly { get; set; } = false; + public bool Read { get; set; } = true; + public bool Create { get; set; } = true; + public bool Update { get; set; } = true; public Type[] PossibleTypes { get; set; } = new Type[0]; public string Description { get; set; } = ""; public string SerializedName { get; set; } = ""; @@ -30,5 +33,6 @@ public class DefaultInfoAttribute : Attribute public string Script { get; set; } = ""; public string Name { get; set; } = ""; public string Description { get; set; } = ""; + public string SetCondition { get; set; } = ""; } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/InputHandler.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/InputHandler.cs new file mode 100644 index 000000000000..d72e29fb5770 --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/InputHandler.cs @@ -0,0 +1,22 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.Cmdlets +{ + public abstract class InputHandler + { + protected InputHandler NextHandler = null; + + public void SetNextHandler(InputHandler nextHandler) + { + this.NextHandler = nextHandler; + } + + public abstract void Process(Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.IContext context); + } +} \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs index 4d8875c7c9a3..7e3f62d90273 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -21,6 +21,11 @@ internal XNodeArray(params JsonNode[] values) items = new List(values); } + internal XNodeArray(System.Collections.Generic.List values) + { + items = new List(values); + } + public override JsonNode this[int index] => items[index]; internal override JsonType? ElementType => null; diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/SerializationMode.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/SerializationMode.cs index 2b6be1ea6d07..0e65a6b713f0 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/SerializationMode.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/SerializationMode.cs @@ -9,8 +9,10 @@ public enum SerializationMode { None = 0, IncludeHeaders = 1 << 0, - IncludeReadOnly = 1 << 1, - - IncludeAll = IncludeHeaders | IncludeReadOnly + IncludeRead = 1 << 1, + IncludeCreate = 1 << 2, + IncludeUpdate = 1 << 3, + IncludeAll = IncludeHeaders | IncludeRead | IncludeCreate | IncludeUpdate, + IncludeCreateOrUpdate = IncludeCreate | IncludeUpdate } } \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/generated/runtime/TypeConverterExtensions.cs b/generated/ImportExport/ImportExport.Autorest/generated/runtime/TypeConverterExtensions.cs index 49617fcb9497..c5d9b1bc4875 100644 --- a/generated/ImportExport/ImportExport.Autorest/generated/runtime/TypeConverterExtensions.cs +++ b/generated/ImportExport/ImportExport.Autorest/generated/runtime/TypeConverterExtensions.cs @@ -62,6 +62,56 @@ internal static T[] SelectToArray(object source, System.Func return result.ToArray(); } + internal static System.Collections.Generic.List SelectToList(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }.ToList(); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0].ToList(); // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result; + } internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) { if (null != dictionary) diff --git a/generated/ImportExport/ImportExport.Autorest/internal/Get-AzImportExportBitLockerKey.ps1 b/generated/ImportExport/ImportExport.Autorest/internal/Get-AzImportExportBitLockerKey.ps1 index 0d9a26d03415..ad449efc5307 100644 --- a/generated/ImportExport/ImportExport.Autorest/internal/Get-AzImportExportBitLockerKey.ps1 +++ b/generated/ImportExport/ImportExport.Autorest/internal/Get-AzImportExportBitLockerKey.ps1 @@ -23,12 +23,12 @@ Returns the BitLocker Keys for all drives in the specified job. Get-AzImportExportBitLockerKey -JobName test-job -ResourceGroupName ImportTestRG .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey .Link https://learn.microsoft.com/powershell/module/az.importexport/get-azimportexportbitlockerkey #> function Get-AzImportExportBitLockerKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -112,13 +112,14 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.ImportExport.private\Get-AzImportExportBitLockerKey_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -127,6 +128,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ImportExport/ImportExport.Autorest/internal/Get-AzOperation.ps1 b/generated/ImportExport/ImportExport.Autorest/internal/Get-AzOperation.ps1 index 127472445b60..693b4bdf741e 100644 --- a/generated/ImportExport/ImportExport.Autorest/internal/Get-AzOperation.ps1 +++ b/generated/ImportExport/ImportExport.Autorest/internal/Get-AzOperation.ps1 @@ -25,12 +25,12 @@ Returns the list of operations supported by the import/export resource provider. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.importexport/get-azoperation #> function Get-AzOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -95,12 +95,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.ImportExport.private\Get-AzOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ImportExport/ImportExport.Autorest/internal/ProxyCmdletDefinitions.ps1 b/generated/ImportExport/ImportExport.Autorest/internal/ProxyCmdletDefinitions.ps1 index ce50f74778fb..663ca5fdce6d 100644 --- a/generated/ImportExport/ImportExport.Autorest/internal/ProxyCmdletDefinitions.ps1 +++ b/generated/ImportExport/ImportExport.Autorest/internal/ProxyCmdletDefinitions.ps1 @@ -23,12 +23,12 @@ Returns the BitLocker Keys for all drives in the specified job. Get-AzImportExportBitLockerKey -JobName test-job -ResourceGroupName ImportTestRG .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey .Link https://learn.microsoft.com/powershell/module/az.importexport/get-azimportexportbitlockerkey #> function Get-AzImportExportBitLockerKey { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IDriveBitLockerKey])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IDriveBitLockerKey])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] param( [Parameter(Mandatory)] @@ -112,13 +112,14 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.ImportExport.private\Get-AzImportExportBitLockerKey_List'; } - if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { - $testPlayback = $false - $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId') ) { if ($testPlayback) { $PSBoundParameters['SubscriptionId'] = . (Join-Path $PSScriptRoot '..' 'utils' 'Get-SubscriptionIdTestSafe.ps1') } else { @@ -127,6 +128,9 @@ begin { } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) @@ -167,12 +171,12 @@ Returns the list of operations supported by the import/export resource provider. {{ Add code here }} .Outputs -Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation +Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation .Link https://learn.microsoft.com/powershell/module/az.importexport/get-azoperation #> function Get-AzOperation { -[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.Api202101.IOperation])] +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Models.IOperation])] [CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] param( [Parameter()] @@ -237,12 +241,18 @@ begin { $PSBoundParameters['OutBuffer'] = 1 } $parameterSet = $PSCmdlet.ParameterSetName + + $testPlayback = $false + $PSBoundParameters['HttpPipelinePrepend'] | Foreach-Object { if ($_) { $testPlayback = $testPlayback -or ('Microsoft.Azure.PowerShell.Cmdlets.ImportExport.Runtime.PipelineMock' -eq $_.Target.GetType().FullName -and 'Playback' -eq $_.Target.Mode) } } $mapping = @{ List = 'Az.ImportExport.private\Get-AzOperation_List'; } $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + if ($wrappedCmd -eq $null) { + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Function) + } $scriptCmd = {& $wrappedCmd @PSBoundParameters} $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) diff --git a/generated/ImportExport/ImportExport.Autorest/resources/README.md b/generated/ImportExport/ImportExport.Autorest/resources/README.md new file mode 100644 index 000000000000..937f07f8fec2 --- /dev/null +++ b/generated/ImportExport/ImportExport.Autorest/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `..\custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/generated/ImportExport/ImportExport.Autorest/test-module.ps1 b/generated/ImportExport/ImportExport.Autorest/test-module.ps1 index b311f42f0a92..06f30347671c 100644 --- a/generated/ImportExport/ImportExport.Autorest/test-module.ps1 +++ b/generated/ImportExport/ImportExport.Autorest/test-module.ps1 @@ -12,17 +12,17 @@ # Code generated by Microsoft (R) AutoRest Code Generator.Changes may cause incorrect behavior and will be lost if the code # is regenerated. # ---------------------------------------------------------------------------------- -param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +param([switch]$NotIsolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) $ErrorActionPreference = 'Stop' -if(-not $Isolated) +if(-not $NotIsolated) { Write-Host -ForegroundColor Green 'Creating isolated process...' if ($PSBoundParameters.ContainsKey("TestName")) { $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," } $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path - & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -NotIsolated return } @@ -34,7 +34,7 @@ if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and $ProgressPreference = 'SilentlyContinue' $baseName = $PSScriptRoot.BaseName $requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) -. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -NotIsolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule . ("$PSScriptRoot\test\utils.ps1") if ($requireResourceModule) @@ -95,4 +95,4 @@ try } } -Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file +Write-Host -ForegroundColor Green '-------------Done-------------'